KrylovSolver (base class)

class kona.linalg.solvers.krylov.basic.KrylovSolver(vector_factory, optns=None)[source]

Bases: object

Base class for all Krylov solvers.

  • vec_factory (VectorFactory) – Used to generate abstracted KonaVector objects.
  • max_iter (int) – Maximum iterations for the CG solve.
  • rel_tol (float) – Relative residual tolerance for the solution.
  • check_res (boolean) – Flag for checking the residual after solution is found
  • out_file (file) – File stream for writing convergence data.
solve(mat_vec, b, x, precond)[source]

Solves the Ax=b linear system iteratively.

mat_vec : function
Matrix-vector product for left-hand side matrix A.
b : KonaVector
Right-hand side vector.
x : KonaVector
Solution vector
precond : function
Matrix-vector product for approximate inv(A).