CostFunctionDecorator.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_COSTFUNCTIONDECORATOR_HPP
2 #define JULIAN_COSTFUNCTIONDECORATOR_HPP
3 
6 #include <utils/smartPointer.hpp>
7 #include <armadillo>
8 
9 namespace julian {
10 namespace ir {
25  public:
29 
30  virtual arma::mat giveQmatrix(const InterpolatedCurve&) const;
31  virtual arma::mat giveCvector(const InterpolatedCurve&) const;
32  virtual double calculateCost(const InterpolatedCurve&) const;
33 
34  virtual std::vector<double> giveSmoothedCurve(const InterpolatedCurve&) const;
35  virtual void updateSmoothedCurve(InterpolatedCurve&,const std::vector<double>&) const;
36  virtual CostFunctionDecorator* clone() const;
37 
41 
42  protected:
43  arma::mat matrixD(int size, int order) const;
44  arma::mat matrixX(const InterpolatedCurve& c, int order) const;
45 
46 
47  private:
49  };
50 } // namespace ir
51 } // namespace julian
52 #endif
virtual std::vector< double > giveSmoothedCurve(const InterpolatedCurve &) const
returns curve as vector of doubles
Definition: CostFunctionDecorator.cpp:36
File contains template of deep-coping smart pointer.
SmartPointer< SmootherCostFunction > cost_function_
Pointer to decorator interface.
Definition: CostFunctionDecorator.hpp:48
virtual CostFunctionDecorator * clone() const
virtual copy constructor
Definition: CostFunctionDecorator.cpp:28
Definition: cadHoliday.cpp:3
virtual arma::mat giveQmatrix(const InterpolatedCurve &) const
returns Q matrix, the quadratic term of optimization cost function
Definition: CostFunctionDecorator.cpp:10
Template of deep-coping smart pointer.
Definition: smartPointer.hpp:14
arma::mat matrixD(int size, int order) const
Creates matrix representation of differential operator.
Definition: CostFunctionDecorator.cpp:82
File contains interface of cost function used by interest rate curve smoothers.
virtual double calculateCost(const InterpolatedCurve &) const
calculates value of cost function
Definition: CostFunctionDecorator.cpp:22
arma::mat matrixX(const InterpolatedCurve &c, int order) const
Creates matrix representation of differential operator.
Definition: CostFunctionDecorator.cpp:131
CostFunctionDecorator(SmartPointer< SmootherCostFunction > c)
Constructor.
Definition: CostFunctionDecorator.hpp:28
File contains definition of swap interpolated curve class.
Interface for Smoother Cost Function decorator.
Definition: SmootherCostFunction.hpp:39
The object models the interest rate curve.
Definition: interpolatedCurve.hpp:42
Interface for classes decorating SmootherCostFunction.
Definition: CostFunctionDecorator.hpp:24
virtual void updateSmoothedCurve(InterpolatedCurve &, const std::vector< double > &) const
updates the curve as with the vector of doubles
Definition: CostFunctionDecorator.cpp:42
virtual arma::mat giveCvector(const InterpolatedCurve &) const
returns C vector, the linear term of optimization cost function
Definition: CostFunctionDecorator.cpp:16
virtual ~CostFunctionDecorator()
destructor
Definition: CostFunctionDecorator.hpp:40