Base class for linear iterative solvers. More...
#include <IterativeSolverBase.h>
Inherits noncopyable.
Public Types | |
typedef MatrixType::Index | Index |
typedef internal::traits < Derived >::MatrixType | MatrixType |
typedef internal::traits < Derived >::Preconditioner | Preconditioner |
typedef MatrixType::RealScalar | RealScalar |
typedef MatrixType::Scalar | Scalar |
Public Member Functions | |
template<typename Rhs , typename DestScalar , int DestOptions, typename DestIndex > | |
void | _solve_sparse (const Rhs &b, SparseMatrix< DestScalar, DestOptions, DestIndex > &dest) const |
Derived & | analyzePattern (const MatrixType &A) |
Index | cols () const |
Derived & | compute (const MatrixType &A) |
Derived & | derived () |
const Derived & | derived () const |
RealScalar | error () const |
Derived & | factorize (const MatrixType &A) |
ComputationInfo | info () const |
int | iterations () const |
IterativeSolverBase () | |
IterativeSolverBase (const MatrixType &A) | |
int | maxIterations () const |
Preconditioner & | preconditioner () |
const Preconditioner & | preconditioner () const |
Index | rows () const |
Derived & | setMaxIterations (int maxIters) |
Derived & | setTolerance (RealScalar tolerance) |
template<typename Rhs > | |
const internal::solve_retval < Derived, Rhs > | solve (const MatrixBase< Rhs > &b) const |
template<typename Rhs > | |
const internal::sparse_solve_retval < IterativeSolverBase, Rhs > | solve (const SparseMatrixBase< Rhs > &b) const |
RealScalar | tolerance () const |
~IterativeSolverBase () | |
Protected Member Functions | |
void | init () |
Protected Attributes | |
bool | m_analysisIsOk |
RealScalar | m_error |
bool | m_factorizationIsOk |
ComputationInfo | m_info |
bool | m_isInitialized |
int | m_iterations |
int | m_maxIterations |
Preconditioner | m_preconditioner |
RealScalar | m_tolerance |
const MatrixType * | mp_matrix |
Base class for linear iterative solvers.
typedef MatrixType::Index Index |
Reimplemented in BiCGSTAB< _MatrixType, _Preconditioner >, and ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >.
typedef internal::traits<Derived>::MatrixType MatrixType |
Reimplemented in BiCGSTAB< _MatrixType, _Preconditioner >, and ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >.
typedef internal::traits<Derived>::Preconditioner Preconditioner |
Reimplemented in BiCGSTAB< _MatrixType, _Preconditioner >, and ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >.
typedef MatrixType::RealScalar RealScalar |
Reimplemented in BiCGSTAB< _MatrixType, _Preconditioner >, and ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >.
typedef MatrixType::Scalar Scalar |
Reimplemented in BiCGSTAB< _MatrixType, _Preconditioner >, and ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >.
IterativeSolverBase | ( | ) | [inline] |
Default constructor.
IterativeSolverBase | ( | const MatrixType & | A | ) | [inline] |
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().
~IterativeSolverBase | ( | ) | [inline] |
void _solve_sparse | ( | const Rhs & | b, |
SparseMatrix< DestScalar, DestOptions, DestIndex > & | dest | ||
) | const [inline] |
Derived& analyzePattern | ( | const MatrixType & | A | ) | [inline] |
Initializes the iterative solver for the sparcity pattern of the matrix A for further solving Ax=b
problems.
Currently, this function mostly call analyzePattern on the preconditioner. In the future we might, for instance, implement column reodering for faster matrix vector products.
Derived& compute | ( | const MatrixType & | A | ) | [inline] |
Initializes the iterative solver with the matrix A for further solving Ax=b
problems.
Currently, this function mostly initialized/compute the preconditioner. In the future we might, for instance, implement column reodering for faster matrix vector products.
Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::IterativeSolverBase().
Derived& derived | ( | ) | [inline] |
Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::_solve_sparse(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::analyzePattern(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::compute(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::factorize(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::setMaxIterations(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::setTolerance(), and IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::solve().
const Derived& derived | ( | ) | const [inline] |
RealScalar error | ( | ) | const [inline] |
Derived& factorize | ( | const MatrixType & | A | ) | [inline] |
Initializes the iterative solver with the numerical values of the matrix A for further solving Ax=b
problems.
Currently, this function mostly call factorize on the preconditioner.
ComputationInfo info | ( | ) | const [inline] |
void init | ( | ) | [inline, protected] |
int iterations | ( | ) | const [inline] |
int maxIterations | ( | ) | const [inline] |
Referenced by ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >::_solveWithGuess(), and BiCGSTAB< _MatrixType, _Preconditioner >::_solveWithGuess().
Preconditioner& preconditioner | ( | ) | [inline] |
const Preconditioner& preconditioner | ( | ) | const [inline] |
Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::_solve_sparse(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::solve(), ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >::solveWithGuess(), and BiCGSTAB< _MatrixType, _Preconditioner >::solveWithGuess().
Derived& setMaxIterations | ( | int | maxIters | ) | [inline] |
Sets the max number of iterations
Derived& setTolerance | ( | RealScalar | tolerance | ) | [inline] |
Sets the tolerance threshold used by the stopping criteria
const internal::solve_retval<Derived, Rhs> solve | ( | const MatrixBase< Rhs > & | b | ) | const [inline] |
const internal::sparse_solve_retval<IterativeSolverBase, Rhs> solve | ( | const SparseMatrixBase< Rhs > & | b | ) | const [inline] |
RealScalar tolerance | ( | ) | const [inline] |
Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::setTolerance().
bool m_analysisIsOk [mutable, protected] |
Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::analyzePattern(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::compute(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::factorize(), and IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::init().
RealScalar m_error [mutable, protected] |
bool m_factorizationIsOk [mutable, protected] |
ComputationInfo m_info [mutable, protected] |
Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::analyzePattern(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::compute(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::factorize(), and IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::info().
bool m_isInitialized [mutable, protected] |
Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::analyzePattern(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::compute(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::error(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::info(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::init(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::iterations(), and IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::solve().
int m_iterations [mutable, protected] |
int m_maxIterations [protected] |
Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::init(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::maxIterations(), and IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::setMaxIterations().
Preconditioner m_preconditioner [protected] |
Referenced by ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >::_solveWithGuess(), BiCGSTAB< _MatrixType, _Preconditioner >::_solveWithGuess(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::analyzePattern(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::compute(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::factorize(), and IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::preconditioner().
RealScalar m_tolerance [protected] |
Referenced by ConjugateGradient< _MatrixType, _UpLo, _Preconditioner >::_solveWithGuess(), BiCGSTAB< _MatrixType, _Preconditioner >::_solveWithGuess(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::init(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::setTolerance(), and IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::tolerance().
const MatrixType* mp_matrix [protected] |
Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::cols(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::compute(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::factorize(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::maxIterations(), and IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::rows().