11#ifndef EIGEN_INVERSE_H
12#define EIGEN_INVERSE_H
15#include "./InternalHeaderCheck.h"
19template <
typename XprType,
typename StorageKind>
24template <
typename XprType>
25struct traits<Inverse<XprType> > : traits<typename XprType::PlainObject> {
26 using PlainObject =
typename XprType::PlainObject;
27 using BaseTraits = traits<PlainObject>;
43template <
typename XprType>
44class Inverse :
public InverseImpl<XprType, typename internal::traits<XprType>::StorageKind> {
46 using StorageIndex =
typename XprType::StorageIndex;
47 using Scalar =
typename XprType::Scalar;
48 using XprTypeNested =
typename internal::ref_selector<XprType>::type;
49 using XprTypeNestedCleaned = internal::remove_all_t<XprTypeNested>;
50 using Nested =
typename internal::ref_selector<Inverse>::type;
51 using NestedExpression = internal::remove_all_t<XprType>;
53 explicit EIGEN_DEVICE_FUNC
constexpr Inverse(
const XprType& xpr) : m_xpr(xpr) {}
55 EIGEN_DEVICE_FUNC
constexpr Index rows()
const noexcept {
return m_xpr.cols(); }
56 EIGEN_DEVICE_FUNC
constexpr Index cols()
const noexcept {
return m_xpr.rows(); }
58 EIGEN_DEVICE_FUNC
constexpr const XprTypeNestedCleaned& nestedExpression()
const {
return m_xpr; }
65template <
typename XprType,
typename StorageKind>
66class InverseImpl :
public internal::generic_xpr_base<Inverse<XprType> >::type {
68 using Base =
typename internal::generic_xpr_base<Inverse<XprType>>::type;
69 using Scalar =
typename XprType::Scalar;
72 Scalar coeff(Index row, Index col)
const;
73 Scalar coeff(Index i)
const;
88template <
typename ArgType>
89struct unary_evaluator<Inverse<ArgType> > :
public evaluator<typename Inverse<ArgType>::PlainObject> {
90 using InverseType = Inverse<ArgType>;
91 using PlainObject =
typename InverseType::PlainObject;
92 using Base = evaluator<PlainObject>;
96 EIGEN_DEVICE_FUNC unary_evaluator(
const InverseType& inv_xpr) : m_result(inv_xpr.rows(), inv_xpr.cols()) {
97 internal::construct_at<Base>(
this, m_result);
98 internal::call_assignment_no_alias(m_result, inv_xpr);
102 PlainObject m_result;
constexpr unsigned int EvalBeforeNestingBit
Definition Constants.h:75
constexpr unsigned int RowMajorBit
Definition Constants.h:71