Inverse.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2014-2019 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_INVERSE_H
11 #define EIGEN_INVERSE_H
12 
13 namespace Eigen {
14 
15 template<typename XprType,typename StorageKind> class InverseImpl;
16 
17 namespace internal {
18 
19 template<typename XprType>
21  : traits<typename XprType::PlainObject>
22 {
23  typedef typename XprType::PlainObject PlainObject;
25  enum {
26  Flags = BaseTraits::Flags & RowMajorBit
27  };
28 };
29 
30 } // end namespace internal
31 
42 template<typename XprType>
43 class Inverse : public InverseImpl<XprType,typename internal::traits<XprType>::StorageKind>
44 {
45 public:
46  typedef typename XprType::StorageIndex StorageIndex;
47  typedef typename XprType::Scalar Scalar;
52 
53  explicit EIGEN_DEVICE_FUNC Inverse(const XprType &xpr)
54  : m_xpr(xpr)
55  {}
56 
59 
61 
62 protected:
64 };
65 
66 // Generic API dispatcher
67 template<typename XprType, typename StorageKind>
68 class InverseImpl
69  : public internal::generic_xpr_base<Inverse<XprType> >::type
70 {
71 public:
73  typedef typename XprType::Scalar Scalar;
74 private:
75 
76  Scalar coeff(Index row, Index col) const;
77  Scalar coeff(Index i) const;
78 };
79 
80 namespace internal {
81 
92 template<typename ArgType>
93 struct unary_evaluator<Inverse<ArgType> >
94  : public evaluator<typename Inverse<ArgType>::PlainObject>
95 {
97  typedef typename InverseType::PlainObject PlainObject;
99 
100  enum { Flags = Base::Flags | EvalBeforeNestingBit };
101 
102  unary_evaluator(const InverseType& inv_xpr)
103  : m_result(inv_xpr.rows(), inv_xpr.cols())
104  {
105  ::new (static_cast<Base*>(this)) Base(m_result);
106  internal::call_assignment_no_alias(m_result, inv_xpr);
107  }
108 
109 protected:
111 };
112 
113 } // end namespace internal
114 
115 } // end namespace Eigen
116 
117 #endif // EIGEN_INVERSE_H
Eigen::Inverse
Expression of the inverse of another expression.
Definition: Inverse.h:43
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::internal::unary_evaluator< Inverse< ArgType > >::unary_evaluator
unary_evaluator(const InverseType &inv_xpr)
Definition: Inverse.h:102
Eigen::internal::traits< Inverse< XprType > >::BaseTraits
traits< PlainObject > BaseTraits
Definition: Inverse.h:24
col
m col(1)
Eigen::CwiseBinaryOp
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:77
Eigen::Inverse::XprTypeNestedCleaned
internal::remove_all< XprTypeNested >::type XprTypeNestedCleaned
Definition: Inverse.h:49
Eigen::RowMajorBit
const unsigned int RowMajorBit
Definition: Constants.h:66
EIGEN_CONSTEXPR
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
type
Definition: pytypes.h:1525
Eigen::Inverse::Scalar
XprType::Scalar Scalar
Definition: Inverse.h:47
Eigen::internal::call_assignment_no_alias
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition: AssignEvaluator.h:873
rows
int rows
Definition: Tutorial_commainit_02.cpp:1
Eigen::Inverse::cols
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: Inverse.h:58
Eigen::Inverse::XprTypeNested
internal::ref_selector< XprType >::type XprTypeNested
Definition: Inverse.h:48
Eigen::InverseImpl
Definition: Inverse.h:15
Eigen::Inverse::Nested
internal::ref_selector< Inverse >::type Nested
Definition: Inverse.h:50
Eigen::internal::true_type
Definition: Meta.h:96
Eigen::InverseImpl::Scalar
XprType::Scalar Scalar
Definition: Inverse.h:73
Eigen::Inverse::StorageIndex
XprType::StorageIndex StorageIndex
Definition: Inverse.h:46
Eigen::internal::generic_xpr_base
Definition: XprHelper.h:501
Eigen::internal::unary_evaluator< Inverse< ArgType > >::m_result
PlainObject m_result
Definition: Inverse.h:110
Eigen::Inverse::nestedExpression
const EIGEN_DEVICE_FUNC XprTypeNestedCleaned & nestedExpression() const
Definition: Inverse.h:60
Eigen::Triplet< double >
Eigen::Inverse::Inverse
EIGEN_DEVICE_FUNC Inverse(const XprType &xpr)
Definition: Inverse.h:53
Eigen::internal::evaluator
Definition: CoreEvaluators.h:90
Eigen::internal::unary_evaluator< Inverse< ArgType > >::PlainObject
InverseType::PlainObject PlainObject
Definition: Inverse.h:97
Eigen::Inverse::m_xpr
XprTypeNested m_xpr
Definition: Inverse.h:63
Eigen::InverseImpl::coeff
Scalar coeff(Index row, Index col) const
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::internal::unary_evaluator< Inverse< ArgType > >::Base
evaluator< PlainObject > Base
Definition: Inverse.h:98
Eigen::InverseImpl::Base
internal::generic_xpr_base< Inverse< XprType > >::type Base
Definition: Inverse.h:72
Eigen::Inverse::rows
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: Inverse.h:57
row
m row(1)
Eigen::internal::unary_evaluator
Definition: CoreEvaluators.h:65
Eigen::internal::unary_evaluator< Inverse< ArgType > >::InverseType
Inverse< ArgType > InverseType
Definition: Inverse.h:96
EIGEN_NOEXCEPT
#define EIGEN_NOEXCEPT
Definition: Macros.h:1418
internal
Definition: BandTriangularSolver.h:13
Eigen::Inverse::NestedExpression
internal::remove_all< XprType >::type NestedExpression
Definition: Inverse.h:51
Eigen::internal::traits< Inverse< XprType > >::PlainObject
XprType::PlainObject PlainObject
Definition: Inverse.h:23
cols
int cols
Definition: Tutorial_commainit_02.cpp:1
Eigen::EvalBeforeNestingBit
const unsigned int EvalBeforeNestingBit
Definition: Constants.h:70
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:29