23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

icg<br />

2bicg<br />

Purpose BiConjugate Gradients method<br />

Syntax x = bicg(A,b)<br />

bicg(A,b,tol)<br />

bicg(A,b,tol,maxit)<br />

bicg(A,b,tol,maxit,M)<br />

bicg(A,b,tol,maxit,M1,M2)<br />

bicg(A,b,tol,maxit,M1,M2,x0)<br />

bicg(afun,b,tol,maxit,mfun1,mfun2,x0,p1,p2,...)<br />

[x,flag] = bicg(A,b,...)<br />

[x,flag,relres] = bicg(A,b,...)<br />

[x,flag,relres,iter] = bicg(A,b,...)<br />

[x,flag,relres,iter,resvec] = bicg(A,b,...)<br />

Description x = bicg(A,b) attempts to solve the system of linear equations A*x = b for x.<br />

The n-by-n coefficient matrix A must be square and the column vector b must<br />

have length n. A can be a function afun such that afun(x) returns A*x and<br />

afun(x,'transp') returns A'*x.<br />

2-146<br />

If bicg converges, a message to that effect is displayed. If bicg fails to converge<br />

after the maximum number of iterations or halts for any reason, a warning<br />

message is printed displaying the relative residual norm(b-A*x)/norm(b) and<br />

the iteration number at which the method stopped or failed.<br />

bicg(A,b,tol specifies the tolerance of the method. If tol is [], then bicg<br />

uses the default, 1e-6.<br />

bicg(A,b,tol,maxit) specifies the maximum number of iterations. If maxit<br />

is [], then bicg uses the default, min(n,20).<br />

bicg(A,b,tol,maxit,M) and bicg(A,b,tol,maxit,M1,M2) use the<br />

preconditioner M or M = M1*M2 and effectively solve the system<br />

inv(M)*A*x = inv(M)*b for x. IfM is [] then bicg applies no preconditioner.<br />

M can be a function mfun such that mfun(x) returns M\x and mfun(x,'transp')<br />

returns M'\x.<br />

bicg(A,b,tol,maxit,M1,M2,x0) specifies the initial guess. If x0 is [], then<br />

bicg uses the default, an all-zero vector.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!