Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > Class Template Reference

A conjugate gradient solver for sparse (or dense) least-square problems. More...

#include <src/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h>

+ Inheritance diagram for Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >:
+ Collaboration diagram for Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >:

Public Types

typedef _MatrixType MatrixType
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::RealScalar RealScalar
 
typedef _Preconditioner Preconditioner
 
enum  
 
typedef MatrixType::StorageIndex StorageIndex
 

Public Member Functions

 LeastSquaresConjugateGradient ()
 
template<typename MatrixDerived >
 LeastSquaresConjugateGradient (const EigenBase< MatrixDerived > &A)
 
 ~LeastSquaresConjugateGradient ()
 
template<typename Rhs , typename Dest >
void _solve_with_guess_impl (const Rhs &b, Dest &x) const
 
template<typename Rhs , typename Dest >
void _solve_impl (const MatrixBase< Rhs > &b, Dest &x) const
 
template<typename Rhs , typename DestDerived >
void _solve_impl (const Rhs &b, SparseMatrixBase< DestDerived > &aDest) const
 
LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & analyzePattern (const EigenBase< MatrixDerived > &A)
 
LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & factorize (const EigenBase< MatrixDerived > &A)
 
LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & compute (const EigenBase< MatrixDerived > &A)
 
Index rows () const
 
Index cols () const
 
RealScalar tolerance () const
 
LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & setTolerance (const RealScalar &tolerance)
 
Preconditionerpreconditioner ()
 
const Preconditionerpreconditioner () const
 
Index maxIterations () const
 
LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & setMaxIterations (Index maxIters)
 
Index iterations () const
 
RealScalar error () const
 
const SolveWithGuess< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >, Rhs, Guess > solveWithGuess (const MatrixBase< Rhs > &b, const Guess &x0) const
 
ComputationInfo info () const
 
