- java.lang.Object
-
- org.ojalgo.matrix.task.iterative.IterativeSolverTask
-
- org.ojalgo.matrix.task.iterative.QMRSolver
-
- All Implemented Interfaces:
MatrixTask<java.lang.Double>,SolverTask<java.lang.Double>
public final class QMRSolver extends IterativeSolverTask
Quasi-Minimal Residual (QMR) solver for general nonsymmetric square systems.This is a Java port of SciPy's qmr() reference implementation. It is almost a straight line-by-line translation from SciPy. Implemented here with right-preconditioning only (M1 = I, M2 != I), and using ojAlgo's dense MatrixStore operations for matrix–vector products with A and A^T.
Characteristics
- Operates on matrix–vector products with both A and A^T.
- Right-preconditioning is used; both forward and transpose applications of the preconditioner may be invoked.
- Stops when the residual norm is small relative to the RHS norm (or absolutely small when RHS is zero), or when the iteration limit is reached.
- For nonsymmetric or indefinite problems where SPD-specific methods are inapplicable.
- When a robust Krylov method is preferred over simple stationary iterations.
- If A^T is unavailable or too costly, consider alternatives that avoid explicit transpose products.
- Templates for the Solution of Linear Systems, Barrett et al., Figure 2.8.
- Freund & Nachtigal (1991), QMR: a quasi-minimal residual method for non-Hermitian linear systems.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ojalgo.matrix.task.iterative.IterativeSolverTask
IterativeSolverTask.Configurator
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.task.SolverTask
SolverTask.Factory<N extends java.lang.Comparable<N>>
-
-
Field Summary
Fields Modifier and Type Field Description private R064Storedprivate R064Storepprivate R064Storeptildeprivate R064Storeqprivate R064Storerprivate R064Storesprivate R064Storevprivate R064Storevtildeprivate R064Storewtildeprivate R064Storez-
Fields inherited from class org.ojalgo.matrix.task.iterative.IterativeSolverTask
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description QMRSolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static voidaxpby(double alpha, R064Store src, double beta, R064Store dst)private static voidaxpy(double alpha, R064Store x, Mutate1D.Modifiable<?> y)private static doublenorm2(R064Store a)doubleresolve(java.util.List<Equation> equations, PhysicalStore<java.lang.Double> x)private static voidscaleCopy(R064Store src, double alpha, R064Store dst)private static voidscaleInPlace(R064Store x, double alpha)-
Methods inherited from class org.ojalgo.matrix.task.iterative.IterativeSolverTask
configurator, debug, getAccuracyContext, getIterationsLimit, getPreconditioner, getRelaxationFactor, isDebugPrinterSet, preallocate, resolve, setAccuracyContext, setDebugPrinter, setIterationsLimit, setPreconditioner, setRelaxationFactor, solve, solve, toListOfRows, worker
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ojalgo.matrix.task.SolverTask
preallocate, solve, toSolutionProvider
-
-
-
-
Method Detail
-
axpy
private static void axpy(double alpha, R064Store x, Mutate1D.Modifiable<?> y)
-
norm2
private static double norm2(R064Store a)
-
scaleInPlace
private static void scaleInPlace(R064Store x, double alpha)
-
resolve
public double resolve(java.util.List<Equation> equations, PhysicalStore<java.lang.Double> x)
- Specified by:
resolvein classIterativeSolverTask
-
-