Eigen::SolverBase< Derived > Class Template Reference

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

#include <SolverBase.h>

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

Public Types

enum  {
  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime , ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime , SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::ret) , MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime ,
  MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime , MaxSizeAtCompileTime , IsVectorAtCompileTime , NumDimensions
}
 
typedef EigenBase< Derived > Base
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef Scalar CoeffReturnType
 
typedef Transpose< const Derived > ConstTransposeReturnType
 
typedef std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, const ConstTransposeReturnType >, const ConstTransposeReturnTypeAdjointReturnType
 
- 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

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

Protected Member Functions

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

Friends

template<typename Derived_ >
struct internal::solve_assertion
 

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
Scalar * b
Definition: benchVecAdd.cpp:17
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
list x
Definition: plotDoE.py:28
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

Member Typedef Documentation

◆ AdjointReturnType

the return type of adjoint()

◆ Base

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

◆ CoeffReturnType

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

◆ ConstTransposeReturnType

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

the return type of transpose()

◆ Scalar

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

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived >
anonymous enum
Enumerator
RowsAtCompileTime 
ColsAtCompileTime 
SizeAtCompileTime 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 
MaxSizeAtCompileTime 
IsVectorAtCompileTime 
NumDimensions 
81  {
82  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
83  ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
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),
90  internal::traits<Derived>::MaxRowsAtCompileTime == 1 || internal::traits<Derived>::MaxColsAtCompileTime == 1,
93  : 2
94  };
@ RowsAtCompileTime
Definition: SolverBase.h:82
@ NumDimensions
Definition: SolverBase.h:91
@ ColsAtCompileTime
Definition: SolverBase.h:83
@ MaxRowsAtCompileTime
Definition: SolverBase.h:85
@ IsVectorAtCompileTime
Definition: SolverBase.h:89
@ MaxSizeAtCompileTime
Definition: SolverBase.h:87
@ MaxColsAtCompileTime
Definition: SolverBase.h:86
@ SizeAtCompileTime
Definition: SolverBase.h:84
return int(ret)+1
constexpr int size_at_compile_time(int rows, int cols)
Definition: XprHelper.h:373

Constructor & Destructor Documentation

◆ SolverBase()

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

Default constructor

97 {}

◆ ~SolverBase()

template<typename Derived >
Eigen::SolverBase< Derived >::~SolverBase ( )
inline
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
140  {
142  eigen_assert(derived().m_isInitialized && "Solver is not initialized.");
143  eigen_assert((Transpose_ ? derived().cols() : derived().rows()) == b.rows() &&
144  "SolverBase::solve(): invalid number of rows of the right hand side matrix b");
145  }
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition: Macros.h:922
#define eigen_assert(x)
Definition: Macros.h:910
constexpr EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:49
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: EigenBase.h:61
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:59

References b, Eigen::EigenBase< Derived >::cols(), Eigen::SolverBase< Derived >::derived(), eigen_assert, EIGEN_ONLY_USED_FOR_DEBUG, and Eigen::EigenBase< Derived >::rows().

◆ 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()
136 { return AdjointReturnType(derived().transpose()); }
const ConstTransposeReturnType transpose() const
Definition: SolverBase.h:120
std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, const ConstTransposeReturnType >, const ConstTransposeReturnType > AdjointReturnType
Definition: SolverBase.h:126

References Eigen::SolverBase< Derived >::derived(), and Eigen::SolverBase< Derived >::transpose().

Referenced by lu_verify_assert().

◆ derived() [1/2]

template<typename Derived >
constexpr EIGEN_DEVICE_FUNC Derived& Eigen::EigenBase< Derived >::derived
inlineconstexpr

◆ derived() [2/2]

template<typename Derived >
constexpr EIGEN_DEVICE_FUNC const Derived& Eigen::EigenBase< Derived >::derived
inlineconstexpr
Returns
a const reference to the derived object
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.
106  {
107  internal::solve_assertion<internal::remove_all_t<Derived>>::template run<false>(derived(), b);
108  return Solve<Derived, Rhs>(derived(), b.derived());
109  }

References b, and Eigen::SolverBase< Derived >::derived().

Referenced by cholesky(), cholesky_verify_assert(), ctms_decompositions(), Eigen::internal::idrs(), Eigen::internal::idrstabl(), lu_partial_piv(), lu_verify_assert(), and test_sparseqr_scalar().

◆ 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()
120 { return ConstTransposeReturnType(derived()); }
Transpose< const Derived > ConstTransposeReturnType
Definition: SolverBase.h:112

References Eigen::SolverBase< Derived >::derived().

Referenced by Eigen::SolverBase< Derived >::adjoint(), cholesky_verify_assert(), and lu_verify_assert().

Friends And Related Function Documentation

◆ internal::solve_assertion

template<typename Derived >
template<typename Derived_ >
friend struct internal::solve_assertion
friend

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