10 #ifndef EIGEN_INVERSE_H 11 #define EIGEN_INVERSE_H 14 #include "./InternalHeaderCheck.h" 18 template <
typename XprType,
typename StorageKind>
23 template <
typename XprType>
24 struct traits<Inverse<XprType> > : traits<typename XprType::PlainObject> {
25 typedef typename XprType::PlainObject PlainObject;
26 typedef traits<PlainObject> BaseTraits;
42 template <
typename XprType>
43 class Inverse :
public InverseImpl<XprType, typename internal::traits<XprType>::StorageKind> {
45 typedef typename XprType::StorageIndex StorageIndex;
46 typedef typename XprType::Scalar Scalar;
47 typedef typename internal::ref_selector<XprType>::type XprTypeNested;
48 typedef internal::remove_all_t<XprTypeNested> XprTypeNestedCleaned;
49 typedef typename internal::ref_selector<Inverse>::type Nested;
50 typedef internal::remove_all_t<XprType> NestedExpression;
52 explicit EIGEN_DEVICE_FUNC
Inverse(
const XprType& xpr) : m_xpr(xpr) {}
54 EIGEN_DEVICE_FUNC constexpr
Index rows()
const noexcept {
return m_xpr.cols(); }
55 EIGEN_DEVICE_FUNC constexpr
Index cols()
const noexcept {
return m_xpr.rows(); }
57 EIGEN_DEVICE_FUNC
const XprTypeNestedCleaned& nestedExpression()
const {
return m_xpr; }
64 template <
typename XprType,
typename StorageKind>
65 class InverseImpl :
public internal::generic_xpr_base<Inverse<XprType> >::type {
67 typedef typename internal::generic_xpr_base<Inverse<XprType> >::type Base;
68 typedef typename XprType::Scalar Scalar;
72 Scalar coeff(
Index i)
const;
87 template <
typename ArgType>
88 struct unary_evaluator<Inverse<ArgType> > :
public evaluator<typename Inverse<ArgType>::PlainObject> {
89 typedef Inverse<ArgType> InverseType;
90 typedef typename InverseType::PlainObject PlainObject;
91 typedef evaluator<PlainObject> Base;
95 EIGEN_DEVICE_FUNC unary_evaluator(
const InverseType& inv_xpr) : m_result(inv_xpr.rows(), inv_xpr.cols()) {
96 internal::construct_at<Base>(
this, m_result);
97 internal::call_assignment_no_alias(m_result, inv_xpr);
101 PlainObject m_result;
108 #endif // EIGEN_INVERSE_H Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
const unsigned int RowMajorBit
Definition: Constants.h:70
Expression of the inverse of another expression.
Definition: Inverse.h:43
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82
const unsigned int EvalBeforeNestingBit
Definition: Constants.h:74