CFL
Extended.hpp
Go to the documentation of this file.
1 //Copyright (c) Dmitry Kramkov, 2000-2006. All rights reserved.
2 
3 #ifndef __cflExtended_hpp__
4 #define __cflExtended_hpp__
5 
6 #include "cfl/PathDependent.hpp"
7 
19  namespace cfl
20  {
33 
35 
40  class IExtend
41  {
42  public:
46  virtual ~IExtend(){};
47 
57  virtual IModel * newModel(const PathDependent & rState,
58  const IModel & rModel) const = 0;
59  };
60 
62 
68  class Extended: public IModel
69  {
70  public:
75  explicit Extended(IExtend * pNewP = 0);
76 
81  explicit Extended(const std::vector<std::shared_ptr<IExtend> > & rVecExtend);
82 
87  void assign(const IModel & rModel);
88 
95  unsigned addState(const PathDependent & rState);
96 
100  const std::vector<double> & eventTimes() const;
101 
105  unsigned numberOfStates() const;
106 
110  unsigned numberOfNodes(unsigned iEventTime,
111  const std::vector<unsigned> & rStates) const;
112 
116  std::valarray<double> origin() const;
117 
121  Slice state(unsigned iEventTime, unsigned iState) const;
122 
126  void addDependence(Slice & rSlice,
127  const std::vector<unsigned> & rStates) const;
128 
132  void rollback(Slice & rSlice, unsigned iEventTime) const;
133 
137  void indicator(Slice & rSlice, double dBarrier) const;
138 
142  MultiFunction interpolate(const Slice & rSlice) const;
143 
148  const IModel * ptrToModel() const;
149 
150  private:
153  const IModel * m_pModel;
154  };
155 
157 
162  namespace NExtended
163  {
169  Extended model(const std::vector<Approx> & rApprox);
170 
177  Extended model(const Approx & rApprox);
178 
184  Extended model(double dQuality);
185 
191  Extended model(const std::vector<double> & rQuality);
192  }
194  }
195 
196 #include "cfl/Inline/iExtended.hpp"
197 #endif // of __cflExtended_hpp__
198 
virtual ~IExtend()
Definition: Extended.hpp:46
Interface class for financial models.
Definition: Model.hpp:31
MultiFunction interpolate(const Slice &rSlice)
Path dependent processes as additional state processes.
Representation of random payoffs in the library.
Definition: Slice.hpp:40
Interface class for a one-dimensional extension of a model.
Definition: Extended.hpp:40
Standard concrete class for path dependent functions.
Definition: PathDependent.hpp:64
Main namespace for cfl library.
Definition: Approx.hpp:22
virtual IModel * newModel(const PathDependent &rState, const IModel &rModel) const =0
Extended model(const std::vector< double > &rQuality)
Concrete class for the "extended" financial models.
Definition: Extended.hpp:68
Standard concrete class for multi-dimensional function object.
Definition: MultiFunction.hpp:79
STL class.
Slice indicator(const Slice &rSlice, double dBarrier)
Slice rollback(const Slice &rSlice, unsigned iEventTime)
Standard concrete class for numerical approximation.
Definition: Approx.hpp:85