|
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.GeneralizedMinimalResidualSolver
public class GeneralizedMinimalResidualSolver
The Generalized Minimal Residual method (GMRES) is useful for solving non-symmetric n-by-n linear systems. It computes a sequence of orthogonal vectors (like MINRES, and combines these through a least-squares solve and update. However, unlike MINRES (and CG) it requires storing the whole sequence, so that a large amount of storage is needed. For this reason, restarted versions of this method are used. In restarted versions, computation and storage costs are limited by specifying a fixed number of vectors to be generated.
In addition, this implementation uses a Givens rotation to transform the intermediate Hessenberg matrix into an upper triangular matrix, such that convergence can be determined as soon as the residual norm at each sub-step is small enough.
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 |
| Constructor Summary | |
|---|---|
GeneralizedMinimalResidualSolver()
CreateMatrix a full GMRES solver. |
|
GeneralizedMinimalResidualSolver(int m)
CreateMatrix a restart version of GMRES solver with the restart parameter m. |
|
| 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 |
| Constructor Detail |
|---|
public GeneralizedMinimalResidualSolver()
public GeneralizedMinimalResidualSolver(int m)
m.
From a practical viewpoint, as m increases, the computational
cost increases at least as O(m2)n because of the
Gram-Schmidt orthogonalization. The memory cost increases as
O(mn).
m - the restart parameter| 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 | |||||||