QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ProjectedCostFunction Class Reference

Parameterized cost function. More...

#include <ql/math/optimization/projectedcostfunction.hpp>

+ Inheritance diagram for ProjectedCostFunction:
+ Collaboration diagram for ProjectedCostFunction:

Public Member Functions

 ProjectedCostFunction (const CostFunction &costFunction, const Array &parameterValues, const std::vector< bool > &fixParameters)
 
 ProjectedCostFunction (const CostFunction &costFunction, const Projection &projection)
 
- 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...
 
- Public Member Functions inherited from Projection
 Projection (const Array &parameterValues, std::vector< bool > fixParameters=std::vector< bool >())
 
virtual Array project (const Array &parameters) const
 returns the subset of free parameters corresponding More...
 
virtual Array include (const Array &projectedParameters) const
 returns whole set of parameters corresponding to the set More...
 
virtual ~Projection ()=default
 

CostFunction interface

const CostFunctioncostFunction_
 
Real value (const Array &freeParameters) const override
 method to overload to compute the cost function value in x More...
 
Array values (const Array &freeParameters) const override
 method to overload to compute the cost function values in x More...
 

Additional Inherited Members

- Protected Member Functions inherited from Projection
void mapFreeParameters (const Array &parameterValues) const
 
- Protected Attributes inherited from Projection
Size numberOfFreeParameters_ = 0
 
const Array fixedParameters_
 
Array actualParameters_
 
std::vector< boolfixParameters_
 

Detailed Description

Parameterized cost function.

This class creates a proxy cost function which can depend on any arbitrary subset of parameters (the other being fixed)

Definition at line 39 of file projectedcostfunction.hpp.

Constructor & Destructor Documentation

◆ ProjectedCostFunction() [1/2]

ProjectedCostFunction ( const CostFunction costFunction,
const Array parameterValues,
const std::vector< bool > &  fixParameters 
)

Definition at line 26 of file projectedcostfunction.cpp.

◆ ProjectedCostFunction() [2/2]

ProjectedCostFunction ( const CostFunction costFunction,
const Projection projection 
)

Definition at line 32 of file projectedcostfunction.cpp.

Member Function Documentation

◆ value()

Real value ( const Array x) const
overridevirtual

method to overload to compute the cost function value in x

Reimplemented from CostFunction.

Definition at line 37 of file projectedcostfunction.cpp.

+ Here is the call graph for this function:

◆ values()

Array values ( const Array x) const
overridevirtual

method to overload to compute the cost function values in x

Implements CostFunction.

Definition at line 42 of file projectedcostfunction.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ costFunction_

const CostFunction& costFunction_
private

Definition at line 55 of file projectedcostfunction.hpp.