26#ifndef quantlib_optimization_problem_h
27#define quantlib_optimization_problem_h
1-D array used in linear algebra.
Cost function abstract class for optimization problem.
virtual Array values(const Array &x) const =0
method to overload to compute the cost function values in x
virtual Real value(const Array &x) const
method to overload to compute the cost function value in x
virtual void gradient(Array &grad, const Array &x) const
method to overload to compute grad_f, the first derivative of
virtual Real valueAndGradient(Array &grad, const Array &x) const
method to overload to compute grad_f, the first derivative of
template class providing a null value for a given type.
Constrained optimization problem.
CostFunction & costFunction_
Unconstrained cost function.
const Array & currentValue() const
current value of the local minimum
Problem(CostFunction &costFunction, Constraint &constraint, Array initialValue=Array())
default constructor
Array currentValue_
current value of the local minimum
Real functionValue() const
value of cost function
Integer functionEvaluation_
number of evaluation of cost function and its gradient
void setGradientNormValue(Real squaredNorm)
Integer functionEvaluation() const
number of evaluation of cost function
Real gradientNormValue() const
value of cost function gradient norm
Constraint & constraint_
Constraint.
Constraint & constraint() const
Constraint.
Integer gradientEvaluation() const
number of evaluation of cost function gradient
Real value(const Array &x)
call cost function computation and increment evaluation counter
Array values(const Array &x)
call cost values computation and increment evaluation counter
void setFunctionValue(Real functionValue)
Integer gradientEvaluation_
CostFunction & costFunction() const
Cost function.
void setCurrentValue(const Array ¤tValue)
void gradient(Array &grad_f, const Array &x)
call cost function gradient computation and increment
Real valueAndGradient(Array &grad_f, const Array &x)
call cost function computation and it gradient
Real functionValue_
function and gradient norm values at the currentValue_ (i.e. the last step)
Abstract constraint class.
Optimization cost function class.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
QL_INTEGER Integer
integer number
Abstract optimization method class.