![]() |
SG++-Doxygen-Documentation
|
This is a decorator for sgpp::ConjugateGradients class. More...
Public Member Functions | |
__init__ (self) | |
Constructor. | |
calcStarting (self) | |
Rises LinearSolverEvents.CALC_STARTING event. | |
complete (self) | |
Rises LinearSolverEvents.COMPLETE event. | |
fromJson (cls, jsonObject) | |
Restores the CGSolver object from the json object with attributes. | |
getEpsilon (self) | |
Return the accuracy for CG divergence criterion. | |
getImax (self) | |
Return the maximal number of CG iterations. | |
getReuse (self) | |
Returns True if the old alpha vector should be reused. | |
getThreshold (self) | |
iterationComplete (self) | |
Rises LinearSolverEvents.ITERATION_COMPLETE event. | |
setEpsilon (self, accuracy) | |
Sets the accuracy parameter. | |
setImax (self, imax) | |
Sets the maximal number of iterations. | |
setReuse (self, value) | |
Defines whether the old alpha vector should be reused. | |
setThreshold (self, threshold) | |
starting (self) | |
Rises LinearSolverEvents.STARTING event. | |
toString (self) | |
Returns a string that represents the object. | |
Public Attributes | |
DEFAULT_ACCURACY | |
DEFAULT_IMAX | |
max_threshold | |
Maximal accuracy. | |
Static Public Attributes | |
alpha = None | |
result vector | |
float | DEFAULT_ACCURACY = 0.0001 |
the relationship of the norm of end residual to the normal of initial residual | |
int | DEFAULT_IMAX = 400 |
maximal number of iterations used in CG | |
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.
python.learner.solver.CGSolver.CGSolver.__init__ | ( | self | ) |
Constructor.
python.learner.solver.CGSolver.CGSolver.calcStarting | ( | self | ) |
Rises LinearSolverEvents.CALC_STARTING event.
python.learner.solver.CGSolver.CGSolver.complete | ( | self | ) |
Rises LinearSolverEvents.COMPLETE event.
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.learner.Learner.Learner.setMemento(), python.uq.analysis.asgc.ASGCKnowledge.ASGCKnowledge.setMemento(), python.uq.learner.Learner.Learner.setMemento(), python.uq.sampler.asgc.ASGCSampler.ASGCSampler.setMemento(), and python.uq.uq_setting.UQSetting.UQSetting.setMemento().
python.learner.solver.CGSolver.CGSolver.getEpsilon | ( | self | ) |
Return the accuracy for CG divergence criterion.
References sgpp::solver::SGSolver.myEpsilon, and sgpp::solver::SGSolverSP.myEpsilon.
python.learner.solver.CGSolver.CGSolver.getImax | ( | self | ) |
Return the maximal number of CG iterations.
References sgpp::solver::SGSolver.nMaxIterations, and sgpp::solver::SGSolverSP.nMaxIterations.
python.learner.solver.CGSolver.CGSolver.getReuse | ( | self | ) |
Returns True if the old alpha vector should be reused.
References python.learner.solver.CGSolver.CGSolver.__reuse.
python.learner.solver.CGSolver.CGSolver.getThreshold | ( | self | ) |
python.learner.solver.CGSolver.CGSolver.iterationComplete | ( | self | ) |
Rises LinearSolverEvents.ITERATION_COMPLETE event.
python.learner.solver.CGSolver.CGSolver.setEpsilon | ( | self, | |
accuracy | |||
) |
Sets the accuracy parameter.
accuracy | float value of DEFAULT_ACCURACY parameter |
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().
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.
python.learner.solver.CGSolver.CGSolver.setThreshold | ( | self, | |
threshold | |||
) |
python.learner.solver.CGSolver.CGSolver.starting | ( | self | ) |
Rises LinearSolverEvents.STARTING event.
python.learner.solver.CGSolver.CGSolver.toString | ( | self | ) |
Returns a string that represents the object.
Referenced by python.controller.LearnerEventController.LearnerEventController.__repr__(), python.controller.SolverEventController.SolverEventController.__repr__(), python.learner.Learner.Learner.createMemento(), python.uq.learner.Learner.Learner.createMemento(), and python.learner.formatter.GridFormatter.GridFormatter.serialize().
|
static |
result vector
Referenced by python.learner.Learner.Learner.doLearningIteration(), python.learner.Learner.Learner.learnData(), python.learner.Learner.Learner.learnDataWithTest(), python.uq.learner.Interpolant.Interpolant.learnDataWithTest(), python.uq.dists.SGDEdist.SGDEdist.pdf(), and python.uq.dists.SGDEdist.SGDEdist.toJson().
|
static |
the relationship of the norm of end residual to the normal of initial residual
python.learner.solver.CGSolver.CGSolver.DEFAULT_ACCURACY |
|
static |
maximal number of iterations used in CG
python.learner.solver.CGSolver.CGSolver.DEFAULT_IMAX |
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().