32 jumpTimes_(jumpDates.size()), nJumps_(jumps_.size()) {
39 const Date& referenceDate,
43 const std::vector<Date>& jumpDates)
44 :
TermStructure(referenceDate, cal, dc), jumps_(
std::move(jumps)), jumpDates_(jumpDates),
45 jumpTimes_(jumpDates.size()), nJumps_(jumps_.size()) {
56 const std::vector<Date>& jumpDates)
57 :
TermStructure(settlementDays, cal, dc), jumps_(
std::move(jumps)), jumpDates_(jumpDates),
58 jumpTimes_(jumpDates.size()), nJumps_(jumps_.size()) {
73 "mismatch between number of jumps (" <<
nJumps_ <<
74 ") and jump dates (" <<
jumpDates_.size() <<
")");
83 bool extrapolate)
const {
93 "invalid " <<
io::ordinal(i+1) <<
" jump value: " <<
95 jumpEffect *= thisJump;
106 bool extrapolate)
const {
108 "initial date (" << d1 <<
") "
109 "later than final date (" << d2 <<
")");
119 bool extrapolate)
const {
121 "initial time (" << t1 <<
") "
122 "later than final time (" << t2 <<
")");
Probability survivalProbability(const Date &d, bool extrapolate=false) const
virtual Probability survivalProbabilityImpl(Time) const =0
survival probability calculation
std::vector< Date > jumpDates_
std::vector< Time > jumpTimes_
Probability defaultProbability(const Date &d, bool extrapolate=false) const
std::vector< Handle< Quote > > jumps_
DefaultProbabilityTermStructure(const DayCounter &dc=DayCounter(), std::vector< Handle< Quote > > jumps={}, const std::vector< Date > &jumpDates={})
Shared handle to an observable.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Basic term-structure functionality.
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
Time timeFromReference(const Date &date) const
date/time conversion
void checkRange(const Date &d, bool extrapolate) const
date-range check
default-probability term structure
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
detail::ordinal_holder ordinal(Size)
outputs naturals as 1st, 2nd, 3rd...
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
unsigned QL_INTEGER Natural
positive integer
Real Probability
probability
std::size_t Size
size of a container