Krylov methods for research
The krylov4r Matlab package offers Krylov algorithms implementations for researchers, who require more options and outputs than the functions natively provided by Matlab. Currently, GMRES and GCR are implemented. The following features are available:
- left and right preconditioners
- restart
- deflation spaces
- change of inner product
- choose the orthogonalization algorithm (Gram-Schmidt, Modified Gram-Schmidt) and the number of re-orthogonalizations
- choose how the residual is computed (preconditioned or not, in weighted norm or not)
- set breakdown tolerance
- outputs absolute and relative residual norms
- outputs successive solution vectors
Download the repository and add <path>/krylov4r/src/
to your Matlab/Octave path.
[x, flag, relres, iter, absresvec, relresvec, xvec] =
gmres4r(A, b, 'left_prec', HL, 'right_prec', HR, 'restart', 5, 'tol', 1e-8);
Except for A,b
, all parameters are optional, named, and can be set in any order.
For documentation, run
help gmres4r
help gcr4r
Pierre Matalon, Nicole Spillane