WPILibC++ 2023.4.3
Eigen::IterativeSolverBase< Derived > Class Template Reference

Base class for linear iterative solvers. More...

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h>

Inheritance diagram for Eigen::IterativeSolverBase< Derived >:
Eigen::SparseSolverBase< Derived > Eigen::internal::noncopyable

Public Types

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

Public Member Functions

 IterativeSolverBase ()
 Default constructor. More...
 
template<typename MatrixDerived >
 IterativeSolverBase (const EigenBase< MatrixDerived > &A)
 Initialize the solver with matrix A for further Ax=b solving. More...
 
 ~IterativeSolverBase ()
 
template<typename MatrixDerived >
Derived & analyzePattern (const EigenBase< MatrixDerived > &A)
 Initializes the iterative solver for the sparsity pattern of the matrix A for further solving Ax=b problems. More...
 
template<typename MatrixDerived >
Derived & factorize (const EigenBase< MatrixDerived > &A)
 Initializes the iterative solver with the numerical values of the matrix A for further solving Ax=b problems. More...
 
template<typename MatrixDerived >
Derived & compute (const EigenBase< MatrixDerived > &A)
 Initializes the iterative solver with the matrix A for further solving Ax=b problems. More...
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
RealScalar tolerance () const
 
Derived & setTolerance (const RealScalar &tolerance)
 Sets the tolerance threshold used by the stopping criteria. More...
 
Preconditionerpreconditioner ()
 
const Preconditionerpreconditioner () const
 
Index maxIterations () const
 
Derived & setMaxIterations (Index maxIters)
 Sets the max number of iterations. More...
 
Index iterations () const
 
RealScalar error () const
 
template<typename Rhs , typename Guess >
const SolveWithGuess< Derived, Rhs, Guess > solveWithGuess (const MatrixBase< Rhs > &b, const Guess &x0) const
 
ComputationInfo info () 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 Rhs , typename Dest >
void _solve_impl (const Rhs &b, Dest &x) const
 
Derived & derived ()
 
const Derived & derived () const
 
- Public Member Functions inherited from Eigen::SparseSolverBase< Derived >
 SparseSolverBase ()
 Default constructor. More...
 
 ~SparseSolverBase ()
 
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
 
template<typename Rhs , typename Dest >
void _solve_impl (const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
 

Protected Types

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

Protected Member Functions

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

Protected Attributes

MatrixWrapper m_matrixWrapper
 
Preconditioner m_preconditioner
 
Index m_maxIterations
 
RealScalar m_tolerance
 
RealScalar m_error
 
Index m_iterations
 
ComputationInfo m_info
 
bool m_analysisIsOk
 
bool m_factorizationIsOk
 
bool m_isInitialized
 
- 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

Member Typedef Documentation

◆ ActualMatrixType

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

◆ Base

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

◆ MatrixType

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

◆ MatrixWrapper

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

◆ Preconditioner

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

◆ RealScalar

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

◆ Scalar

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

◆ StorageIndex

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

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived >
anonymous enum
Enumerator
ColsAtCompileTime 
MaxColsAtCompileTime 

Constructor & Destructor Documentation

◆ IterativeSolverBase() [1/2]

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

Default constructor.

◆ 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.

◆ ~IterativeSolverBase()

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

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

◆ _solve_with_guess_impl() [1/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

◆ _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 > &  dest 
) const
inline

◆ _solve_with_guess_impl() [3/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

◆ 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.

◆ cols()

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

◆ 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.

◆ derived() [1/2]

template<typename Derived >
Derived & Eigen::SparseSolverBase< Derived >::derived ( )
inline

◆ derived() [2/2]

template<typename Derived >
const Derived & Eigen::SparseSolverBase< Derived >::derived ( ) const
inline

◆ 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|.

◆ 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.

◆ grab()

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

◆ info()

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

◆ init()

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

◆ iterations()

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

◆ matrix()

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

◆ 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.

◆ preconditioner() [1/2]

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

◆ preconditioner() [2/2]

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

◆ rows()

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

◆ 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.

◆ 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()

◆ 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()

◆ tolerance()

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

Member Data Documentation

◆ m_analysisIsOk

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

◆ m_error

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

◆ m_factorizationIsOk

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

◆ m_info

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

◆ m_isInitialized

template<typename Derived >
bool Eigen::SparseSolverBase< Derived >::m_isInitialized
mutableprotected

◆ m_iterations

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

◆ m_matrixWrapper

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

◆ m_maxIterations

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

◆ m_preconditioner

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

◆ m_tolerance

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

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