MATLAB Function Reference    

Minimum Residual method



x = minres(A,b) attempts to find a minimum norm residual solution x to the system of linear equations A*x=b. The n-by-n coefficient matrix A must be symmetric but need not be positive definite. It should be large and sparse. The column vector b must have length n. A can be a function afun such that afun(x) returns A*x.

If minres converges, a message to that effect is displayed. If minres fails to converge after the maximum number of iterations or halts for any reason, a warning message is printed displaying the relative residual norm(b-A*x)/norm(b) and the iteration number at which the method stopped or failed.

minres(A,b,tol) specifies the tolerance of the method. If tol is [], then minres uses the default, 1e-6.

minres(A,b,tol,maxit) specifies the maximum number of iterations. If maxit is [], then minres uses the default, min(n,20).

minres(A,b,tol,maxit,M) and minres(A,b,tol,maxit,M1,M2) use symmetric positive definite preconditioner M or M = M1*M2 and effectively solve the system inv(sqrt(M))*A*inv(sqrt(M))*y = inv(sqrt(M))*b for y and then return x = inv(sqrt(M))*y. If M is [] then minres applies no preconditioner. M can be a function that returns M\x.

minres(A,b,tol,maxit,M1,M2,x0) specifies the initial guess. If x0 is [], then minres uses the default, an all-zero vector.

minres(afun,b,tol,maxit,m1fun,m2fun,x0,p1,p2,...) passes parameters p1,p2,... to functions afun(x,p1,p2,...), m1fun(x,p1,p2,...), and m2fun(x,p1,p2,...).

[x,flag] = minres(A,b,...) also returns a convergence flag.

minres converged to the desired tolerance tol within maxit iterations.
minres iterated maxit times but did not converge.
Preconditioner M was ill-conditioned.
minres stagnated. (Two consecutive iterates were the same.)

One of the scalar quantities calculated during minres became too small or too large to continue computing.

Whenever flag is not 0, the solution x returned is that with minimal norm residual computed over all the iterations. No messages are displayed if the flag output is specified.

[x,flag,relres] = minres(A,b,...) also returns the relative residual norm(b-A*x)/norm(b). If flag is 0, relres <= tol.

[x,flag,relres,iter] = minres(A,b,...) also returns the iteration number at which x was computed, where 0 <= iter <= maxit.

[x,flag,relres,iter,resvec] = minres(A,b,...) also returns a vector of estimates of the minres residual norms at each iteration, including norm(b-A*x0).

[x,flag,relres,iter,resvec,resveccg] = minres(A,b,...) also returns a vector of estimates of the Conjugate Gradients residual norms at each iteration.


Example 1.

Alternatively, use this matrix-vector product function

as input to minres.

Example 2.

Use a symmetric indefinite matrix that fails with pcg.

However, minres can handle the indefinite matrix A.

See Also

bicg, bicgstab, cgs, cholinc, gmres, lsqr, pcg, qmr, symmlq

@ (function handle), / (slash),


[1]  Barrett, R., M. Berry, T. F. Chan, et al., Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, SIAM, Philadelphia, 1994.

[2]  Paige, C. C. and M. A. Saunders, "Solution of Sparse Indefinite Systems of Linear Equations." SIAM J. Numer. Anal., Vol.12, 1975, pp. 617-629.

  min mislocked