OpenMD  2.5
Molecular Dynamics in the Open
QuantLib::EndCriteria Class Reference

Criteria to end optimization process: More...

#include <EndCriteria.hpp>

Public Types

enum  Type {
  None, MaxIterations, StationaryPoint, StationaryFunctionValue,
  StationaryFunctionAccuracy, ZeroGradientNorm, Unknown

Public Member Functions

 EndCriteria (size_t maxIterations, size_t maxStationaryStateIterations, RealType rootEpsilon, RealType functionEpsilon, RealType gradientNormEpsilon)
 Initialization constructor. More...
size_t maxIterations () const
size_t maxStationaryStateIterations () const
RealType rootEpsilon () const
RealType functionEpsilon () const
RealType gradientNormEpsilon () const
bool operator() (const size_t iteration, size_t &statState, const bool positiveOptimization, const RealType fold, const RealType normgold, const RealType fnew, const RealType normgnew, EndCriteria::Type &ecType) const
bool checkMaxIterations (const size_t iteration, EndCriteria::Type &ecType) const
bool checkStationaryPoint (const RealType xOld, const RealType xNew, size_t &statStateIterations, EndCriteria::Type &ecType) const
bool checkStationaryFunctionValue (const RealType fxOld, const RealType fxNew, size_t &statStateIterations, EndCriteria::Type &ecType) const
bool checkStationaryFunctionAccuracy (const RealType f, const bool positiveOptimization, EndCriteria::Type &ecType) const
bool checkZeroGradientNorm (const RealType gNorm, EndCriteria::Type &ecType) const

Protected Attributes

size_t maxIterations_
 Maximum number of iterations. More...
size_t maxStationaryStateIterations_
 Maximun number of iterations in stationary state. More...
RealType rootEpsilon_
 root, function and gradient epsilons More...
RealType functionEpsilon_
RealType gradientNormEpsilon_

Detailed Description

Criteria to end optimization process:

  • maximum number of iterations AND minimum number of iterations around stationary point
  • x (independent variable) stationary point
  • y=f(x) (dependent variable) stationary point
  • stationary gradient

Definition at line 40 of file EndCriteria.hpp.

Member Enumeration Documentation

◆ Type


Definition at line 42 of file EndCriteria.hpp.

Constructor & Destructor Documentation

◆ EndCriteria()

QuantLib::EndCriteria::EndCriteria ( size_t  maxIterations,
size_t  maxStationaryStateIterations,
RealType  rootEpsilon,
RealType  functionEpsilon,
RealType  gradientNormEpsilon 

Member Function Documentation

◆ checkMaxIterations()

bool QuantLib::EndCriteria::checkMaxIterations ( const size_t  iteration,
EndCriteria::Type ecType 
) const

Test if the number of iteration is below MaxIterations

Definition at line 65 of file EndCriteria.cpp.

References MaxIterations, and maxIterations_.

Referenced by QuantLib::ArmijoLineSearch::operator()(), and operator()().

◆ checkStationaryFunctionAccuracy()

bool QuantLib::EndCriteria::checkStationaryFunctionAccuracy ( const RealType  f,
const bool  positiveOptimization,
EndCriteria::Type ecType 
) const

Test if the function value is below functionEpsilon

Definition at line 104 of file EndCriteria.cpp.

References functionEpsilon_, and StationaryFunctionAccuracy.

Referenced by operator()().

◆ checkStationaryFunctionValue()

bool QuantLib::EndCriteria::checkStationaryFunctionValue ( const RealType  fxOld,
const RealType  fxNew,
size_t &  statStateIterations,
EndCriteria::Type ecType 
) const

Test if the function variation is below functionEpsilon

Definition at line 88 of file EndCriteria.cpp.

References functionEpsilon_, maxStationaryStateIterations_, and StationaryFunctionValue.

Referenced by operator()().

◆ checkStationaryPoint()

bool QuantLib::EndCriteria::checkStationaryPoint ( const RealType  xOld,
const RealType  xNew,
size_t &  statStateIterations,
EndCriteria::Type ecType 
) const

Test if the root variation is below rootEpsilon

Definition at line 73 of file EndCriteria.cpp.

References maxStationaryStateIterations_, rootEpsilon_, and StationaryPoint.

◆ checkZeroGradientNorm()

bool QuantLib::EndCriteria::checkZeroGradientNorm ( const RealType  gNorm,
EndCriteria::Type ecType 
) const

Test if the gradient norm value is below gradientNormEpsilon

Definition at line 126 of file EndCriteria.cpp.

References gradientNormEpsilon_, and ZeroGradientNorm.

Referenced by operator()().

◆ functionEpsilon()

RealType QuantLib::EndCriteria::functionEpsilon ( ) const

Definition at line 162 of file EndCriteria.cpp.

References functionEpsilon_.

Referenced by QuantLib::LineSearchBasedMethod::minimize().

◆ gradientNormEpsilon()

RealType QuantLib::EndCriteria::gradientNormEpsilon ( ) const

Definition at line 166 of file EndCriteria.cpp.

References gradientNormEpsilon_.

◆ maxIterations()

size_t QuantLib::EndCriteria::maxIterations ( ) const

Definition at line 150 of file EndCriteria.cpp.

References maxIterations_.

◆ maxStationaryStateIterations()

size_t QuantLib::EndCriteria::maxStationaryStateIterations ( ) const

Definition at line 154 of file EndCriteria.cpp.

References maxStationaryStateIterations_.

Referenced by QuantLib::LineSearchBasedMethod::minimize().

◆ operator()()

bool QuantLib::EndCriteria::operator() ( const size_t  iteration,
size_t &  statState,
const bool  positiveOptimization,
const RealType  fold,
const RealType  normgold,
const RealType  fnew,
const RealType  normgnew,
EndCriteria::Type ecType 
) const

Test if the number of iterations is not too big and if a minimum point is not reached

Definition at line 134 of file EndCriteria.cpp.

References checkMaxIterations(), checkStationaryFunctionAccuracy(), checkStationaryFunctionValue(), and checkZeroGradientNorm().

◆ rootEpsilon()

RealType QuantLib::EndCriteria::rootEpsilon ( ) const

Definition at line 158 of file EndCriteria.cpp.

References rootEpsilon_.

Member Data Documentation

◆ functionEpsilon_

RealType QuantLib::EndCriteria::functionEpsilon_

◆ gradientNormEpsilon_

RealType QuantLib::EndCriteria::gradientNormEpsilon_

Definition at line 102 of file EndCriteria.hpp.

Referenced by checkZeroGradientNorm(), and gradientNormEpsilon().

◆ maxIterations_

size_t QuantLib::EndCriteria::maxIterations_

Maximum number of iterations.

Definition at line 98 of file EndCriteria.hpp.

Referenced by checkMaxIterations(), EndCriteria(), and maxIterations().

◆ maxStationaryStateIterations_

size_t QuantLib::EndCriteria::maxStationaryStateIterations_

Maximun number of iterations in stationary state.

Definition at line 100 of file EndCriteria.hpp.

Referenced by checkStationaryFunctionValue(), checkStationaryPoint(), EndCriteria(), and maxStationaryStateIterations().

◆ rootEpsilon_

RealType QuantLib::EndCriteria::rootEpsilon_

root, function and gradient epsilons

Definition at line 102 of file EndCriteria.hpp.

Referenced by checkStationaryPoint(), and rootEpsilon().

The documentation for this class was generated from the following files: