flatCurve.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_FLATCURVE_HPP
2 #define JULIAN_FLATCURVE_HPP
3 
4 #include <dates/date.hpp>
7 
8 
9 namespace julian {
10  namespace ir {
11 
24  class FlatCurve: public Curve {
25  public:
26  FlatCurve();
27  FlatCurve(InterestRate&,double, Date, Calendar&);
28 
29  virtual double DF(Date) const;
30  virtual double DF(Date,Date) const;
31  virtual double DF(Tenor) const;
32  virtual double DF(Tenor,Tenor) const;
33 
34  virtual double capitalization(Date) const;
35  virtual double capitalization(Tenor) const;
36  virtual double capitalization(Date,Date) const;
37  virtual double capitalization(Tenor,Tenor) const;
38 
39  virtual double coupon(Date) const;
40  virtual double coupon(Tenor) const;
41  virtual double coupon(Date,Date) const;
42  virtual double coupon(Tenor,Tenor) const;
43 
44  virtual double rate(Date) const;
45  virtual double rate(Tenor) const;
46  virtual double rate(Date,InterestRate) const;
47  virtual double rate(Tenor,InterestRate) const;
48 
49  virtual double fwdRate(Date,Date) const;
50  virtual double fwdRate(Tenor,Tenor) const;
51  virtual double fwdRate(Date,Tenor) const;
52  virtual double fwdRate(Date,Date,InterestRate) const;
53  virtual double fwdRate(Tenor,Tenor,InterestRate) const;
54  virtual double fwdRate(Date,Tenor,InterestRate) const;
55 
56  virtual Date getValuationDate() const;
57 
58  virtual ~FlatCurve(){};
59  FlatCurve* clone() const;
60 
61  friend std::ostream& operator<<(std::ostream&, FlatCurve&);
62  friend class boost::serialization::access;
63  private:
64 
67  template<class Archive>
68  void serialize(Archive & ar, const unsigned int);
69 
74  };
75 
76  template<class Archive>
77  void FlatCurve::serialize(Archive & ar, const unsigned int) {
78  boost::serialization::base_object<Curve>(*this);
79  ar & BOOST_SERIALIZATION_NVP(rate_);
80  ar & BOOST_SERIALIZATION_NVP(zero_coupon_rate_);
81  ar & BOOST_SERIALIZATION_NVP(curve_date_);
82  ar & BOOST_SERIALIZATION_NVP(calendar_);
83  }
84 } // namespace ir
85 } // namespace julian
86 
87 #endif /* FLATCURVE_HPP */
virtual double capitalization(Date) const
get capitalization
Definition: flatCurve.cpp:44
FlatCurve * clone() const
Virtual copy constructor.
Definition: flatCurve.cpp:120
virtual double coupon(Date) const
get coupon
Definition: flatCurve.cpp:60
Definition: cadHoliday.cpp:3
Class implements calendar object.
Definition: calendar.hpp:30
virtual double fwdRate(Date, Date) const
get forward rate
Definition: flatCurve.cpp:92
File contains definition of date class.
InterestRate rate_
Interest rate convention.
Definition: flatCurve.hpp:70
virtual Date getValuationDate() const
get today date
Definition: flatCurve.cpp:116
Date curve_date_
Today represent the date on which the curve is valid.
Definition: flatCurve.hpp:72
friend std::ostream & operator<<(std::ostream &, FlatCurve &)
Overloads stream operator.
Definition: flatCurve.cpp:128
virtual double rate(Date) const
get zero coupon rate
Definition: flatCurve.cpp:76
Class implements a date object.
Definition: date.hpp:27
double zero_coupon_rate_
Value of zero coupon rate.
Definition: flatCurve.hpp:71
The class defines the flat interest rate curve.
Definition: flatCurve.hpp:24
Class implements a tenor object.
Definition: tenor.hpp:23
Calendar calendar_
Thanks to calendar outputs of the curve (DFs, forward rates etc) can be calculated only on the basis ...
Definition: flatCurve.hpp:73
The class implements the concept of interest rate.
Definition: interestRate.hpp:25
The class interfaces interest rate curves.
Definition: irCurve.hpp:22
void serialize(Archive &ar, const unsigned int)
interface used by Boost serialization library
Definition: flatCurve.hpp:77
File contains interface of interest rate curves.
FlatCurve()
default constructor
Definition: flatCurve.cpp:10
File contains definition of InterestRate class.
virtual double DF(Date) const
get DF
Definition: flatCurve.cpp:18