33 std::vector<Array>& states)
34 : path_(path), forwardTermStructures_(forwardTermStructures), payments_(payments),
35 exercises_(exercises), states_(states)
40 return path_.columns();
48 maximumTimeRead_ = std::max(maximumTimeRead_, time);
50 return path_[asset][time];
54 maximumTimeRead_ = std::max(maximumTimeRead_, time);
56 return forwardTermStructures_[time];
65 "not adapted payoff: looking into the future");
67 payments_[time] =
value;
77 "not adapted payoff: looking into the future");
79 if (!exercises_.empty())
80 exercises_[time] = exercise;
83 std::swap(states_[time], state);
91 std::vector<Array> & states)
const {
92 ValuationData data(path, forwardTermStructures, payments, exercises, states);
Adapted Option payoff classes.
Size numberOfTimes() const
void setExerciseData(Size time, Real exercise, Array &state)
const Handle< YieldTermStructure > & getYieldTermStructure(Size time)
ValuationData(const Matrix &path, const std::vector< Handle< YieldTermStructure > > &forwardTermStructures, Array &payments, Array &exercises, std::vector< Array > &states)
void setPayoffValue(Size time, Real value)
Real getAssetValue(Size time, Size asset)
Size numberOfAssets() const
virtual void operator()(ValuationData &data) const =0
void value(const Matrix &path, const std::vector< Handle< YieldTermStructure > > &forwardTermStructures, Array &payments, Array &exercises, std::vector< Array > &states) const override
1-D array used in linear algebra.
Shared handle to an observable.
Matrix used in linear algebra.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container