if (from <= to)
throw new IllegalStateException("cannot roll the asset back to "
+ to + " (it is already at t = " + from + ")");
final DiscretizedConvertible convertible = (DiscretizedConvertible) (asset);
final int iFrom = t.index(from);
final int iTo = t.index(to);
for (int i = iFrom - 1; i >= iTo; --i) {
final Array newValues = new Array(size(i));
final Array newSpreadAdjustedRate = new Array(size(i));
final Array newConversionProbability = new Array(size(i));
stepback(i, convertible.values(), convertible
.conversionProbability(), convertible.spreadAdjustedRate(),
newValues, newConversionProbability, newSpreadAdjustedRate);
convertible.setTime(t.get(i));
convertible.setValues(newValues);
convertible.setSpreadAdjustedRate(newSpreadAdjustedRate);
convertible.setConversionProbability(newConversionProbability);
// skip the very last adjustment
if (i != iTo)
convertible.adjustValues();
}
}