Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
rebatedexercise.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
20
21namespace QuantExt {
22
23RebatedExercise::RebatedExercise(const Exercise& exercise, const Real rebate, const Natural rebateSettlementDays,
24 const Calendar& rebatePaymentCalendar,
25 const BusinessDayConvention rebatePaymentConvention)
26 : RebatedExercise(exercise, exercise.dates(), std::vector<Real>(exercise.dates().size(), rebate),
27 rebateSettlementDays * Days, rebatePaymentCalendar, rebatePaymentConvention) {}
28
29RebatedExercise::RebatedExercise(const Exercise& exercise, const Real rebate, const Period& rebateSettlementPeriod,
30 const Calendar& rebatePaymentCalendar,
31 const BusinessDayConvention rebatePaymentConvention)
32 : RebatedExercise(exercise, exercise.dates(), std::vector<Real>(exercise.dates().size(), rebate),
33 rebateSettlementPeriod, rebatePaymentCalendar, rebatePaymentConvention) {}
34
35RebatedExercise::RebatedExercise(const Exercise& exercise, const std::vector<Real>& rebates,
36 const Natural rebateSettlementDays, const Calendar& rebatePaymentCalendar,
37 const BusinessDayConvention rebatePaymentConvention)
38 : RebatedExercise(exercise, exercise.dates(), rebates, rebateSettlementDays * Days, rebatePaymentCalendar,
39 rebatePaymentConvention) {}
40
41RebatedExercise::RebatedExercise(const Exercise& exercise, const std::vector<Real>& rebates,
42 const Period& rebateSettlementPeriod, const Calendar& rebatePaymentCalendar,
43 const BusinessDayConvention rebatePaymentConvention)
44 : RebatedExercise(exercise, exercise.dates(), rebates, rebateSettlementPeriod, rebatePaymentCalendar,
45 rebatePaymentConvention) {}
46
47RebatedExercise::RebatedExercise(const Exercise& exercise, const std::vector<Date>& exerciseDates,
48 const std::vector<Real>& rebates, const Period& rebateSettlementPeriod,
49 const Calendar& rebatePaymentCalendar,
50 const BusinessDayConvention rebatePaymentConvention)
51 : Exercise(exercise), exerciseDates_(exerciseDates), rebates_(rebates),
52 rebateSettlementPeriod_(rebateSettlementPeriod), rebatePaymentCalendar_(rebatePaymentCalendar),
53 rebatePaymentConvention_(rebatePaymentConvention) {
54 QL_REQUIRE(exerciseDates_.empty() || exerciseDates_.size() == dates().size(),
55 "then number of notification dates ("
56 << dates().size() << ") must be equal to the number of exercise dates (" << exerciseDates_.size()
57 << ")");
58 QL_REQUIRE(rebates_.size() == dates().size(),
59 "the number of rebates (" << rebates_.size() << ") must be equal to the number of exercise dates ("
60 << dates().size());
61}
62
63} // namespace QuantExt
Rebated exercise with exercise dates != notification dates and arbitrary period.
RebatedExercise(const Exercise &exercise, const Real rebate=0.0, const Natural rebateSettlementDays=0, const Calendar &rebatePaymentCalendar=NullCalendar(), const BusinessDayConvention rebatePaymentConvention=Following)
as ql ctor
std::vector< Date > exerciseDates_
std::vector< Real > rebates_
more flexible version of ql class