27 std::vector<Rate> swapTriggers,
28 const std::vector<Time>& exerciseTimes)
29 : rateTimes_(rateTimes), swapTriggers_(
std::move(swapTriggers)), exerciseTimes_(exerciseTimes),
30 rateIndex_(exerciseTimes.size()) {
34 "Rate times must contain at least two values");
39 "swapTriggers/exerciseTimes mismatch");
42 while (j < rateTimes.size() && rateTimes[j] <
exerciseTimes[i])
62 Rate currentSwapRate =
71 std::unique_ptr<ExerciseStrategy<CurveState>>
73 return std::unique_ptr<ExerciseStrategy<CurveState>>(
new SwapRateTrigger(*
this));
Curve state for market-model simulations
virtual Rate coterminalSwapRate(Size i) const =0
std::vector< Size > rateIndex_
std::vector< Rate > swapTriggers_
std::vector< Time > relevantTimes() const override
bool exercise(const CurveState ¤tState) const override
std::vector< Time > exerciseTimes_
std::unique_ptr< ExerciseStrategy< CurveState > > clone() const override
SwapRateTrigger(const std::vector< Time > &rateTimes, std::vector< Rate > swapTriggers, const std::vector< Time > &exerciseTimes)
void nextStep(const CurveState ¤tState) override
std::vector< Time > exerciseTimes() const override
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
void checkIncreasingTimes(const std::vector< Time > ×)
check for strictly increasing times, first time greater than zero