Class ConjugateGradientSolver
java.lang.Object
org.ojalgo.matrix.task.iterative.IterativeSolverTask
org.ojalgo.matrix.task.iterative.ConjugateGradientSolver
- All Implemented Interfaces:
MatrixTask<Double>, SolverTask<Double>
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 IterativeSolverTask
IterativeSolverTask.ConfiguratorNested classes/interfaces inherited from interface SolverTask
SolverTask.Factory<N> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate R064Storeprivate R064Storeprivate R064Storeprivate R064StoreFields inherited from class IterativeSolverTask
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleresolve(List<Equation> equations, PhysicalStore<Double> solution) Methods inherited from class IterativeSolverTask
configurator, debug, getAccuracyContext, getIterationsLimit, getPreconditioner, getRelaxationFactor, isDebugPrinterSet, preallocate, resolve, setAccuracyContext, setDebugPrinter, setIterationsLimit, setPreconditioner, setRelaxationFactor, solve, solve, toListOfRows, workerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SolverTask
preallocate, solve, toSolutionProvider
-
Field Details
-
myDirection
-
myPreconditioned
-
myResidual
-
myVector
-
-
Constructor Details
-
ConjugateGradientSolver
public ConjugateGradientSolver()
-
-
Method Details
-
resolve
- Specified by:
resolvein classIterativeSolverTask
-