public final class ConjugateGradientSolver extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IterativeSolverTask.Configurator |
SolverTask.Factory<N extends Number>
COMPLEX, PRIMITIVE, QUATERNION, RATIONAL
Constructor and Description |
---|
ConjugateGradientSolver() |
Modifier and Type | Method and Description |
---|---|
IterativeSolverTask.Configurator |
configurator() |
protected void |
debug(int iteration,
Access1D<?> current) |
protected NumberContext |
getAccuracyContext() |
protected int |
getIterationsLimit() |
protected boolean |
isDebugPrinterSet() |
PhysicalStore<Double> |
preallocate(Structure2D templateBody,
Structure2D templateRHS)
Will create a PhysicalStore instance suitable for use with
SolverTask.solve(Access2D, Access2D, PhysicalStore) . |
double |
resolve(List<Equation> equations,
PhysicalStore<Double> solution) |
protected void |
setAccuracyContext(NumberContext accuracyContext) |
protected void |
setDebugPrinter(BasicLogger.Printer debugPrinter) |
protected void |
setIterationsLimit(int iterationsLimit) |
MatrixStore<Double> |
solve(Access2D<?> body,
Access2D<?> rhs,
PhysicalStore<Double> preallocated)
Exactly how (if at all) a specific implementation makes use of
preallocated is not
specified by this interface. |
Optional<MatrixStore<Double>> |
solve(MatrixStore<Double> body,
MatrixStore<Double> rhs) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
preallocate, solve
public double resolve(List<Equation> equations, PhysicalStore<Double> solution)
public MatrixStore<Double> solve(Access2D<?> body, Access2D<?> rhs, PhysicalStore<Double> preallocated) throws RecoverableCondition
SolverTask
Exactly how (if at all) a specific implementation makes use of preallocated
is not
specified by this interface. It must be documented for each implementation.
Should produce the same results as calling SolverTask.solve(Access2D, Access2D)
.
Use SolverTask.preallocate(Structure2D, Structure2D)
to obtain a suitbale preallocated
.
solve
in interface SolverTask<Double>
rhs
- The Right Hand Side, wont be modfiedpreallocated
- Preallocated memory for the results, possibly some intermediate results. You must
assume this is modified, but you cannot assume it will contain the full/final/correct solution.RecoverableCondition
public final IterativeSolverTask.Configurator configurator()
public final PhysicalStore<Double> preallocate(Structure2D templateBody, Structure2D templateRHS)
SolverTask
Will create a PhysicalStore instance suitable for use with
SolverTask.solve(Access2D, Access2D, PhysicalStore)
. The dimensions of the returned instance is not
specified by this interface - it is specified by the behaviour/requirements of each implementation.
When solving an equation system [A][X]=[B] ([mxn][nxb]=[mxb]) the preallocated memory/matrix will typically be either mxb or nxb.
preallocate
in interface SolverTask<Double>
public final Optional<MatrixStore<Double>> solve(MatrixStore<Double> body, MatrixStore<Double> rhs)
protected final void debug(int iteration, Access1D<?> current)
protected final NumberContext getAccuracyContext()
protected final int getIterationsLimit()
protected final boolean isDebugPrinterSet()
protected void setAccuracyContext(NumberContext accuracyContext)
protected void setDebugPrinter(BasicLogger.Printer debugPrinter)
protected void setIterationsLimit(int iterationsLimit)
Copyright © 2019 Optimatika. All rights reserved.