OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
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.
 
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
 Test if the number of iterations is not too big and if a minimum point is not reached.
 
bool checkMaxIterations (const size_t iteration, EndCriteria::Type &ecType) const
 Test if the number of iteration is below MaxIterations.
 
bool checkStationaryPoint (const RealType xOld, const RealType xNew, size_t &statStateIterations, EndCriteria::Type &ecType) const
 Test if the root variation is below rootEpsilon.
 
bool checkStationaryFunctionValue (const RealType fxOld, const RealType fxNew, size_t &statStateIterations, EndCriteria::Type &ecType) const
 Test if the function variation is below functionEpsilon.
 
bool checkStationaryFunctionAccuracy (const RealType f, const bool positiveOptimization, EndCriteria::Type &ecType) const
 Test if the function value is below functionEpsilon.
 
bool checkZeroGradientNorm (const RealType gNorm, EndCriteria::Type &ecType) const
 Test if the gradient norm value is below gradientNormEpsilon.
 

Protected Attributes

size_t maxIterations_
 Maximum number of iterations.
 
size_t maxStationaryStateIterations_
 Maximun number of iterations in stationary state.
 
RealType rootEpsilon_
 root, function and gradient epsilons
 
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 42 of file EndCriteria.hpp.

Member Enumeration Documentation

◆ Type

enum QuantLib::EndCriteria::Type

Definition at line 44 of file EndCriteria.hpp.

Constructor & Destructor Documentation

◆ EndCriteria()

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

Initialization constructor.

Definition at line 31 of file EndCriteria.cpp.

References maxIterations_, and maxStationaryStateIterations_.

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 61 of file EndCriteria.cpp.

References maxIterations_.

Referenced by 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 95 of file EndCriteria.cpp.

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 82 of file EndCriteria.cpp.

References maxStationaryStateIterations_.

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 68 of file EndCriteria.cpp.

References maxStationaryStateIterations_, and rootEpsilon_.

◆ checkZeroGradientNorm()

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

Test if the gradient norm value is below gradientNormEpsilon.

Definition at line 114 of file EndCriteria.cpp.

Referenced by operator()().

◆ functionEpsilon()

RealType QuantLib::EndCriteria::functionEpsilon ( ) const

Definition at line 145 of file EndCriteria.cpp.

◆ gradientNormEpsilon()

RealType QuantLib::EndCriteria::gradientNormEpsilon ( ) const

Definition at line 147 of file EndCriteria.cpp.

◆ maxIterations()

size_t QuantLib::EndCriteria::maxIterations ( ) const

Definition at line 137 of file EndCriteria.cpp.

◆ maxStationaryStateIterations()

size_t QuantLib::EndCriteria::maxStationaryStateIterations ( ) const

Definition at line 139 of file EndCriteria.cpp.

◆ 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 121 of file EndCriteria.cpp.

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

◆ rootEpsilon()

RealType QuantLib::EndCriteria::rootEpsilon ( ) const

Definition at line 143 of file EndCriteria.cpp.

Member Data Documentation

◆ functionEpsilon_

RealType QuantLib::EndCriteria::functionEpsilon_
protected

Definition at line 99 of file EndCriteria.hpp.

◆ gradientNormEpsilon_

RealType QuantLib::EndCriteria::gradientNormEpsilon_
protected

Definition at line 99 of file EndCriteria.hpp.

◆ maxIterations_

size_t QuantLib::EndCriteria::maxIterations_
protected

Maximum number of iterations.

Definition at line 95 of file EndCriteria.hpp.

Referenced by checkMaxIterations(), and EndCriteria().

◆ maxStationaryStateIterations_

size_t QuantLib::EndCriteria::maxStationaryStateIterations_
mutableprotected

Maximun number of iterations in stationary state.

Definition at line 97 of file EndCriteria.hpp.

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

◆ rootEpsilon_

RealType QuantLib::EndCriteria::rootEpsilon_
protected

root, function and gradient epsilons

Definition at line 99 of file EndCriteria.hpp.

Referenced by checkStationaryPoint().


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