Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
IterativeSolverBase< Derived > Class Template Reference

Base class for linear iterative solvers. More...

#include <IterativeSolverBase.h>

Inherits noncopyable.

List of all members.

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
Preconditionerpreconditioner ()
const Preconditionerpreconditioner () 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 MatrixTypemp_matrix

Detailed Description

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

Base class for linear iterative solvers.

See also:
class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner

Member Typedef Documentation

typedef MatrixType::Index Index
typedef internal::traits<Derived>::MatrixType MatrixType
typedef internal::traits<Derived>::Preconditioner Preconditioner
typedef MatrixType::RealScalar RealScalar
typedef MatrixType::Scalar Scalar

Constructor & Destructor Documentation

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

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 ( ) [inline]

Member Function Documentation

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.

Index cols ( void  ) const [inline]
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.

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.

Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::IterativeSolverBase().

Derived& derived ( ) [inline]
const Derived& derived ( ) const [inline]
RealScalar error ( ) const [inline]
Returns:
the tolerance error reached during the last solve
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.

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.
ComputationInfo info ( ) const [inline]
Returns:
Success if the iterations converged, and NoConvergence otherwise.
void init ( ) [inline, protected]
int iterations ( ) const [inline]
Returns:
the number of iterations performed during the last solve
int maxIterations ( ) const [inline]
Returns:
a read-write reference to the preconditioner for custom configuration.
const Preconditioner& preconditioner ( ) const [inline]
Returns:
a read-only reference to the preconditioner.
Index rows ( void  ) const [inline]
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]
Returns:
the solution x of $ A x = b $ using the current decomposition of A.
See also:
compute()
const internal::sparse_solve_retval<IterativeSolverBase, Rhs> solve ( const SparseMatrixBase< Rhs > &  b) const [inline]
Returns:
the solution x of $ A x = b $ using the current decomposition of A.
See also:
compute()
RealScalar tolerance ( ) const [inline]
Returns:
the tolerance threshold used by the stopping criteria

Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::setTolerance().


Member Data Documentation

bool m_analysisIsOk [mutable, protected]
RealScalar m_error [mutable, protected]
bool m_factorizationIsOk [mutable, protected]
ComputationInfo m_info [mutable, protected]
bool m_isInitialized [mutable, protected]
int m_iterations [mutable, protected]
int m_maxIterations [protected]
RealScalar m_tolerance [protected]
const MatrixType* mp_matrix [protected]

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