Scilab Function
Last update : 7/2/2005

pcg - precondioned conjugate gradient

### Calling Sequence

  `[x, flag, err, iter, res] = pcg(A, b, tol, maxit, M, x)`

### Parameters

- `A`: symmetric positive definite matrix or function returning `A*x`
- `b`: right hand side vector (size: n)
- `tol`: error tolerance (default: 1000*%eps)
- `maxi`: maximum number of iterations (default: n)
- `M`: preconditioner: matrix or function returning `M*x` (default: none)
- `x0`: initial guess vector (default: zeros(n,1))
- `x`: solution vector
- `flag`: 0 if `pcg` converged to the desired tolerance within `maxi` iterations, 1 else
- `err`: final relative norm of the residual
- `iter`: number of iterations performed
- `res`: vector of the residual norms

### Description

Solves the linear system `Ax=b` using the conjugate gradient method with preconditioning.

The `A` matrix must be a symmetric positive definite matrix.

### Examples

### See Also

`pcg`,

### Author

Sage Group (IRISA, 2004)