File Exchange

## GCG Generalized conjugate gradient method

version 1.0.0.0 (2.46 KB) by

Updated 16 Feb 2015

X = GCG(A,B) attempts to solve the system of linear equations A*X=B
for X. The N-by-N coefficient matrix A must be symmetric and positive
definite and the right hand side column vector B must have length N.

X = GCG(A,B,TOL) specifies the tolerance of the method. If TOL is []
then GCG uses the default, 1e-6.

X = GCG(A,B,TOL,MAXIT) specifies the maximum number of iterations. If
MAXIT is [] then GCG uses the default, min(N,20).

X = GCG(A,B,TOL,MAXIT,MINV) provides auxiliary matrix inverse Minv of a
simpler solvable system. If MINV is [] then GCG uses the default,
eye(N,N).

X = GCG(A,B,TOL,MAXIT,M,X0) specifies the initial guess. If X0 is []
then GCG uses the default, an all zero vector.

[X K] = GCG(A,B) returns the number of iterations K.

References:
[CGO1976] Concus, P., Golub, G.H. and O'Leary D.P.: "A generalized
conjugate gradient method for the numerical solution of
elliptic partial differential equations", in Sparse Matrix
Computations, Bunch J. R and Rose, D. J., eds., Academic
Press, 1976, pp. 309-332.

### Cite As

Mario Weder (2021). GCG Generalized conjugate gradient method (https://www.mathworks.com/matlabcentral/fileexchange/49720-gcg-generalized-conjugate-gradient-method), MATLAB Central File Exchange. Retrieved .

##### MATLAB Release Compatibility
Created with R2011a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux