public class ConjugateGradient extends Object
Constructor and Description |
---|
ConjugateGradient() |
Modifier and Type | Method and Description |
---|---|
static Vec |
solve(double eps,
Matrix A,
Vec x,
Vec b)
Uses the Conjugate Gradient method to solve a linear system of
equations involving a symmetric positive definite matrix.
A symmetric positive definite matrix is a matrix A such that: AT = A xT * A * x > 0 for all x != 0 NOTE: No checks will be performed to confirm these properties of the given matrix. |
static Vec |
solve(double eps,
Matrix A,
Vec x,
Vec b,
Matrix Minv)
Uses the Conjugate Gradient method to solve a linear system of
equations involving a symmetric positive definite matrix.
A symmetric positive definite matrix is a matrix A such that: AT = A xT * A * x > 0 for all x != 0 NOTE: No checks will be performed to confirm these properties of the given matrix. |
static Vec |
solve(Matrix A,
Vec b) |
static Vec |
solveCGNR(double eps,
Matrix A,
Vec x,
Vec b)
Uses the Conjugate Gradient method to compute the least squares solution to a system
of linear equations.
Computes the least squares solution to A x = b. |
static Vec |
solveCGNR(Matrix A,
Vec b) |
public static Vec solve(double eps, Matrix A, Vec x, Vec b)
eps
- the precision of the desired result.A
- the symmetric positive definite matrixx
- an initial guess for x, can be all zeros. This vector will be alteredb
- the target valuespublic static Vec solve(double eps, Matrix A, Vec x, Vec b, Matrix Minv)
eps
- the precision of the desired result.A
- the symmetric positive definite matrixx
- an initial guess for x, can be all zeros. This vector will be alteredb
- the target valuesMinv
- the of a matric M, such that M is a symmetric positive definite matrix.
Is applied as M-1( A x - b = 0) to increase convergence and stability.
These increases are soley a property of M-1public static Vec solveCGNR(double eps, Matrix A, Vec x, Vec b)
solve(double, jsat.linear.Matrix, jsat.linear.Vec, jsat.linear.Vec)
,
the CGNR method does not need any special properties of the matrix. Because of this, slower
convergence or numerical error can occur.eps
- the desired precision for the resultA
- any m x n matrixx
- the initial guess for x, can be all zeros. This vector will be alteredb
- the target valuesCopyright © 2017. All rights reserved.