Description Usage Arguments Details Value Preconditioners Warning References See Also Examples
Preconditioned conjugate gradient method for solving system of linear equations Ax = b, where A is symmetric and positive definite, b is a column vector.
1 | pcgsolve(A, b, preconditioner = "Jacobi", tol = 1e-6, maxIter = 1000)
|
A |
matrix, symmetric and positive definite. |
b |
vector, with same dimension as number of rows of A. |
preconditioner |
string, method for preconditioning: |
tol |
numeric, threshold for convergence, default is |
maxIter |
numeric, maximum iteration, default is |
When the condition number for A is large, the conjugate gradient (CG) method may fail to converge in a reasonable number of iterations. The Preconditioned Conjugate Gradient (PCG) Method applies a precondition matrix C and approaches the problem by solving:
{C}^{-1} A x = {C}^{-1} b
where the symmetric and positive-definite matrix C approximates A and {C}^{-1} A improves the condition number of A.
Common choices for the preconditioner include: Jacobi preconditioning, symmetric successive over-relaxation (SSOR), and incomplete Cholesky factorization [2].
Returns a vector representing solution x.
Jacobi
: The Jacobi preconditioner is the diagonal of the matrix A, with an assumption that all diagonal elements are non-zero.
SSOR
: The symmetric successive over-relaxation preconditioner, implemented as M = (D+L) D^{-1} (D+L)^T. [1]
ICC
: The incomplete Cholesky factorization preconditioner. [2]
Users need to check that input matrix A is symmetric and positive definite before applying the function.
[1] David Young. <e2><80><9c>Iterative methods for solving partial difference equations of elliptic type<e2><80><9d>. In: Transactions of the American Mathematical Society 76.1 (1954), pp. 92<e2><80><93>111.
[2] David S Kershaw. <e2><80><9c>The incomplete Cholesky<e2><80><94>conjugate gradient method for the iter- ative solution of systems of linear equations<e2><80><9d>. In: Journal of computational physics 26.1 (1978), pp. 43<e2><80><93>65.
1 2 3 4 5 6 |
[,1]
[1,] 0.09074421
[2,] 0.63682348
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.