26#ifndef quantlib_optimization_problem_h
27#define quantlib_optimization_problem_h
31#include "optimization/StatusFunction.hpp"
42 const DynamicVector<RealType>& initialValue =
43 DynamicVector<RealType>()) :
53 RealType
value(
const DynamicVector<RealType>& x);
57 void gradient(DynamicVector<RealType>& grad_f,
58 const DynamicVector<RealType>& x);
62 const DynamicVector<RealType>& x);
70 void setCurrentValue(
const DynamicVector<RealType>&
currentValue) {
88 void setGradientNormValue(RealType squaredNorm) {
89 squaredNorm_ = squaredNorm;
100 RealType DotProduct(DynamicVector<RealType>& v1,
101 DynamicVector<RealType>& v2);
102 RealType computeGradientNormValue(DynamicVector<RealType>& grad_f);
131 const DynamicVector<RealType>& x) {
132 ++gradientEvaluation_;
137 const DynamicVector<RealType>& x) {
139 ++gradientEvaluation_;
Abstract optimization method class.
Optimization objective function class.
Objective function abstract class for optimization problem.
virtual RealType value(const DynamicVector< RealType > &x)=0
method to overload to compute the objective function value in x
virtual RealType valueAndGradient(DynamicVector< RealType > &grad, const DynamicVector< RealType > &x)
method to overload to compute grad_f, the first derivative
virtual void gradient(DynamicVector< RealType > &grad, const DynamicVector< RealType > &x)
method to overload to compute grad_f, the first derivative of
Constrained optimization problem.
ObjectiveFunction & objectiveFunction() const
Objective function.
void gradient(DynamicVector< RealType > &grad_f, const DynamicVector< RealType > &x)
call objective function gradient computation and increment
int gradientEvaluation() const
number of evaluation of objective function gradient
Constraint & constraint_
Constraint.
DynamicVector< RealType > currentValue_
current value of the local minimum
int functionEvaluation() const
number of evaluation of objective function
RealType functionValue() const
value of objective function
RealType value(const DynamicVector< RealType > &x)
call objective function computation and increment evaluation counter
ObjectiveFunction & objectiveFunction_
Unconstrained objective function.
Problem(ObjectiveFunction &objectiveFunction, Constraint &constraint, OpenMD::StatusFunction &statFunc, const DynamicVector< RealType > &initialValue=DynamicVector< RealType >())
default constructor
int functionEvaluation_
number of evaluation of objective function and its gradient
RealType gradientNormValue() const
value of objective function gradient norm
Constraint & constraint() const
Constraint.
StatusFunction & statusFunction_
status function
RealType functionValue_
function and gradient norm values at the curentValue_ (i.e. the last step)
RealType valueAndGradient(DynamicVector< RealType > &grad_f, const DynamicVector< RealType > &x)
call objective function computation and it gradient
const DynamicVector< RealType > & currentValue() const
current value of the local minimum