Eigen::SolverBase< Derived > Class Template Reference

A base class for matrix decomposition and solvers. More...

+ Inheritance diagram for Eigen::SolverBase< Derived >:

Public Types

enum  {
  RowsAtCompileTime ,
  ColsAtCompileTime ,
  SizeAtCompileTime ,
  MaxRowsAtCompileTime ,
  MaxColsAtCompileTime ,
  MaxSizeAtCompileTime ,
  IsVectorAtCompileTime ,
  NumDimensions
}
 
typedef std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, const ConstTransposeReturnType >, const ConstTransposeReturnTypeAdjointReturnType
 
typedef EigenBase< Derived > Base
 
typedef Scalar CoeffReturnType
 
typedef Transpose< const Derived > ConstTransposeReturnType
 
typedef internal::traits< Derived >::Scalar Scalar
 
- Public Types inherited from Eigen::EigenBase< Derived >
typedef Eigen::Index Index
 The interface type of indices. More...
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

const AdjointReturnType adjoint () const
 
Derived & derived ()
 
const Derived & derived () const
 
template<typename Rhs >
const Solve< Derived, Rhs > solve (const MatrixBase< Rhs > &b) const
 
 SolverBase ()
 
const ConstTransposeReturnType transpose () const
 
 ~SolverBase ()
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
template<typename Dest >
void addTo (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheLeft (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheRight (Dest &dst) const
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
Derived & const_cast_derived () const
 
const Derived & const_derived () const
 
Derived & derived ()
 
const Derived & derived () const
 
template<typename Dest >
void evalTo (Dest &dst) const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
template<typename Dest >
void subTo (Dest &dst) const
 

Protected Member Functions

template<bool Transpose_, typename Rhs >
void _check_solve_assertion (const Rhs &b) const
 

Detailed Description

template<typename Derived>
class Eigen::SolverBase< Derived >

A base class for matrix decomposition and solvers.

Template Parameters
Derivedthe actual type of the decomposition/solver.

Any matrix decomposition inheriting this base class provide the following API:

DecompositionType dec(A);
x = dec.solve(b); // solve A * x = b
x = dec.transpose().solve(b); // solve A^T * x = b
x = dec.adjoint().solve(b); // solve A' * x = b
Array< int, 3, 1 > b
MatrixXcf A
Matrix< float, 1, Dynamic > MatrixType
Warning
Currently, any other usage of transpose() and adjoint() are not supported and will produce compilation errors.
See also
class PartialPivLU, class FullPivLU, class HouseholderQR, class ColPivHouseholderQR, class FullPivHouseholderQR, class CompleteOrthogonalDecomposition, class LLT, class LDLT, class SVDBase

Definition at line 70 of file SolverBase.h.

Member Typedef Documentation

◆ AdjointReturnType

template<typename Derived >
typedef std::conditional_t<NumTraits<Scalar>::IsComplex, CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, const ConstTransposeReturnType>, const ConstTransposeReturnType > Eigen::SolverBase< Derived >::AdjointReturnType

Definition at line 131 of file SolverBase.h.

◆ Base

template<typename Derived >
typedef EigenBase<Derived> Eigen::SolverBase< Derived >::Base

Definition at line 74 of file SolverBase.h.

◆ CoeffReturnType

template<typename Derived >
typedef Scalar Eigen::SolverBase< Derived >::CoeffReturnType

Definition at line 76 of file SolverBase.h.

◆ ConstTransposeReturnType

template<typename Derived >
typedef Transpose<const Derived> Eigen::SolverBase< Derived >::ConstTransposeReturnType

Definition at line 114 of file SolverBase.h.

◆ Scalar

template<typename Derived >
typedef internal::traits<Derived>::Scalar Eigen::SolverBase< Derived >::Scalar

Definition at line 75 of file SolverBase.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived >
anonymous enum
Enumerator
RowsAtCompileTime 
ColsAtCompileTime 
SizeAtCompileTime 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 
MaxSizeAtCompileTime 
IsVectorAtCompileTime 
NumDimensions 

Definition at line 81 of file SolverBase.h.

81  {
82  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
83  ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
84  SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::ret),
85  MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
86  MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
87  MaxSizeAtCompileTime = internal::size_at_compile_time(internal::traits<Derived>::MaxRowsAtCompileTime,
88  internal::traits<Derived>::MaxColsAtCompileTime),
89  IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
90  || internal::traits<Derived>::MaxColsAtCompileTime == 1,
92  };
constexpr int size_at_compile_time(int rows, int cols)
Definition: XprHelper.h:313

Constructor & Destructor Documentation

◆ SolverBase()

template<typename Derived >
Eigen::SolverBase< Derived >::SolverBase ( )
inline

Default constructor

Definition at line 95 of file SolverBase.h.

96  {}

◆ ~SolverBase()

template<typename Derived >
Eigen::SolverBase< Derived >::~SolverBase ( )
inline

Definition at line 98 of file SolverBase.h.

99  {}

Member Function Documentation

◆ _check_solve_assertion()

template<typename Derived >
template<bool Transpose_, typename Rhs >
void Eigen::SolverBase< Derived >::_check_solve_assertion ( const Rhs &  b) const
inlineprotected

Definition at line 149 of file SolverBase.h.

149  {
151  eigen_assert(derived().m_isInitialized && "Solver is not initialized.");
152  eigen_assert((Transpose_?derived().cols():derived().rows())==b.rows() && "SolverBase::solve(): invalid number of rows of the right hand side matrix b");
153  }
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition: Macros.h:914
#define eigen_assert(x)
Definition: Macros.h:902
Derived & derived()
Definition: EigenBase.h:48
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: EigenBase.h:65
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:62

◆ adjoint()

template<typename Derived >
const AdjointReturnType Eigen::SolverBase< Derived >::adjoint ( ) const
inline
Returns
an expression of the adjoint of the factored matrix

A typical usage is to solve for the adjoint problem A' x = b:

x = dec.adjoint().solve(b);

For real scalar types, this function is equivalent to transpose().

See also
transpose(), solve()

Definition at line 141 of file SolverBase.h.

142  {
143  return AdjointReturnType(derived().transpose());
144  }
std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, const ConstTransposeReturnType >, const ConstTransposeReturnType > AdjointReturnType
Definition: SolverBase.h:131
const ConstTransposeReturnType transpose() const
Definition: SolverBase.h:122

◆ derived() [1/2]

template<typename Derived >
Derived& Eigen::EigenBase< Derived >::derived
inline
Returns
a reference to the derived object

Definition at line 48 of file EigenBase.h.

48 { return *static_cast<Derived*>(this); }

◆ derived() [2/2]

template<typename Derived >
const Derived& Eigen::EigenBase< Derived >::derived
inline
Returns
a const reference to the derived object

Definition at line 51 of file EigenBase.h.

51 { return *static_cast<const Derived*>(this); }

◆ solve()

template<typename Derived >
template<typename Rhs >
const Solve<Derived, Rhs> Eigen::SolverBase< Derived >::solve ( const MatrixBase< Rhs > &  b) const
inline
Returns
an expression of the solution x of \( A x = b \) using the current decomposition of A.

Definition at line 107 of file SolverBase.h.

108  {
109  internal::solve_assertion<internal::remove_all_t<Derived>>::template run<false>(derived(), b);
110  return Solve<Derived, Rhs>(derived(), b.derived());
111  }

◆ transpose()

template<typename Derived >
const ConstTransposeReturnType Eigen::SolverBase< Derived >::transpose ( ) const
inline
Returns
an expression of the transposed of the factored matrix.

A typical usage is to solve for the transposed problem A^T x = b:

x = dec.transpose().solve(b);
See also
adjoint(), solve()

Definition at line 122 of file SolverBase.h.

123  {
125  }
Transpose< const Derived > ConstTransposeReturnType
Definition: SolverBase.h:114

The documentation for this class was generated from the following file: