Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Eigen::IterativeSolverBase< Derived > Class Template Reference

Base class for linear iterative solvers. More...

#include <IterativeSolverBase.h>

Inheritance diagram for Eigen::IterativeSolverBase< Derived >:
Inheritance graph
[legend]

Public Types

enum  { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime }
 
typedef internal::traits< Derived >::MatrixType MatrixType
 
typedef internal::traits< Derived >::Preconditioner Preconditioner
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::StorageIndex StorageIndex
 

Public Member Functions

template<typename Rhs , typename Dest >
void _solve_impl (const Rhs &b, Dest &x) const
 
template<typename Rhs , typename DestDerived >
void _solve_with_guess_impl (const Rhs &b, SparseMatrixBase< DestDerived > &aDest) const
 
template<typename Rhs , typename DestDerived >
internal::enable_if< Rhs::ColsAtCompileTime!=1 &&DestDerived::ColsAtCompileTime!=1 >::type _solve_with_guess_impl (const Rhs &b, MatrixBase< DestDerived > &aDest) const
 
template<typename Rhs , typename DestDerived >
internal::enable_if< Rhs::ColsAtCompileTime==1||DestDerived::ColsAtCompileTime==1 >::type _solve_with_guess_impl (const Rhs &b, MatrixBase< DestDerived > &dest) const
 
template<typename MatrixDerived >
Derived & analyzePattern (const EigenBase< MatrixDerived > &A)
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
template<typename MatrixDerived >
Derived & compute (const EigenBase< MatrixDerived > &A)
 
RealScalar error () const
 
template<typename MatrixDerived >
Derived & factorize (const EigenBase< MatrixDerived > &A)
 
ComputationInfo info () const
 
Index iterations () const
 
 IterativeSolverBase ()
 
template<typename MatrixDerived >
 IterativeSolverBase (const EigenBase< MatrixDerived > &A)
 
Index maxIterations () const
 
Preconditionerpreconditioner ()
 
const Preconditionerpreconditioner () const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
Derived & setMaxIterations (Index maxIters)
 
Derived & setTolerance (const RealScalar &tolerance)
 
template<typename Rhs , typename Guess >
const SolveWithGuess< Derived, Rhs, Guess > solveWithGuess (const MatrixBase< Rhs > &b, const Guess &x0) const
 
RealScalar tolerance () const
 
 ~IterativeSolverBase ()
 
- Public Member Functions inherited from Eigen::SparseSolverBase< Derived >
template<typename Rhs , typename Dest >
void _solve_impl (const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
 
Derived & derived ()
 
const Derived & derived () const
 
template<typename Rhs >
const Solve< Derived, Rhs > solve (const MatrixBase< Rhs > &b) const
 
template<typename Rhs >
const Solve< Derived, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
 SparseSolverBase ()
 
 ~SparseSolverBase ()
 

Protected Types

typedef MatrixWrapper::ActualMatrixType ActualMatrixType
 
typedef SparseSolverBase< Derived > Base
 
typedef internal::generic_matrix_wrapper< MatrixTypeMatrixWrapper
 

Protected Member Functions

template<typename InputType >
void grab (const InputType &A)
 
void init ()
 
const ActualMatrixTypematrix () const
 

Protected Attributes

bool m_analysisIsOk
 
RealScalar m_error
 
bool m_factorizationIsOk
 
ComputationInfo m_info
 
Index m_iterations
 
MatrixWrapper m_matrixWrapper
 
Index m_maxIterations
 
Preconditioner m_preconditioner
 
RealScalar m_tolerance
 
- Protected Attributes inherited from Eigen::SparseSolverBase< Derived >
bool m_isInitialized
 

Detailed Description

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

Base class for linear iterative solvers.

See also
class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner

Definition at line 143 of file IterativeSolverBase.h.

Member Typedef Documentation

◆ ActualMatrixType

template<typename Derived>
typedef MatrixWrapper::ActualMatrixType Eigen::IterativeSolverBase< Derived >::ActualMatrixType
protected

Definition at line 417 of file IterativeSolverBase.h.

◆ Base

template<typename Derived>
typedef SparseSolverBase<Derived> Eigen::IterativeSolverBase< Derived >::Base
protected

Definition at line 146 of file IterativeSolverBase.h.

◆ MatrixType

template<typename Derived>
typedef internal::traits<Derived>::MatrixType Eigen::IterativeSolverBase< Derived >::MatrixType

Definition at line 150 of file IterativeSolverBase.h.

◆ MatrixWrapper

template<typename Derived>
typedef internal::generic_matrix_wrapper<MatrixType> Eigen::IterativeSolverBase< Derived >::MatrixWrapper
protected

Definition at line 416 of file IterativeSolverBase.h.

◆ Preconditioner

template<typename Derived>
typedef internal::traits<Derived>::Preconditioner Eigen::IterativeSolverBase< Derived >::Preconditioner

Definition at line 151 of file IterativeSolverBase.h.

◆ RealScalar

template<typename Derived>
typedef MatrixType::RealScalar Eigen::IterativeSolverBase< Derived >::RealScalar

Definition at line 154 of file IterativeSolverBase.h.

◆ Scalar

template<typename Derived>
typedef MatrixType::Scalar Eigen::IterativeSolverBase< Derived >::Scalar

Definition at line 152 of file IterativeSolverBase.h.

◆ StorageIndex

template<typename Derived>
typedef MatrixType::StorageIndex Eigen::IterativeSolverBase< Derived >::StorageIndex

Definition at line 153 of file IterativeSolverBase.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived>
anonymous enum
Enumerator
ColsAtCompileTime 
MaxColsAtCompileTime 

Definition at line 156 of file IterativeSolverBase.h.

Constructor & Destructor Documentation

◆ IterativeSolverBase() [1/2]

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

Default constructor.

Definition at line 166 of file IterativeSolverBase.h.

◆ IterativeSolverBase() [2/2]

template<typename Derived>
template<typename MatrixDerived >
Eigen::IterativeSolverBase< Derived >::IterativeSolverBase ( const EigenBase< MatrixDerived > &  A)
inlineexplicit

Initialize the solver with matrix A for further Ax=b solving.

This constructor is a shortcut for the default constructor followed by a call to compute().

Warning
this class stores a reference to the matrix A as well as some precomputed values that depend on it. Therefore, if A is changed this class becomes invalid. Call compute() to update it with the new matrix A, or modify a copy of A.

Definition at line 182 of file IterativeSolverBase.h.

◆ ~IterativeSolverBase()

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

Definition at line 189 of file IterativeSolverBase.h.

Member Function Documentation

◆ _solve_impl()

template<typename Derived>
template<typename Rhs , typename Dest >
void Eigen::IterativeSolverBase< Derived >::_solve_impl ( const Rhs &  b,
Dest &  x 
) const
inline

Definition at line 400 of file IterativeSolverBase.h.

◆ _solve_with_guess_impl() [1/3]

template<typename Derived>
template<typename Rhs , typename DestDerived >
void Eigen::IterativeSolverBase< Derived >::_solve_with_guess_impl ( const Rhs &  b,
SparseMatrixBase< DestDerived > &  aDest 
) const
inline

Definition at line 334 of file IterativeSolverBase.h.

◆ _solve_with_guess_impl() [2/3]

template<typename Derived>
template<typename Rhs , typename DestDerived >
internal::enable_if<Rhs::ColsAtCompileTime!=1 && DestDerived::ColsAtCompileTime!=1>::type Eigen::IterativeSolverBase< Derived >::_solve_with_guess_impl ( const Rhs &  b,
MatrixBase< DestDerived > &  aDest 
) const
inline

Definition at line 368 of file IterativeSolverBase.h.

◆ _solve_with_guess_impl() [3/3]

template<typename Derived>
template<typename Rhs , typename DestDerived >
internal::enable_if<Rhs::ColsAtCompileTime==1 || DestDerived::ColsAtCompileTime==1>::type Eigen::IterativeSolverBase< Derived >::_solve_with_guess_impl ( const Rhs &  b,
MatrixBase< DestDerived > &  dest 
) const
inline

Definition at line 393 of file IterativeSolverBase.h.

◆ analyzePattern()

template<typename Derived>
template<typename MatrixDerived >
Derived& Eigen::IterativeSolverBase< Derived >::analyzePattern ( const EigenBase< MatrixDerived > &  A)
inline

Initializes the iterative solver for the sparsity pattern of the matrix A for further solving Ax=b problems.

Currently, this function mostly calls analyzePattern on the preconditioner. In the future we might, for instance, implement column reordering for faster matrix vector products.

Definition at line 197 of file IterativeSolverBase.h.

◆ cols()

template<typename Derived>
EIGEN_CONSTEXPR Index Eigen::IterativeSolverBase< Derived >::cols ( void  ) const
inline

Definition at line 253 of file IterativeSolverBase.h.

◆ compute()

template<typename Derived>
template<typename MatrixDerived >
Derived& Eigen::IterativeSolverBase< Derived >::compute ( const EigenBase< MatrixDerived > &  A)
inline

Initializes the iterative solver with the matrix A for further solving Ax=b problems.

Currently, this function mostly initializes/computes the preconditioner. In the future we might, for instance, implement column reordering for faster matrix vector products.

Warning
this class stores a reference to the matrix A as well as some precomputed values that depend on it. Therefore, if A is changed this class becomes invalid. Call compute() to update it with the new matrix A, or modify a copy of A.

Definition at line 238 of file IterativeSolverBase.h.

◆ error()

template<typename Derived>
RealScalar Eigen::IterativeSolverBase< Derived >::error ( ) const
inline
Returns
the tolerance error reached during the last solve. It is a close approximation of the true relative residual error |Ax-b|/|b|.

Definition at line 305 of file IterativeSolverBase.h.

◆ factorize()

template<typename Derived>
template<typename MatrixDerived >
Derived& Eigen::IterativeSolverBase< Derived >::factorize ( const EigenBase< MatrixDerived > &  A)
inline

Initializes the iterative solver with the numerical values of the matrix A for further solving Ax=b problems.

Currently, this function mostly calls factorize on the preconditioner.

Warning
this class stores a reference to the matrix A as well as some precomputed values that depend on it. Therefore, if A is changed this class becomes invalid. Call compute() to update it with the new matrix A, or modify a copy of A.

Definition at line 217 of file IterativeSolverBase.h.

◆ grab()

template<typename Derived>
template<typename InputType >
void Eigen::IterativeSolverBase< Derived >::grab ( const InputType &  A)
inlineprotected

Definition at line 425 of file IterativeSolverBase.h.

◆ info()

template<typename Derived>
ComputationInfo Eigen::IterativeSolverBase< Derived >::info ( ) const
inline
Returns
Success if the iterations converged, and NoConvergence otherwise.

Definition at line 326 of file IterativeSolverBase.h.

◆ init()

template<typename Derived>
void Eigen::IterativeSolverBase< Derived >::init ( )
inlineprotected

Definition at line 407 of file IterativeSolverBase.h.

◆ iterations()

template<typename Derived>
Index Eigen::IterativeSolverBase< Derived >::iterations ( ) const
inline
Returns
the number of iterations performed during the last solve

Definition at line 296 of file IterativeSolverBase.h.

◆ matrix()

template<typename Derived>
const ActualMatrixType& Eigen::IterativeSolverBase< Derived >::matrix ( ) const
inlineprotected

Definition at line 419 of file IterativeSolverBase.h.

◆ maxIterations()

template<typename Derived>
Index Eigen::IterativeSolverBase< Derived >::maxIterations ( ) const
inline
Returns
the max number of iterations. It is either the value set by setMaxIterations or, by default, twice the number of columns of the matrix.

Definition at line 281 of file IterativeSolverBase.h.

◆ preconditioner() [1/2]

template<typename Derived>
Preconditioner& Eigen::IterativeSolverBase< Derived >::preconditioner ( )
inline
Returns
a read-write reference to the preconditioner for custom configuration.

Definition at line 272 of file IterativeSolverBase.h.

◆ preconditioner() [2/2]

template<typename Derived>
const Preconditioner& Eigen::IterativeSolverBase< Derived >::preconditioner ( ) const
inline
Returns
a read-only reference to the preconditioner.

Definition at line 275 of file IterativeSolverBase.h.

◆ rows()

template<typename Derived>
EIGEN_CONSTEXPR Index Eigen::IterativeSolverBase< Derived >::rows ( void  ) const
inline

Definition at line 250 of file IterativeSolverBase.h.

◆ setMaxIterations()

template<typename Derived>
Derived& Eigen::IterativeSolverBase< Derived >::setMaxIterations ( Index  maxIters)
inline

Sets the max number of iterations. Default is twice the number of columns of the matrix.

Definition at line 289 of file IterativeSolverBase.h.

◆ setTolerance()

template<typename Derived>
Derived& Eigen::IterativeSolverBase< Derived >::setTolerance ( const RealScalar tolerance)
inline

Sets the tolerance threshold used by the stopping criteria.

This value is used as an upper bound to the relative residual error: |Ax-b|/|b|. The default value is the machine precision given by NumTraits<Scalar>::epsilon()

Definition at line 265 of file IterativeSolverBase.h.

◆ solveWithGuess()

template<typename Derived>
template<typename Rhs , typename Guess >
const SolveWithGuess<Derived, Rhs, Guess> Eigen::IterativeSolverBase< Derived >::solveWithGuess ( const MatrixBase< Rhs > &  b,
const Guess &  x0 
) const
inline
Returns
the solution x of $ A x = b $ using the current decomposition of A and x0 as an initial solution.
See also
solve(), compute()

Definition at line 318 of file IterativeSolverBase.h.

◆ tolerance()

template<typename Derived>
RealScalar Eigen::IterativeSolverBase< Derived >::tolerance ( ) const
inline
Returns
the tolerance threshold used by the stopping criteria.
See also
setTolerance()

Definition at line 258 of file IterativeSolverBase.h.

Member Data Documentation

◆ m_analysisIsOk

template<typename Derived>
bool Eigen::IterativeSolverBase< Derived >::m_analysisIsOk
mutableprotected

Definition at line 439 of file IterativeSolverBase.h.

◆ m_error

template<typename Derived>
RealScalar Eigen::IterativeSolverBase< Derived >::m_error
mutableprotected

Definition at line 436 of file IterativeSolverBase.h.

◆ m_factorizationIsOk

template<typename Derived>
bool Eigen::IterativeSolverBase< Derived >::m_factorizationIsOk
mutableprotected

Definition at line 439 of file IterativeSolverBase.h.

◆ m_info

template<typename Derived>
ComputationInfo Eigen::IterativeSolverBase< Derived >::m_info
mutableprotected

Definition at line 438 of file IterativeSolverBase.h.

◆ m_iterations

template<typename Derived>
Index Eigen::IterativeSolverBase< Derived >::m_iterations
mutableprotected

Definition at line 437 of file IterativeSolverBase.h.

◆ m_matrixWrapper

template<typename Derived>
MatrixWrapper Eigen::IterativeSolverBase< Derived >::m_matrixWrapper
protected

Definition at line 430 of file IterativeSolverBase.h.

◆ m_maxIterations

template<typename Derived>
Index Eigen::IterativeSolverBase< Derived >::m_maxIterations
protected

Definition at line 433 of file IterativeSolverBase.h.

◆ m_preconditioner

template<typename Derived>
Preconditioner Eigen::IterativeSolverBase< Derived >::m_preconditioner
protected

Definition at line 431 of file IterativeSolverBase.h.

◆ m_tolerance

template<typename Derived>
RealScalar Eigen::IterativeSolverBase< Derived >::m_tolerance
protected

Definition at line 434 of file IterativeSolverBase.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:41:49