SG++-Doxygen-Documentation
|
This is a decorator for sgpp::ConjugateGradients class. More...
Public Member Functions | |
def | __init__ (self) |
Constructor. More... | |
def | calcStarting (self) |
Rises LinearSolverEvents.CALC_STARTING event. More... | |
def | complete (self) |
Rises LinearSolverEvents.COMPLETE event. More... | |
def | fromJson (cls, jsonObject) |
Restores the CGSolver object from the json object with attributes. More... | |
def | getEpsilon (self) |
Return the accuracy for CG divergence criterion. More... | |
def | getImax (self) |
Return the maximal number of CG iterations. More... | |
def | getReuse (self) |
Returns True if the old alpha vector should be reused. More... | |
def | getThreshold (self) |
def | iterationComplete (self) |
Rises LinearSolverEvents.ITERATION_COMPLETE event. More... | |
def | setEpsilon (self, accuracy) |
Sets the accuracy parameter. More... | |
def | setImax (self, imax) |
Sets the maximal number of iterations. More... | |
def | setReuse (self, value) |
Defines whether the old alpha vector should be reused. More... | |
def | setThreshold (self, threshold) |
def | starting (self) |
Rises LinearSolverEvents.STARTING event. More... | |
def | toString (self) |
Returns a string that represents the object. More... | |
Public Attributes | |
max_threshold | |
Maximal accuracy. More... | |
Static Public Attributes | |
alpha = None | |
result vector More... | |
float | DEFAULT_ACCURACY = 0.0001 |
the relationship of the norm of end residual to the normal of initial residual More... | |
int | DEFAULT_IMAX = 400 |
maximal number of iterations used in CG More... | |
This is a decorator for sgpp::ConjugateGradients class.
The ConjugateGradients solver is enhanced with methods of concrete subject of the observer design pattern described in LinearSolver and function for serialization end deserialization.
In order to combine high performance of C++ code and flexibility of Subscription pattern the Template design pattern was used in this class. So the CG algorithm itself is implemented in C++ class ConjugateGradients, where template methods starting(), calcStarting(), iterationComplete(), and complete() are defined and called in different phases of the CG algorithm. This methods are overridden by CGSolver to rise the corresponding events by event subscribers.
def python.learner.solver.CGSolver.CGSolver.__init__ | ( | self | ) |
Constructor.
References python.learner.solver.CGSolver.CGSolver.DEFAULT_ACCURACY, and python.learner.solver.CGSolver.CGSolver.DEFAULT_IMAX.
def python.learner.solver.CGSolver.CGSolver.calcStarting | ( | self | ) |
Rises LinearSolverEvents.CALC_STARTING event.
def python.learner.solver.CGSolver.CGSolver.complete | ( | self | ) |
Rises LinearSolverEvents.COMPLETE event.
def python.learner.solver.CGSolver.CGSolver.fromJson | ( | cls, | |
jsonObject | |||
) |
Restores the CGSolver object from the json object with attributes.
cls | python keyword (do not specify) |
jsonObject | A json object. |
Referenced by python.uq.sampler.asgc.ASGCSampler.ASGCSampler.setMemento(), python.uq.analysis.asgc.ASGCKnowledge.ASGCKnowledge.setMemento(), python.uq.learner.Learner.Learner.setMemento(), and python.uq.uq_setting.UQSetting.UQSetting.setMemento().
def python.learner.solver.CGSolver.CGSolver.getEpsilon | ( | self | ) |
Return the accuracy for CG divergence criterion.
References sgpp::solver::SGSolver.myEpsilon, and sgpp::solver::SGSolverSP.myEpsilon.
def python.learner.solver.CGSolver.CGSolver.getImax | ( | self | ) |
Return the maximal number of CG iterations.
References sgpp::solver::SGSolver.nMaxIterations, and sgpp::solver::SGSolverSP.nMaxIterations.
def python.learner.solver.CGSolver.CGSolver.getReuse | ( | self | ) |
Returns True if the old alpha vector should be reused.
References python.learner.solver.CGSolver.CGSolver.__reuse.
def python.learner.solver.CGSolver.CGSolver.getThreshold | ( | self | ) |
def python.learner.solver.CGSolver.CGSolver.iterationComplete | ( | self | ) |
Rises LinearSolverEvents.ITERATION_COMPLETE event.
def python.learner.solver.CGSolver.CGSolver.setEpsilon | ( | self, | |
accuracy | |||
) |
Sets the accuracy parameter.
accuracy | float value of DEFAULT_ACCURACY parameter |
def python.learner.solver.CGSolver.CGSolver.setImax | ( | self, | |
imax | |||
) |
Sets the maximal number of iterations.
imax | integer limit of number of iterations |
References sgpp::solver::SGSolver.setMaxIterations(), and sgpp::solver::SGSolverSP.setMaxIterations().
def python.learner.solver.CGSolver.CGSolver.setReuse | ( | self, | |
value | |||
) |
Defines whether the old alpha vector should be reused.
value | True if the old alpha vector should be reused |
References python.learner.solver.CGSolver.CGSolver.__reuse.
def python.learner.solver.CGSolver.CGSolver.setThreshold | ( | self, | |
threshold | |||
) |
def python.learner.solver.CGSolver.CGSolver.starting | ( | self | ) |
Rises LinearSolverEvents.STARTING event.
def python.learner.solver.CGSolver.CGSolver.toString | ( | self | ) |
Returns a string that represents the object.
References create_dataset.type.
Referenced by python.uq.learner.Learner.Learner.createMemento().
|
static |
|
static |
the relationship of the norm of end residual to the normal of initial residual
Referenced by python.learner.solver.CGSolver.CGSolver.__init__().
|
static |
maximal number of iterations used in CG
Referenced by python.learner.solver.CGSolver.CGSolver.__init__().
python.learner.solver.CGSolver.CGSolver.max_threshold |
Maximal accuracy.
If the norm of the residuum falls below max_threshold, stop the CG iterations. Default value: -1
Referenced by python.learner.solver.CGSolver.CGSolver.getThreshold(), and python.learner.solver.CGSolver.CGSolver.setThreshold().