- java.lang.Object
-
- org.ojalgo.matrix.task.iterative.IterativeSolverTask
-
- org.ojalgo.matrix.task.iterative.ConjugateGradientSolver
-
- All Implemented Interfaces:
MatrixTask<java.lang.Double>,SolverTask<java.lang.Double>
public final class ConjugateGradientSolver extends IterativeSolverTask
Conjugate Gradient solver for symmetric positive-definite systems [A][x]=[b].Preconditioning
- Requires a symmetric positive-definite preconditioner. Typical choices include the identity (no preconditioning), diagonal scaling, or symmetric Gauss–Seidel/SSOR variants. Using a non-symmetric or indefinite preconditioner invalidates the CG assumptions.
- Diagonal entries that are zero (or deemed unusable) should be treated in a numerically safe way by the chosen preconditioner, commonly defaulting to an identity action on those positions.
- Large, sparse systems with symmetric positive-definite A.
- When only matrix–vector products are available and factorisations are undesirable.
- As a robust default for SPD problems when faster convergence than simple stationary iterations is needed.
- Not applicable to nonsymmetric or indefinite systems; use a method designed for general square systems in those cases.
-
-
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 R064StoremyDirectionprivate R064StoremyPreconditionedprivate R064StoremyResidualprivate R064StoremyVector-
Fields inherited from class org.ojalgo.matrix.task.iterative.IterativeSolverTask
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description ConjugateGradientSolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleresolve(java.util.List<Equation> equations, PhysicalStore<java.lang.Double> solution)-
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
-
resolve
public double resolve(java.util.List<Equation> equations, PhysicalStore<java.lang.Double> solution)
- Specified by:
resolvein classIterativeSolverTask
-
-