com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.nonstationary
Class MinimalResidualSolver
java.lang.Object
com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.nonstationary.MinimalResidualSolver
- All Implemented Interfaces:
- IterativeLinearSystemSolver
public class MinimalResidualSolver
- extends java.lang.Object
- implements IterativeLinearSystemSolver
The Minimal Residual method (MINRES) is useful for solving a symmetric n-by-n
linear system (possibly indefinite or singular).
When the coefficient matrix A is Hermitian, the Arnoldi algorithm used in
GMRES can be simplified to a
3-term recurrence known as Lanczos algorithm. Thus, an approximate solution
can be computed without saving all the orthonormal basis vectors generated.
When A is singular, MINRES returns a least-squares solution with small
|Ar| (where r = b - Ax).
Only left preconditioning is supported in this implementation.
- See Also:
- "Anne Greenbaum, "Algorithm 4P," Iterative methods for solving linear systems, ch.8, pp.122."
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MinimalResidualSolver
public MinimalResidualSolver(PreconditionerFactory leftPreconditionerFactory,
int maxIteration,
Tolerance tolerance)
- Construct a MINRES solver.
- Parameters:
leftPreconditionerFactory - constructs a new left preconditionermaxIteration - the maximum number of iterationstolerance - the convergence threshold
MinimalResidualSolver
public MinimalResidualSolver(int maxIteration,
Tolerance tolerance)
- Construct a MINRES solver.
- Parameters:
maxIteration - the maximum number of iterationstolerance - the convergence threshold
solve
public IterativeLinearSystemSolver.Solution solve(LSProblem problem)
throws ConvergenceFailure
- Throws:
ConvergenceFailure
solve
public IterativeLinearSystemSolver.Solution solve(LSProblem problem,
IterationMonitor<Vector> monitor)
throws ConvergenceFailure
- Description copied from interface:
IterativeLinearSystemSolver
- Solves iteratively
Ax = b
until the solution converges, i.e., the norm of residual
(b - Ax) is less than or equal to the threshold.
- Specified by:
solve in interface IterativeLinearSystemSolver
- Parameters:
problem - a system of linear equationsmonitor - an iteration monitor
- Returns:
- an (approximate) solution to the linear problem
- Throws:
ConvergenceFailure - if the algorithm fails to converge
Copyright © 2012 Numerical Method Inc. Ltd. All Rights Reserved.