|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.nonstationary.ConjugateGradientNormalResidualSolver
public class ConjugateGradientNormalResidualSolver
The Conjugate Gradient method (CG) can be applied on the normal equations. The Conjugate Gradient Normal Residual method (CGNR) is used to solve over-determined systems of linear equations, Ax = b. This algorithm uses CG to solve
(ATA)x = ATbThe equivalent symmetric system is of the form:
This solver can also be applied to square but non-symmetric systems, Ax = b.[ O A ] [ Ax ] = [ b ] [ AT O ] [ x ] [ ATb ]
When the coefficient matrix A is non-symmetric and nonsingular, the normal equations matrix ATA will be symmetric and positive definite, and hence CG can be applied. The convergence may be slow, since the spectrum of ATA will be less favorable than the spectrum of A.
Only left preconditioning is supported in this implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.IterativeSolver |
|---|
IterativeSolver.ConvergenceFailure, IterativeSolver.Problem |
| Field Summary | |
|---|---|
static int |
DEFAULT_RESIDUAL_REFRESH_RATE
The algorithm recomputes the residual as b - Axi once per this number of iterations |
| Constructor Summary | |
|---|---|
ConjugateGradientNormalResidualSolver()
|
|
ConjugateGradientNormalResidualSolver(int residualRefreshRate)
The solver recomputes the residual as b - Axi once per this number of iterations |
|
| Method Summary | |
|---|---|
Vector |
solve(IterativeSolver.Problem problem)
Solve iteratively Ax = b until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration. |
Vector |
solve(IterativeSolver.Problem problem,
IterationMonitor monitor)
Solve iteratively Ax = b until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_RESIDUAL_REFRESH_RATE
| Constructor Detail |
|---|
public ConjugateGradientNormalResidualSolver()
public ConjugateGradientNormalResidualSolver(int residualRefreshRate)
residualRefreshRate - the number of iterations before the next refresh| Method Detail |
|---|
public Vector solve(IterativeSolver.Problem problem)
throws IterativeSolver.ConvergenceFailure
IterativeSolverAx = buntil the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.
solve in interface IterativeSolverproblem - the problem of solving Ax = b
IterativeSolver.ConvergenceFailure - if the algorithm fails to converge
public Vector solve(IterativeSolver.Problem problem,
IterationMonitor monitor)
throws IterativeSolver.ConvergenceFailure
IterativeSolverAx = buntil the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.
In each iteration, the newly computed iterate is added to the
IterationMonitor for statistics or diagnostic purpose.
solve in interface IterativeSolverproblem - the problem of solving Ax = bmonitor - an IterationMonitor instance
IterativeSolver.ConvergenceFailure - if the algorithm fails to converge
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||