Base class for linear iterative solvers.
More...
#include <IterativeSolverBase.h>
|
typedef internal::traits< Derived >::MatrixType | MatrixType |
|
typedef internal::traits< Derived >::Preconditioner | Preconditioner |
|
typedef MatrixType::Scalar | Scalar |
|
typedef MatrixType::Index | Index |
|
typedef MatrixType::RealScalar | RealScalar |
|
|
const MatrixType * | mp_matrix |
|
Preconditioner | m_preconditioner |
|
int | m_maxIterations |
|
RealScalar | m_tolerance |
|
RealScalar | m_error |
|
int | m_iterations |
|
ComputationInfo | m_info |
|
bool | m_isInitialized |
|
bool | m_analysisIsOk |
|
bool | m_factorizationIsOk |
|
template<typename Derived>
class Eigen::IterativeSolverBase< Derived >
Base class for linear iterative solvers.
- See also
- class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
Definition at line 21 of file IterativeSolverBase.h.
template<typename Derived>
template<typename Derived>
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 52 of file IterativeSolverBase.h.
Derived & compute(const MatrixType &A)
template<typename Derived>
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.
Definition at line 65 of file IterativeSolverBase.h.
67 m_preconditioner.analyzePattern(A);
68 m_isInitialized =
true;
69 m_analysisIsOk =
true;
template<typename Derived>
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.
Definition at line 103 of file IterativeSolverBase.h.
106 m_preconditioner.compute(A);
107 m_isInitialized =
true;
108 m_analysisIsOk =
true;
109 m_factorizationIsOk =
true;
template<typename Derived>
- Returns
- the tolerance error reached during the last solve
Definition at line 156 of file IterativeSolverBase.h.
158 eigen_assert(m_isInitialized &&
"ConjugateGradient is not initialized.");
template<typename Derived>
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.
Definition at line 83 of file IterativeSolverBase.h.
85 eigen_assert(m_analysisIsOk &&
"You must first call analyzePattern()");
87 m_preconditioner.factorize(A);
88 m_factorizationIsOk =
true;
template<typename Derived>
- Returns
- Success if the iterations converged, and NoConvergence otherwise.
Definition at line 190 of file IterativeSolverBase.h.
192 eigen_assert(m_isInitialized &&
"IterativeSolverBase is not initialized.");
template<typename Derived>
- Returns
- the number of iterations performed during the last solve
Definition at line 149 of file IterativeSolverBase.h.
151 eigen_assert(m_isInitialized &&
"ConjugateGradient is not initialized.");
template<typename Derived>
- Returns
- the max number of iterations
Definition at line 136 of file IterativeSolverBase.h.
138 return (mp_matrix && m_maxIterations<0) ? mp_matrix->cols() : m_maxIterations;
template<typename Derived>
- Returns
- a read-write reference to the preconditioner for custom configuration.
Definition at line 130 of file IterativeSolverBase.h.
130 {
return m_preconditioner; }
template<typename Derived>
- Returns
- a read-only reference to the preconditioner.
Definition at line 133 of file IterativeSolverBase.h.
133 {
return m_preconditioner; }
template<typename Derived>
template<typename Derived>
Sets the tolerance threshold used by the stopping criteria
Definition at line 123 of file IterativeSolverBase.h.
RealScalar tolerance() const
template<typename Derived>
template<typename Rhs >
- Returns
- the solution x of using the current decomposition of A.
- See also
- compute()
Definition at line 167 of file IterativeSolverBase.h.
169 eigen_assert(m_isInitialized &&
"IterativeSolverBase is not initialized.");
170 eigen_assert(rows()==b.rows()
171 &&
"IterativeSolverBase::solve(): invalid number of rows of the right hand side matrix b");
172 return internal::solve_retval<Derived, Rhs>(derived(), b.derived());
template<typename Derived>
template<typename Rhs >
- Returns
- the solution x of using the current decomposition of A.
- See also
- compute()
Definition at line 181 of file IterativeSolverBase.h.
183 eigen_assert(m_isInitialized &&
"IterativeSolverBase is not initialized.");
184 eigen_assert(rows()==b.rows()
185 &&
"IterativeSolverBase::solve(): invalid number of rows of the right hand side matrix b");
186 return internal::sparse_solve_retval<IterativeSolverBase, Rhs>(*
this, b.derived());
template<typename Derived>
- Returns
- the tolerance threshold used by the stopping criteria
Definition at line 120 of file IterativeSolverBase.h.
120 {
return m_tolerance; }
The documentation for this class was generated from the following file:
- C:/Users/Brig/Documents/ShapeWorksStudio/src/Surfworks/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h