QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SimpleCostFunction< ValuesFn > Class Template Reference

#include <costfunction.hpp>

+ Inheritance diagram for SimpleCostFunction< ValuesFn >:
+ Collaboration diagram for SimpleCostFunction< ValuesFn >:

Public Member Functions

 SimpleCostFunction (ValuesFn values)
 
Array values (const Array &x) const override
 method to overload to compute the cost function values in x More...
 
- Public Member Functions inherited from CostFunction
virtual ~CostFunction ()=default
 
virtual Real value (const Array &x) const
 method to overload to compute the cost function value in x More...
 
virtual Array values (const Array &x) const =0
 method to overload to compute the cost function values in x More...
 
virtual void gradient (Array &grad, const Array &x) const
 method to overload to compute grad_f, the first derivative of More...
 
virtual Real valueAndGradient (Array &grad, const Array &x) const
 method to overload to compute grad_f, the first derivative of More...
 
virtual void jacobian (Matrix &jac, const Array &x) const
 method to overload to compute J_f, the jacobian of More...
 
virtual Array valuesAndJacobian (Matrix &jac, const Array &x) const
 method to overload to compute J_f, the jacobian of More...
 
virtual Real finiteDifferenceEpsilon () const
 Default epsilon for finite difference method : More...
 

Private Attributes

ValuesFn values_
 

Detailed Description

template<class ValuesFn>
class QuantLib::SimpleCostFunction< ValuesFn >

Definition at line 100 of file costfunction.hpp.

Constructor & Destructor Documentation

◆ SimpleCostFunction()

SimpleCostFunction ( ValuesFn  values)
explicit

Definition at line 102 of file costfunction.hpp.

Member Function Documentation

◆ values()

Array values ( const Array x) const
overridevirtual

method to overload to compute the cost function values in x

Implements CostFunction.

Definition at line 104 of file costfunction.hpp.

Member Data Documentation

◆ values_

ValuesFn values_
private

Definition at line 106 of file costfunction.hpp.