Criteria to end optimization process: More...
#include <ql/math/optimization/endcriteria.hpp>
Public Types | |
| enum | Type { None, MaxIterations, StationaryPoint, StationaryFunctionValue, StationaryFunctionAccuracy, ZeroGradientNorm, Unknown } |
Public Member Functions | |
| EndCriteria (Size maxIterations, Size maxStationaryStateIterations, Real rootEpsilon, Real functionEpsilon, Real gradientNormEpsilon) | |
| Initialization constructor. | |
| Size | maxIterations () const |
| Size | maxStationaryStateIterations () const |
| Real | rootEpsilon () const |
| Real | functionEpsilon () const |
| Real | gradientNormEpsilon () const |
| bool | operator() (Size iteration, Size &statState, bool positiveOptimization, Real fold, Real normgold, Real fnew, Real normgnew, EndCriteria::Type &ecType) const |
| bool | checkMaxIterations (Size iteration, EndCriteria::Type &ecType) const |
| bool | checkStationaryPoint (Real xOld, Real xNew, Size &statStateIterations, EndCriteria::Type &ecType) const |
| bool | checkStationaryFunctionValue (Real fxOld, Real fxNew, Size &statStateIterations, EndCriteria::Type &ecType) const |
| bool | checkStationaryFunctionAccuracy (Real f, bool positiveOptimization, EndCriteria::Type &ecType) const |
| bool | checkZeroGradientNorm (Real gNorm, EndCriteria::Type &ecType) const |
Protected Attributes | |
| Size | maxIterations_ |
| Maximum number of iterations. | |
| Size | maxStationaryStateIterations_ |
| Maximun number of iterations in stationary state. | |
| Real | rootEpsilon_ |
| root, function and gradient epsilons | |
| Real | functionEpsilon_ |
| Real | gradientNormEpsilon_ |
Criteria to end optimization process:
| bool operator() | ( | Size | iteration, |
| Size & | statState, | ||
| bool | positiveOptimization, | ||
| Real | fold, | ||
| Real | normgold, | ||
| Real | fnew, | ||
| Real | normgnew, | ||
| EndCriteria::Type & | ecType | ||
| ) | const |
Test if the number of iterations is not too big and if a minimum point is not reached
| bool checkMaxIterations | ( | Size | iteration, |
| EndCriteria::Type & | ecType | ||
| ) | const |
Test if the number of iteration is below MaxIterations
| bool checkStationaryPoint | ( | Real | xOld, |
| Real | xNew, | ||
| Size & | statStateIterations, | ||
| EndCriteria::Type & | ecType | ||
| ) | const |
Test if the root variation is below rootEpsilon
| bool checkStationaryFunctionValue | ( | Real | fxOld, |
| Real | fxNew, | ||
| Size & | statStateIterations, | ||
| EndCriteria::Type & | ecType | ||
| ) | const |
Test if the function variation is below functionEpsilon
| bool checkStationaryFunctionAccuracy | ( | Real | f, |
| bool | positiveOptimization, | ||
| EndCriteria::Type & | ecType | ||
| ) | const |
Test if the function value is below functionEpsilon
| bool checkZeroGradientNorm | ( | Real | gNorm, |
| EndCriteria::Type & | ecType | ||
| ) | const |
Test if the gradient norm variation is below gradientNormEpsilon
Test if the gradient norm value is below gradientNormEpsilon