CFL
InterestRateModel.hpp
Go to the documentation of this file.
1 //Copyright (c) Dmitry Kramkov, 2000-2006. All rights reserved.
2 
3 #ifndef __cflInterestRateModel_hpp__
4 #define __cflInterestRateModel_hpp__
5 
6 #include <valarray>
7 #include "cfl/Extended.hpp"
8 
19 namespace cfl
20 {
27 
29 
34  class IInterestRateModel: public IModel
35  {
36  public:
40  virtual ~IInterestRateModel(){};
41 
49  virtual IInterestRateModel * newModel(const std::vector<double> & rEventTimes) const = 0;
50 
57  virtual Slice discount(unsigned iEventTime, double dBondMaturity) const = 0;
58  };
59 
61 
66  {
67  public:
68 
75  InterestRateModel(IInterestRateModel * pNewModel, const Extended & rExtended);
76 
84  void assignEventTimes(const std::vector<double> & rEventTimes);
85 
89  unsigned addState(const PathDependent & rState);
90 
94  unsigned numberOfStates() const;
95 
99  const std::vector<double> & eventTimes() const;
100 
105  double initialTime() const;
106 
107 
108 
112  Slice state(unsigned iEventTime, unsigned iState) const;
113 
122  Slice cash(unsigned iEventTime, double dAmount) const;
123 
127  Slice discount(unsigned iEventTime, double dBondMaturity) const;
128 
129  private:
130  Extended m_uExtended;
132  };
134 }
135 
136 #include "cfl/Inline/iInterestRateModel.hpp"
137 #endif // of __cflInterestRateModel_hpp__
Interface class for interest rate model.
Definition: InterestRateModel.hpp:34
Interface class for financial models.
Definition: Model.hpp:31
Concrete class for interest rate models.
Definition: InterestRateModel.hpp:65
virtual Slice discount(unsigned iEventTime, double dBondMaturity) const =0
Representation of random payoffs in the library.
Definition: Slice.hpp:40
virtual const std::vector< double > & eventTimes() const =0
Standard concrete class for path dependent functions.
Definition: PathDependent.hpp:64
Main namespace for cfl library.
Definition: Approx.hpp:22
virtual IInterestRateModel * newModel(const std::vector< double > &rEventTimes) const =0
Concrete class for the "extended" financial models.
Definition: Extended.hpp:68
STL class.
virtual unsigned numberOfStates() const =0
virtual Slice state(unsigned iEventTime, unsigned iState) const =0
virtual ~IInterestRateModel()
Definition: InterestRateModel.hpp:40
Extension of models by path dependent state processes.