| Type: | Package |
| Title: | Preconditioned Conjugate Gradient Algorithm for solving Ax=b |
| Version: | 1.1 |
| Date: | 2014-04-03 |
| Author: | B N Mandal <mandal.stat@gmail.com> and Jun Ma <jun.ma@mq.edu.au> |
| Maintainer: | B N Mandal <mandal.stat@gmail.com> |
| Description: | The package solves linear system of equations Ax=b by using Preconditioned Conjugate Gradient Algorithm where A is real symmetric positive definite matrix. A suitable preconditioner matrix may be provided by user. This can also be used to minimize quadratic function (x'Ax)/2-bx for unknown x. |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| Packaged: | 2014-04-03 03:00:35 UTC; admin |
| NeedsCompilation: | no |
| Repository: | CRAN |
| Date/Publication: | 2014-04-03 05:57:28 |
Preconditioned Conjugate Gradient algorithm for solving Ax=b
Description
The function solves linear system of equations Ax=b by Preconditioned Conjugate Gradient algorithm. Here matrix A must be real symmetric and positive definite. This can also be used to minimize the quadractic function (x'Ax)/2-bx.
Usage
pcg(A, b, M, maxiter = 1e+05, tol = 1e-06)
Arguments
A |
A is real symmetric positive definite matrix of order n x n. |
b |
b is a vector of order n x 1. |
M |
Optionally a suitable preconditioner matrix specified by user |
maxiter |
Maximum number of iterations |
tol |
Tolerance for convergence of the solution |
Value
A vector of order n x 1
Note
The algorithm does not check for symmetricity and positive definiteness of matrix A. Please ensure these conditions yourself.
Author(s)
B N Mandal and Jun Ma
References
Barrett, R., M. Berry, T. F. Chan, et al., (1994). Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, SIAM, Philadelphia.
Examples
A=matrix(rnorm(100*100,mean=10,sd=2),100,100)
A=t(A)%*%A
b=rnorm(100)
pcg(A,b)