CostFunction Class Reference

### A free/open-source library for quantitative finance

Public Member Functions
CostFunction Class Reference

Cost function abstract class for optimization problem. More...

`#include <ql/math/optimization/costfunction.hpp>`

Inheritance diagram for CostFunction:
[legend]

List of all members.

## Public Member Functions
virtual Real | value (const Array &x) const =0
| method to overload to compute the cost function value in x
virtual Disposable< Array > | values (const Array &x) const =0
| method to overload to compute the cost function values 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
virtual Real | finiteDifferenceEpsilon () const
| Default epsilon for finite difference method :

## Detailed Description

Cost function abstract class for optimization problem.