CONTENTS: Implementation of a conjugate-gradient type method
for solving sparse linear equations:
\begin{align*}
\text{Solve } & Ax=b
\\ \text{or } & (A - sI)x = b
\\ \text{or minimize } & \|Ax-b\|^2
\\ \text{or minimize } & \|(A - sI)x-b\|^2
\end{align*}
The matrix \(A - sI\) must be symmetric or Hermitian,
but it may be definite or indefinite, singular or nonsingular.
The scalar \(s\) is a shifting parameter it may be any real number.
The method is based on Lanczos tridiagonalization.
You may provide a preconditioner, but it must be symmetric positive definite.
If \((A - sI)\) is nonsingular,
use SYMMLQ
or MINRES.
If \((A - sI)x = b\) is singular and compatible,
use MINRES
or MINRES-QLP (this routine).
If \((A - sI)x = b\) is singular and incompatible,
use MINRES-QLP (this routine).
If \(A\) is unsymmetric or rectangular, use
LSQR or
LSMR.
Special application:
To find a null vector of a singular symmetric or Hermitian matrix \(A\),
apply MINRES-QLP to the system \( \min \|Ax - b\| \)
with any nonzero vector \(b\) (e.g. a random \(b\)).
At a minimizer, the residual vector \(r = b - Ax \) will satisfy \( Ar=0 \).
See [1] for examples.
If an eigenvalue \( \lambda \) is known, the associated eigenvector
may be obtained by applying MINRES-QLP to \((A - \lambda I)x = b\).
The residual \(r = b - (A - \lambda I)x \) is an eigenvector
because \( (A - \lambda I)r = 0 \).
If \( \lambda \) is not exact, use a loose stopping tolerance
and Rayleigh-quotient iteration to refine \( \lambda \).