CGS Solver

template<class MatType, class VecType, typename NumType>
class CGS : public BaseIterativeSolver<MatType, VecType, NumType>

Implementation of the Conjugate Gradient Squared (CGS) method.

Template Parameters
  • MatType: Matrix type (HostMatrix<NumType> and DeviceMatrix<NumTyper> currently supported).
  • VecType: Vector type (HostVector<NumType> and DeviceVector<NumTyper> currently supported).
  • NumType: Number type (double and float currently supported).

Public Functions

CGS()

Default constructor.

~CGS()

Destructor.

void clear()

Clear memory.

void solve(const MatType &mat, const VecType &rhs, VecType *soln)

Solves for soln in mat * soln = rhs.

Parameters
  • mat: The matrix in the above equation.
  • rhs: The vector in the above equation.
  • soln: The vector in the above equation.