|
Rheolef
7.2
an efficient C++ finite element environment
|
This function solves the symmetric positive but possibly singular linear system A*x=b with the minimal residual method. The minres function follows the algorithm described in
C. C. Paige and M. A. Saunders,
Solution of sparse indefinite systems of linear equations",
SIAM J. Numer. Anal., 12(4), 1975.
For more, see http://www.stanford.edu/group/SOL/software.html and also at page 60 of the PhD report:
S.-C. T. Choi, Iterative methods for singular linear equations and least-squares problems, Stanford University, 2006, http://www.stanford.edu/group/SOL/dissertations/sou-cheng-choi-thesis.pdf
solver_option sopt;
sopt.max_iter = 100;
sopt.tol = 1e-7;
int status = minres (A, x, b, eye(), sopt);
The fourth argument of minres is a preconditionner: here, the eye one is a do-nothing preconditionner, for simplicity. Finally, the solver_option variable sopt transmits the stopping criterion with sopt.tol and sopt.max_iter.
On return, the sopt.residue and sopt.n_iter indicate the reached residue and the number of iterations effectively performed. The return status is zero when the prescribed tolerance tol has been obtained, and non-zero otherwise. Also, the x variable contains the approximate solution. See also the solver_option for more controls upon the stopping criterion.
This documentation has been generated from file linalg/lib/minres.h
The present template implementation is inspired from the IML++ 1.2 iterative method library, http://math.nist.gov/iml++