cpcg.m
No License
CPCG -CIRCULANT PRECONDITIONED CONJUGATE GRADIENT METHOD.
[x, error, iter, flag] = cpcg(a, b, tol, max_it, c, x0)
[x, error, iter, flag] = cpcg(a, b, c)
[x, error, iter, flag] = cpcg(a, b)
tol, max_it, c, x0 can be replaced by [] and default vaules will be used.
cpcg.m solves the symmetric positive definite Toeplitz linear system Ax=b using the Conjugate Gradient method with a circulant preconditioner C.
Both matrices A and C have to be SYMMETRIC POSITIVE DEFINITE.
input:
a ------ REAL FIRST COLUMN of symmetric positive definite matrix
b ------ REAL right hand side vecto
tol ---- REAL error tolerance
max_it - INTEGER maximum number of iteration
c ------ REAL FIRST COLUMN of CIRCULANT preconditioner matrix
x0 ----- REAL initial guess vector
output:
x ------ REAL solution vector
error -- REAL error norm
iter --- INTEGER number of iterations performed
flag --- INTEGER: 0 = solution found to tolerance
1 = no convergence given max_it
Tested under MATLAB 5.1 and 5.3.
Cite As
Leevan Ling (2026). cpcg.m (https://www.mathworks.com/matlabcentral/fileexchange/44-cpcg-m), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Mathematics > Linear Algebra >
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
