Module gmres

Module gmres 

Source
Expand description

Restarted GMRES (generalized minimal residual method) for complex linear systems given only through matrix-vector products. treams-rs extension.

Each cycle builds an orthonormal Krylov basis of at most restart vectors by Arnoldi iteration, with two passes of modified Gram-Schmidt per vector, and takes the least-squares update through Givens rotations. A cycle ends early when the rotated residual estimate meets the tolerance, the new Krylov vector vanishes, or the iteration limit is reached. Before it accepts an answer or restarts, the solver recomputes the true residual b - A x with one more operator application, and only that residual decides convergence.

Structsยง

Convergence
Proof of convergence for one right-hand side: the residual b - A x recomputed from the returned answer x, not the estimate of the Arnoldi iteration.
GmresOptions
Accuracy and memory budget of restarted GMRES.
Krylov ๐Ÿ”’
One columnโ€™s independent Arnoldi iteration. Batching changes when its operator products run, not its arithmetic or convergence decisions.

Functionsยง

apply_columns ๐Ÿ”’
Pack active columns only when there is more than one: scalar solves and the tail of a batch lend their existing Krylov or answer buffer directly.
gmres ๐Ÿ”’
Solve A x = rhs for the operator that apply multiplies with, starting from x = 0. Fails with Error::NotConverged when the residual is not finite, when the iterations reach options.max_iterations, or when the Arnoldi iteration breaks down before convergence; errors of apply pass through.
gmres_batch ๐Ÿ”’
Independent GMRES solves of columns column-major right-hand sides. Only the operator applications are shared: each column keeps its own Krylov basis, rotations, restart decisions and true-residual convergence certificate.
norm ๐Ÿ”’
Euclidean norm without overflow or underflow of the squared terms.