89 {
90
91 Time from = asset.time();
92
93 if (close(from, to))
94 return;
95
96 QL_REQUIRE(from > to, "cannot roll the asset back to" << to << " (it is already at t = " << from << ")");
97
99
100 Integer iFrom = Integer(this->t_.index(from));
101 Integer iTo = Integer(this->t_.index(to));
102
103 for (Integer i = iFrom - 1; i >= iTo; --i) {
104
105 Array newValues(this->size(i));
106 Array newSpreadAdjustedRate(this->size(i));
107 Array newConversionProbability(this->size(i));
108
110 newValues, newConversionProbability, newSpreadAdjustedRate);
111
112 convertible.time() = this->t_[i];
113 convertible.values() = newValues;
116
117
118 if (i != iTo)
119 convertible.adjustValues();
120 }
121}
const Array & spreadAdjustedRate() const
const Array & conversionProbability() const
void stepback(Size i, const Array &values, const Array &conversionProbability, const Array &spreadAdjustedRate, Array &newValues, Array &newConversionProbability, Array &newSpreadAdjustedRate) const