Skip to content

num::minres

Defined in header <linear/solvers/minres.hpp>

template <class Op, class V>
requires math::inner_product_space<V> && math::self_adjoint_operator<Op, V> &&
         std::same_as<math::scalar_t<V>, real>
solver_result minres(const Op &A, const V &b, V &x, minres_options options = {});

Solve \(A x = b\) using MINRES (Minimum Residual) for symmetric / self-adjoint systems.

Minimizes the 2-norm of the residual \(\|b - A x_k\|_2\) over the Krylov subspace \(\mathcal{K}_k(A, r_0)\). Unlike CG, MINRES converges stably on symmetric indefinite linear systems.

Parameters

  • A: Symmetric / self-adjoint linear operator (e.g. num::assume_symmetric(A)).
  • b: Right-hand side vector.
  • x: Solution vector (serves as initial guess on input, updated in place).
  • options: Tolerance on \(\|b - A x\|_2\) and iteration limit.

Return value

solver_result containing iteration count, final residual norm, and convergence boolean.

Exceptions

  • std::invalid_argument: If dimensions of A, b, and x do not match.

See also

cg, gmres, pcg, assume_symmetric