Class QuasiMinimalResidualSolver
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.matrixtype.sparse.solver.iterative.nonstationary.QuasiMinimalResidualSolver
-
- All Implemented Interfaces:
IterativeLinearSystemSolver
public class QuasiMinimalResidualSolver extends Object implements IterativeLinearSystemSolver
The Quasi-Minimal Residual method (QMR) is useful for solving a non-symmetric n-by-n linear system. It applies a least-squares solve and update to the BiCG residuals, thereby smoothing out the irregular convergence behavior of BiCG. Also, QMR largely avoids the breakdown that can occur in BiCG. On the other hand, it does not effect a true minimization of either the error or the residual. While it converges smoothly, it does not essentially improve on the BiCG in terms of the number of iteration steps. This implementation does not have a look ahead mechanism. This implementation uses the split preconditioning (M = M1M2).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface dev.nm.algebra.linear.matrix.doubles.matrixtype.sparse.solver.iterative.IterativeLinearSystemSolver
IterativeLinearSystemSolver.Solution
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_RESIDUAL_REFRESH_RATE
The algorithm recomputes the residual as b - Axi once per this number of iterations
-
Constructor Summary
Constructors Constructor Description QuasiMinimalResidualSolver(int maxIteration, Tolerance tolerance)
Construct a Quasi-Minimal Residual (QMR) solver.QuasiMinimalResidualSolver(PreconditionerFactory leftPreconditionerFactory, PreconditionerFactory rightPreconditionerFactory, int residualRefreshRate, int maxIteration, Tolerance tolerance)
Construct a Quasi-Minimal Residual (QMR) solver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IterativeLinearSystemSolver.Solution
solve(LSProblem problem)
IterativeLinearSystemSolver.Solution
solve(LSProblem problem, IterationMonitor<Vector> monitor)
Solves iteratively Ax = b until the solution converges, i.e., the norm of residual (b - Ax) is less than or equal to the threshold.
-
-
-
Field Detail
-
DEFAULT_RESIDUAL_REFRESH_RATE
public static final int DEFAULT_RESIDUAL_REFRESH_RATE
The algorithm recomputes the residual as b - Axi once per this number of iterations- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QuasiMinimalResidualSolver
public QuasiMinimalResidualSolver(PreconditionerFactory leftPreconditionerFactory, PreconditionerFactory rightPreconditionerFactory, int residualRefreshRate, int maxIteration, Tolerance tolerance)
Construct a Quasi-Minimal Residual (QMR) solver.- Parameters:
leftPreconditionerFactory
- constructs a new left preconditionerrightPreconditionerFactory
- constructs a new right preconditionerresidualRefreshRate
- the number of iterations before the next refreshmaxIteration
- the maximum number of iterationstolerance
- the convergence threshold
-
QuasiMinimalResidualSolver
public QuasiMinimalResidualSolver(int maxIteration, Tolerance tolerance)
Construct a Quasi-Minimal Residual (QMR) solver.- Parameters:
maxIteration
- the maximum number of iterationstolerance
- the convergence threshold
-
-
Method Detail
-
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 iterativelyAx = 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 interfaceIterativeLinearSystemSolver
- 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
-
-