| A class that implements the Conjugate-Gradient (CG) based Krylov subspace algorithm to solve a linear system of (i.e., solve for \( \mathbf{Ax}=\mathbf{b}$\f).
@see <em>An Introduction to the Conjugate Gradient Method Without the
Agonizing Pain</em>, Jonathan Richard Shewchuk
(<a
href="https://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf">Painless
Conjugate-Gradient</a>)
@see <em> Numerical Linear Algebra </em>, Trefethen, Lloyd N., and David Bau III., Vol. 50. Siam, 1997.
@tparam ValueTypeOperator The datatype (float, double, complex<double>,
etc.) for the operator (e.g. Matrix) associated with the linear solve
@tparam ValueTypeOperand The datatype (float, double, complex<double>,
etc.) of the vector, matrices, etc.
on which the operator will act
@tparam memorySpace The meory space (HOST, DEVICE, HOST_PINNED, etc.)
in which the data of the operator
and its operands reside
*/
template <typename ValueTypeOperator,
typename ValueTypeOperand,
utils::MemorySpace memorySpace>
class CGLinearSolver : public LinearSolverImpl<ValueTypeOperator,
ValueTypeOperand,
memorySpace>
{
public:
/**
@brief Constructor
@param[in] maxIter Maximum number of iterations to allow the solver
to iterate. Generally, this determines the maximum size of the Krylov
subspace that will be used.
@param[in] absoluteTol Convergence tolerane on the absolute \) L_2 $\f norm of the residual (i.e., on \(||\mathbf{Ax}-\mathbf{b}||$\f)
@param[in] relativeTol Convergence tolerane on the relative L2 norm of
the residual (i.e., on \)||\mathbf{Ax}-\mathbf{b}||/||\mathbf{b}||$\f) More...
|