QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
swapratetrigger.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Mark Joshi
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20#ifndef quantlib_swap_rate_trigger_hpp
21#define quantlib_swap_rate_trigger_hpp
22
23#include <ql/methods/montecarlo/exercisestrategy.hpp>
24#include <ql/models/marketmodels/curvestate.hpp>
25#include <vector>
26
27namespace QuantLib {
28
29 class SwapRateTrigger : public ExerciseStrategy<CurveState> {
30 public:
31 SwapRateTrigger(const std::vector<Time>& rateTimes,
32 std::vector<Rate> swapTriggers,
33 const std::vector<Time>& exerciseTimes);
34 std::vector<Time> exerciseTimes() const override;
35 std::vector<Time> relevantTimes() const override;
36 void reset() override;
37 bool exercise(const CurveState& currentState) const override;
38 void nextStep(const CurveState& currentState) override;
39 std::unique_ptr<ExerciseStrategy<CurveState> > clone() const override;
40 private:
41 std::vector<Time> rateTimes_;
42 std::vector<Rate> swapTriggers_;
43 std::vector<Time> exerciseTimes_;
45 std::vector<Size> rateIndex_;
46 };
47
48}
49
50
51#endif
Curve state for market-model simulations
Definition: curvestate.hpp:41
std::vector< Size > rateIndex_
std::vector< Rate > swapTriggers_
std::vector< Time > relevantTimes() const override
std::vector< Time > rateTimes_
bool exercise(const CurveState &currentState) const override
std::vector< Time > exerciseTimes_
std::unique_ptr< ExerciseStrategy< CurveState > > clone() const override
void nextStep(const CurveState &currentState) override
std::vector< Time > exerciseTimes() const override
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35