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

Constrained optimization problem. More...

#include <Problem.hpp>

Public Member Functions

 Problem (ObjectiveFunction &objectiveFunction, Constraint &constraint, OpenMD::StatusFunction &statFunc, const DynamicVector< RealType > &initialValue=DynamicVector< RealType >())
 default constructor More...
 
void reset ()
 
RealType value (const DynamicVector< RealType > &x)
 call objective function computation and increment evaluation counter More...
 
void gradient (DynamicVector< RealType > &grad_f, const DynamicVector< RealType > &x)
 call objective function gradient computation and increment More...
 
RealType valueAndGradient (DynamicVector< RealType > &grad_f, const DynamicVector< RealType > &x)
 call objective function computation and it gradient More...
 
Constraintconstraint () const
 Constraint. More...
 
ObjectiveFunctionobjectiveFunction () const
 Objective function. More...
 
void setCurrentValue (const DynamicVector< RealType > &currentValue)
 
const DynamicVector< RealType > & currentValue () const
 current value of the local minimum More...
 
void setFunctionValue (RealType functionValue)
 
RealType functionValue () const
 value of objective function More...
 
void setGradientNormValue (RealType squaredNorm)
 
RealType gradientNormValue () const
 value of objective function gradient norm More...
 
int functionEvaluation () const
 number of evaluation of objective function More...
 
int gradientEvaluation () const
 number of evaluation of objective function gradient More...
 
RealType DotProduct (DynamicVector< RealType > &v1, DynamicVector< RealType > &v2)
 
RealType computeGradientNormValue (DynamicVector< RealType > &grad_f)
 

Protected Attributes

ObjectiveFunctionobjectiveFunction_
 Unconstrained objective function. More...
 
Constraintconstraint_
 Constraint. More...
 
DynamicVector< RealType > currentValue_
 current value of the local minimum More...
 
RealType functionValue_
 function and gradient norm values at the curentValue_ (i.e. the last step) More...
 
RealType squaredNorm_
 
int functionEvaluation_
 number of evaluation of objective function and its gradient More...
 
int gradientEvaluation_
 
StatusFunctionstatusFunction_
 status function More...
 

Detailed Description

Constrained optimization problem.

Definition at line 37 of file Problem.hpp.

Constructor & Destructor Documentation

◆ Problem()

QuantLib::Problem::Problem ( ObjectiveFunction objectiveFunction,
Constraint constraint,
OpenMD::StatusFunction statFunc,
const DynamicVector< RealType > &  initialValue = DynamicVector<RealType>() 
)
inline

default constructor

Definition at line 40 of file Problem.hpp.

References gradient(), reset(), value(), and valueAndGradient().

Member Function Documentation

◆ computeGradientNormValue()

RealType QuantLib::Problem::computeGradientNormValue ( DynamicVector< RealType > &  grad_f)

◆ constraint()

Constraint& QuantLib::Problem::constraint ( ) const
inline

Constraint.

Definition at line 64 of file Problem.hpp.

References constraint_.

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

◆ currentValue()

const DynamicVector<RealType>& QuantLib::Problem::currentValue ( ) const
inline

◆ DotProduct()

RealType QuantLib::Problem::DotProduct ( DynamicVector< RealType > &  v1,
DynamicVector< RealType > &  v2 
)

◆ functionEvaluation()

int QuantLib::Problem::functionEvaluation ( ) const
inline

number of evaluation of objective function

Definition at line 94 of file Problem.hpp.

References functionEvaluation_.

◆ functionValue()

RealType QuantLib::Problem::functionValue ( ) const
inline

value of objective function

Definition at line 85 of file Problem.hpp.

References functionValue_.

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

◆ gradient()

void QuantLib::Problem::gradient ( DynamicVector< RealType > &  grad_f,
const DynamicVector< RealType > &  x 
)
inline

call objective function gradient computation and increment

Definition at line 131 of file Problem.hpp.

References QuantLib::ObjectiveFunction::gradient(), gradientEvaluation_, and objectiveFunction_.

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

◆ gradientEvaluation()

int QuantLib::Problem::gradientEvaluation ( ) const
inline

number of evaluation of objective function gradient

Definition at line 97 of file Problem.hpp.

References computeGradientNormValue(), DotProduct(), and gradientEvaluation_.

◆ gradientNormValue()

RealType QuantLib::Problem::gradientNormValue ( ) const
inline

value of objective function gradient norm

Definition at line 91 of file Problem.hpp.

References squaredNorm_.

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

◆ objectiveFunction()

ObjectiveFunction& QuantLib::Problem::objectiveFunction ( ) const
inline

Objective function.

Definition at line 67 of file Problem.hpp.

References objectiveFunction_.

◆ reset()

void QuantLib::Problem::reset ( void  )
inline
Warning
it does not reset the current minumum to any initial value

Definition at line 149 of file Problem.hpp.

References functionEvaluation_, functionValue_, gradientEvaluation_, and squaredNorm_.

Referenced by QuantLib::LineSearchBasedMethod::minimize(), and Problem().

◆ setCurrentValue()

void QuantLib::Problem::setCurrentValue ( const DynamicVector< RealType > &  currentValue)
inline

◆ setFunctionValue()

void QuantLib::Problem::setFunctionValue ( RealType  functionValue)
inline

Definition at line 80 of file Problem.hpp.

References functionValue(), and functionValue_.

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

◆ setGradientNormValue()

void QuantLib::Problem::setGradientNormValue ( RealType  squaredNorm)
inline

Definition at line 87 of file Problem.hpp.

References squaredNorm_.

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

◆ value()

RealType QuantLib::Problem::value ( const DynamicVector< RealType > &  x)
inline

◆ valueAndGradient()

RealType QuantLib::Problem::valueAndGradient ( DynamicVector< RealType > &  grad_f,
const DynamicVector< RealType > &  x 
)
inline

Member Data Documentation

◆ constraint_

Constraint& QuantLib::Problem::constraint_
protected

Constraint.

Definition at line 107 of file Problem.hpp.

Referenced by constraint().

◆ currentValue_

DynamicVector<RealType> QuantLib::Problem::currentValue_
protected

current value of the local minimum

Definition at line 109 of file Problem.hpp.

Referenced by currentValue(), setCurrentValue(), value(), and valueAndGradient().

◆ functionEvaluation_

int QuantLib::Problem::functionEvaluation_
protected

number of evaluation of objective function and its gradient

Definition at line 113 of file Problem.hpp.

Referenced by functionEvaluation(), reset(), setCurrentValue(), value(), and valueAndGradient().

◆ functionValue_

RealType QuantLib::Problem::functionValue_
protected

function and gradient norm values at the curentValue_ (i.e. the last step)

Definition at line 111 of file Problem.hpp.

Referenced by functionValue(), reset(), setCurrentValue(), setFunctionValue(), value(), and valueAndGradient().

◆ gradientEvaluation_

int QuantLib::Problem::gradientEvaluation_
protected

◆ objectiveFunction_

ObjectiveFunction& QuantLib::Problem::objectiveFunction_
protected

Unconstrained objective function.

Definition at line 105 of file Problem.hpp.

Referenced by gradient(), objectiveFunction(), value(), and valueAndGradient().

◆ squaredNorm_

RealType QuantLib::Problem::squaredNorm_
protected

Definition at line 111 of file Problem.hpp.

Referenced by gradientNormValue(), reset(), and setGradientNormValue().

◆ statusFunction_

StatusFunction& QuantLib::Problem::statusFunction_
protected

status function

Definition at line 115 of file Problem.hpp.

Referenced by setCurrentValue(), value(), and valueAndGradient().


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