template<typename Rhs , typename Dest >
void _solve_impl (const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
 
LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & derived ()
 
const LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & 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
 

Protected Types

typedef internal::generic_matrix_wrapper< MatrixTypeMatrixWrapper
 
typedef MatrixWrapper::ActualMatrixType ActualMatrixType
 

Protected Member Functions

void init ()
 
void grab (const InputType &A)
 

Protected Attributes

MatrixWrapper m_matrixWrapper
 
Preconditioner m_preconditioner
 
Index m_maxIterations
 
RealScalar m_tolerance
 
bool m_analysisIsOk
 
bool m_factorizationIsOk
 

Private Types

typedef IterativeSolverBase< LeastSquaresConjugateGradientBase
 

Private Member Functions

const ActualMatrixTypematrix () const
 

Private Attributes

RealScalar m_error
 
Index m_iterations
 
ComputationInfo m_info
 
bool m_isInitialized
 

Detailed Description

template<typename _MatrixType, typename _Preconditioner>
class Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >

A conjugate gradient solver for sparse (or dense) least-square problems.

This class allows to solve for A x = b linear problems using an iterative conjugate gradient algorithm. The matrix A can be non symmetric and rectangular, but the matrix A' A should be positive-definite to guaranty stability. Otherwise, the SparseLU or SparseQR classes might be preferable. The matrix A and the vectors x and b can be either dense or sparse.

Template Parameters
_MatrixTypethe type of the matrix A, can be a dense or a sparse matrix.
_Preconditionerthe type of the preconditioner. Default is LeastSquareDiagonalPreconditioner

\implsparsesolverconcept

The maximal number of iterations and tolerance value can be controlled via the setMaxIterations() and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations and NumTraits<Scalar>::epsilon() for the tolerance.

This class can be used as the direct solver classes. Here is a typical usage example:

int m=1000000, n = 10000;
VectorXd x(n), b(m);
// fill A and b
lscg.compute(A);
x = lscg.solve(b);
std::cout << "#iterations: " << lscg.iterations() << std::endl;
std::cout << "estimated error: " << lscg.error() << std::endl;
// update b, and solve again
x = lscg.solve(b);
RealScalar error() const
Definition IterativeSolverBase.h:305
Derived & compute(const EigenBase< MatrixDerived > &A)
Definition IterativeSolverBase.h:238
Index iterations() const
Definition IterativeSolverBase.h:296
A conjugate gradient solver for sparse (or dense) least-square problems.
Definition LeastSquareConjugateGradient.h:150
A versatible sparse matrix representation.
Definition SparseMatrix.h:98
const Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition SparseSolverBase.h:88

By default the iterations start with x=0 as an initial guess of the solution. One can control the start using the solveWithGuess() method.

See also
class ConjugateGradient, SparseLU, SparseQR

Member Typedef Documentation

◆ ActualMatrixType

typedef MatrixWrapper::ActualMatrixType Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::ActualMatrixType
protectedinherited

◆ Base

template<typename _MatrixType , typename _Preconditioner >
typedef IterativeSolverBase<LeastSquaresConjugateGradient> Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::Base
private

◆ MatrixType

template<typename _MatrixType , typename _Preconditioner >
typedef _MatrixType Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::MatrixType

◆ MatrixWrapper

typedef internal::generic_matrix_wrapper<MatrixType> Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::MatrixWrapper
protectedinherited

◆ Preconditioner

template<typename _MatrixType , typename _Preconditioner >
typedef _Preconditioner Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::Preconditioner

◆ RealScalar

template<typename _MatrixType , typename _Preconditioner >
typedef MatrixType::RealScalar Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::RealScalar

◆ Scalar

template<typename _MatrixType , typename _Preconditioner >
typedef MatrixType::Scalar Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::Scalar

◆ StorageIndex

typedef MatrixType::StorageIndex Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::StorageIndex
inherited

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
156 {
157 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
158 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
159 };

Constructor & Destructor Documentation

◆ LeastSquaresConjugateGradient() [1/2]

template<typename _MatrixType , typename _Preconditioner >
Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::LeastSquaresConjugateGradient ( )
inline

Default constructor.

166: Base() {}
IterativeSolverBase< LeastSquaresConjugateGradient > Base
Definition LeastSquareConjugateGradient.h:151

◆ LeastSquaresConjugateGradient() [2/2]

template<typename _MatrixType , typename _Preconditioner >
template<typename MatrixDerived >
Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::LeastSquaresConjugateGradient ( 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.
179: Base(A.derived()) {}

◆ ~LeastSquaresConjugateGradient()

template<typename _MatrixType , typename _Preconditioner >
Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::~LeastSquaresConjugateGradient ( )
inline
181{}

Member Function Documentation

◆ _solve_impl() [1/3]

template<typename _MatrixType , typename _Preconditioner >
template<typename Rhs , typename Dest >
void Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::_solve_impl ( const MatrixBase< Rhs > &  b,
Dest &  x 
) const
inline
207 {
208 x.setZero();
209 _solve_with_guess_impl(b.derived(),x);
210 }
void _solve_with_guess_impl(const Rhs &b, Dest &x) const
Definition LeastSquareConjugateGradient.h:185
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

References Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::_solve_with_guess_impl().

+ Here is the call graph for this function:

◆ _solve_impl() [2/3]

template<typename _MatrixType , typename _Preconditioner >
template<typename Rhs , typename DestDerived >
void Eigen::IterativeSolverBase< Derived >::_solve_impl ( const Rhs &  b,
SparseMatrixBase< DestDerived > &  aDest 
) const
inline
335 {
336 eigen_assert(rows()==b.rows());
337
338 Index rhsCols = b.cols();
339 Index size = b.rows();
340 DestDerived& dest(aDest.derived());
341 typedef typename DestDerived::Scalar DestScalar;
344 // We do not directly fill dest because sparse expressions have to be free of aliasing issue.
345 // For non square least-square problems, b and dest might not have the same size whereas they might alias each-other.
346 typename DestDerived::PlainObject tmp(cols(),rhsCols);
347 for(Index k=0; k<rhsCols; ++k)
348 {
349 tb = b.col(k);
350 tx = derived().solve(tb);
351 tmp.col(k) = tx.sparseView(0);
352 }
353 dest.swap(tmp);
354 }
#define eigen_assert(x)
Definition Macros.h:579
LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & derived()
Definition SparseSolverBase.h:79
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:33
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183

◆ _solve_impl() [3/3]

template<typename Derived >
template<typename Rhs , typename Dest >
void Eigen::SparseSolverBase< Derived >::_solve_impl ( const SparseMatrixBase< Rhs > &  b,
SparseMatrixBase< Dest > &  dest 
) const
inlineinherited
112 {
113 internal::solve_sparse_through_dense_panels(derived(), b.derived(), dest.derived());
114 }
Derived & derived()
Definition SparseSolverBase.h:79
enable_if< Rhs::ColsAtCompileTime!=1 &&Dest::ColsAtCompileTime!=1 >::type solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs &rhs, Dest &dest)
Definition SparseSolverBase.h:23

References Eigen::SparseSolverBase< Derived >::derived(), Eigen::SparseMatrixBase< Derived >::derived(), and Eigen::internal::solve_sparse_through_dense_panels().

+ Here is the call graph for this function:

◆ _solve_with_guess_impl()

template<typename _MatrixType , typename _Preconditioner >
template<typename Rhs , typename Dest >
void Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::_solve_with_guess_impl ( const Rhs &  b,
Dest &  x 
) const
inline
186 {
189
190 for(Index j=0; j<b.cols(); ++j)
191 {
194
195 typename Dest::ColXpr xj(x,j);
197 }
198
199 m_isInitialized = true;
201 }
Index maxIterations() const
Definition IterativeSolverBase.h:281
Preconditioner m_preconditioner
Definition IterativeSolverBase.h:381
RealScalar m_tolerance
Definition IterativeSolverBase.h:384
ComputationInfo m_info
Definition IterativeSolverBase.h:388
RealScalar m_error
Definition IterativeSolverBase.h:386
Index m_iterations
Definition IterativeSolverBase.h:387
bool m_isInitialized
Definition SparseSolverBase.h:119
const ActualMatrixType & matrix() const
Definition IterativeSolverBase.h:369
@ Success
Definition Constants.h:432
@ NoConvergence
Definition Constants.h:436
EIGEN_DONT_INLINE void least_square_conjugate_gradient(const MatrixType &mat, const Rhs &rhs, Dest &x, const Preconditioner &precond, Index &iters, typename Dest::RealScalar &tol_error)
Definition LeastSquareConjugateGradient.h:28

References Eigen::internal::least_square_conjugate_gradient(), Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::m_error, Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::m_info, Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::m_isInitialized, Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::m_iterations, Eigen::IterativeSolverBase< Derived >::m_preconditioner, Eigen::IterativeSolverBase< Derived >::m_tolerance, Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::matrix(), Eigen::IterativeSolverBase< Derived >::maxIterations(), Eigen::NoConvergence, and Eigen::Success.

Referenced by Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::_solve_impl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ analyzePattern()

LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::analyzePattern ( const EigenBase< MatrixDerived > &  A)
inlineinherited

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.

198 {
199 grab(A.derived());
200 m_preconditioner.analyzePattern(matrix());
201 m_isInitialized = true;
202 m_analysisIsOk = true;
203 m_info = m_preconditioner.info();
204 return derived();
205 }
void grab(const InputType &A)
Definition IterativeSolverBase.h:375
const ActualMatrixType & matrix() const
Definition IterativeSolverBase.h:369

◆ cols()

Index Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::cols ( ) const
inlineinherited
253{ return matrix().cols(); }

◆ compute()

LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::compute ( const EigenBase< MatrixDerived > &  A)
inlineinherited

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.
239 {
240 grab(A.derived());
241 m_preconditioner.compute(matrix());
242 m_isInitialized = true;
243 m_analysisIsOk = true;
244 m_factorizationIsOk = true;
245 m_info = m_preconditioner.info();
246 return derived();
247 }

◆ derived() [1/2]

LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & Eigen::SparseSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::derived ( )
inlineinherited
79{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

const LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & Eigen::SparseSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::derived ( ) const
inlineinherited
80{ return *static_cast<const Derived*>(this); }

◆ error()

RealScalar Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::error ( ) const
inlineinherited
Returns
the tolerance error reached during the last solve. It is a close approximation of the true relative residual error |Ax-b|/|b|.
306 {
307 eigen_assert(m_isInitialized && "ConjugateGradient is not initialized.");
308 return m_error;
309 }

◆ factorize()

LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::factorize ( const EigenBase< MatrixDerived > &  A)
inlineinherited

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.
218 {
219 eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
220 grab(A.derived());
221 m_preconditioner.factorize(matrix());
222 m_factorizationIsOk = true;
223 m_info = m_preconditioner.info();
224 return derived();
225 }

◆ grab()

void Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::grab ( const InputType &  A)
inlineprotectedinherited
376 {
377 m_matrixWrapper.grab(A);
378 }

◆ info()

ComputationInfo Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::info ( ) const
inlineinherited
Returns
Success if the iterations converged, and NoConvergence otherwise.
327 {
328 eigen_assert(m_isInitialized && "IterativeSolverBase is not initialized.");
329 return m_info;
330 }

◆ init()

void Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::init ( )
inlineprotectedinherited
358 {
359 m_isInitialized = false;
360 m_analysisIsOk = false;
361 m_factorizationIsOk = false;
362 m_maxIterations = -1;
363 m_tolerance = NumTraits<Scalar>::epsilon();
364 }

◆ iterations()

Index Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::iterations ( ) const
inlineinherited
Returns
the number of iterations performed during the last solve
297 {
298 eigen_assert(m_isInitialized && "ConjugateGradient is not initialized.");
299 return m_iterations;
300 }

◆ matrix()

template<typename _MatrixType , typename _Preconditioner >
const ActualMatrixType & Eigen::IterativeSolverBase< Derived >::matrix ( ) const
inlineprivate
370 {
371 return m_matrixWrapper.matrix();
372 }

Referenced by Eigen::LeastSquaresConjugateGradient< _MatrixType, _Preconditioner >::_solve_with_guess_impl().

+ Here is the caller graph for this function:

◆ maxIterations()

Index Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::maxIterations ( ) const
inlineinherited
Returns
the max number of iterations. It is either the value setted by setMaxIterations or, by default, twice the number of columns of the matrix.
282 {
283 return (m_maxIterations<0) ? 2*matrix().cols() : m_maxIterations;
284 }

◆ preconditioner() [1/2]

Preconditioner & Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::preconditioner ( )
inlineinherited
Returns
a read-write reference to the preconditioner for custom configuration.
272{ return m_preconditioner; }

◆ preconditioner() [2/2]

const Preconditioner & Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::preconditioner ( ) const
inlineinherited
Returns
a read-only reference to the preconditioner.
275{ return m_preconditioner; }

◆ rows()

Index Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::rows ( ) const
inlineinherited
250{ return matrix().rows(); }

◆ setMaxIterations()

LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::setMaxIterations ( Index  maxIters)
inlineinherited

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

290 {
291 m_maxIterations = maxIters;
292 return derived();
293 }

◆ setTolerance()

LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > & Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::setTolerance ( const RealScalar tolerance)
inlineinherited

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

266 {
268 return derived();
269 }

◆ solve() [1/2]

template<typename Derived >
template<typename Rhs >
const Solve< Derived, Rhs > Eigen::SparseSolverBase< Derived >::solve ( const MatrixBase< Rhs > &  b) const
inlineinherited
Returns
an expression of the solution x of $ A x = b $ using the current decomposition of A.
See also
compute()
89 {
90 eigen_assert(m_isInitialized && "Solver is not initialized.");
91 eigen_assert(derived().rows()==b.rows() && "solve(): invalid number of rows of the right hand side matrix b");
92 return Solve<Derived, Rhs>(derived(), b.derived());
93 }
bool m_isInitialized
Definition SparseSolverBase.h:119
size_t rows(const T &raster)
Definition MarchingSquares.hpp:55

References Eigen::SparseSolverBase< Derived >::derived(), eigen_assert, and Eigen::SparseSolverBase< Derived >::m_isInitialized.

Referenced by igl::embree::bone_heat(), igl::Frame_field_deformer::compute_optimal_positions(), igl::eigs(), igl::copyleft::comiso::FrameInterpolator::interpolateSymmetric(), igl::slim::solve_weighted_arap(), and igl::copyleft::comiso::NRosyField::solveNoRoundings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ solve() [2/2]

template<typename Derived >
template<typename Rhs >
const Solve< Derived, Rhs > Eigen::SparseSolverBase< Derived >::solve ( const SparseMatrixBase< Rhs > &  b) const
inlineinherited
Returns
an expression of the solution x of $ A x = b $ using the current decomposition of A.
See also
compute()
102 {
103 eigen_assert(m_isInitialized && "Solver is not initialized.");
104 eigen_assert(derived().rows()==b.rows() && "solve(): invalid number of rows of the right hand side matrix b");
105 return Solve<Derived, Rhs>(derived(), b.derived());
106 }

◆ solveWithGuess()

const SolveWithGuess< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > , Rhs, Guess > Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::solveWithGuess ( const MatrixBase< Rhs > &  b,
const Guess &  x0 
) const
inlineinherited
Returns
the solution x of $ A x = b $ using the current decomposition of A and x0 as an initial solution.
See also
solve(), compute()
319 {
320 eigen_assert(m_isInitialized && "Solver is not initialized.");
321 eigen_assert(derived().rows()==b.rows() && "solve(): invalid number of rows of the right hand side matrix b");
322 return SolveWithGuess<Derived, Rhs, Guess>(derived(), b.derived(), x0);
323 }

◆ tolerance()

RealScalar Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::tolerance ( ) const
inlineinherited
Returns
the tolerance threshold used by the stopping criteria.
See also
setTolerance()
258{ return m_tolerance; }

Member Data Documentation

◆ m_analysisIsOk

bool Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::m_analysisIsOk
mutableprotectedinherited

◆ m_error

template<typename _MatrixType , typename _Preconditioner >
RealScalar Eigen::IterativeSolverBase< Derived >::m_error
mutableprivate

◆ m_factorizationIsOk

bool Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::m_factorizationIsOk
protectedinherited

◆ m_info

template<typename _MatrixType , typename _Preconditioner >
ComputationInfo Eigen::IterativeSolverBase< Derived >::m_info
mutableprivate

◆ m_isInitialized

template<typename _MatrixType , typename _Preconditioner >
bool Eigen::SparseSolverBase< Derived >::m_isInitialized
mutableprivate

◆ m_iterations

template<typename _MatrixType , typename _Preconditioner >
Index Eigen::IterativeSolverBase< Derived >::m_iterations
mutableprivate

◆ m_matrixWrapper

MatrixWrapper Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::m_matrixWrapper
protectedinherited

◆ m_maxIterations

Index Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::m_maxIterations
protectedinherited

◆ m_preconditioner

Preconditioner Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::m_preconditioner
protectedinherited

◆ m_tolerance

RealScalar Eigen::IterativeSolverBase< LeastSquaresConjugateGradient< _MatrixType, _Preconditioner > >::m_tolerance
protectedinherited

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