template<class Scalar>
Rodin::Solver::LeastSquaresCG<Math::Matrix<Scalar>, Math::Vector<Scalar>> class final

Conjugate gradient solver for self-adjoint problems, for use with Math::SparseMatrix<Real> and Math::Vector<Real>.

Base classes

template<class Operator, class Vector, class Scalar>
class SolverBase<Math::Matrix<Scalar>, Math::Vector<Scalar>, Scalar>
Abstract base class for linear algebra solvers.

Public types

using VectorType = Math::Vector<Scalar>
Type of vector.
using OperatorType = Math::Matrix<Scalar>
Type of linear operator.

Public functions

void solve(OperatorType& A, VectorType& x, VectorType& b) override
Solves the linear algebra system.
void solve(OperatorType& A, VectorType& x, VectorType& b) pure virtual
Solves the linear algebra system.

Function documentation

template<class Scalar>
void Rodin::Solver::LeastSquaresCG<Math::Matrix<Scalar>, Math::Vector<Scalar>><Scalar>::solve(OperatorType& A, VectorType& x, VectorType& b) override

Solves the linear algebra system.

Parameters
in/out Left hand side operator
in/out Input for the initial guess, and output for the solution
in/out Right hand side vector

Solves the following system:

\[ Ax = b , \]

where $ A $ has type $ \text{OperatorType} $ , the solution $ x $ has type $ \text{VectorType} $ , and the right hand side $ b $ has type $ \text{VectorType} $ .

template<class Scalar>
void Rodin::Solver::LeastSquaresCG<Math::Matrix<Scalar>, Math::Vector<Scalar>><Scalar>::solve(OperatorType& A, VectorType& x, VectorType& b) pure virtual

Solves the linear algebra system.

Parameters
in/out Left hand side operator
in/out Input for the initial guess, and output for the solution
in/out Right hand side vector

Solves the following system:

\[ Ax = b , \]

where $ A $ has type $ \text{OperatorType} $ , the solution $ x $ has type $ \text{VectorType} $ , and the right hand side $ b $ has type $ \text{VectorType} $ .