GMRES Solver

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

Implementation of the Generalize Mimimal RESidual (GMRES) 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

GMRES()

Default constructor.

~GMRES()

Destructor.

void clear()

Clear memory.

void set_krylov_dimension(int K_dim)

Parameters
  • K_dim: The dimension (or size) of the Krylov space (default is 20).

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.