QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Schedule Class Reference

Payment schedule. More...

#include <schedule.hpp>

+ Collaboration diagram for Schedule:

Public Member Functions

 Schedule (const std::vector< Date > &, Calendar calendar=NullCalendar(), BusinessDayConvention convention=Unadjusted, const ext::optional< BusinessDayConvention > &terminationDateConvention=ext::nullopt, const ext::optional< Period > &tenor=ext::nullopt, const ext::optional< DateGeneration::Rule > &rule=ext::nullopt, const ext::optional< bool > &endOfMonth=ext::nullopt, std::vector< bool > isRegular=std::vector< bool >(0))
 
 Schedule (Date effectiveDate, const Date &terminationDate, const Period &tenor, Calendar calendar, BusinessDayConvention convention, BusinessDayConvention terminationDateConvention, DateGeneration::Rule rule, bool endOfMonth, const Date &firstDate=Date(), const Date &nextToLastDate=Date())
 
 Schedule ()=default
 
Date access
Size size () const
 
const Dateoperator[] (Size i) const
 
const Dateat (Size i) const
 
const Datedate (Size i) const
 
Date previousDate (const Date &refDate) const
 
Date nextDate (const Date &refDate) const
 
const std::vector< Date > & dates () const
 
bool hasIsRegular () const
 
bool isRegular (Size i) const
 
const std::vector< bool > & isRegular () const
 
Other inspectors
bool empty () const
 
const Calendarcalendar () const
 
const DatestartDate () const
 
const DateendDate () const
 
bool hasTenor () const
 
const Periodtenor () const
 
BusinessDayConvention businessDayConvention () const
 
bool hasTerminationDateBusinessDayConvention () const
 
BusinessDayConvention terminationDateBusinessDayConvention () const
 
bool hasRule () const
 
DateGeneration::Rule rule () const
 
bool hasEndOfMonth () const
 
bool endOfMonth () const
 

Iterators

typedef std::vector< Date >::const_iterator const_iterator
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator lower_bound (const Date &d=Date()) const
 

Utilities

ext::optional< Periodtenor_
 
Calendar calendar_
 
BusinessDayConvention convention_
 
ext::optional< BusinessDayConventionterminationDateConvention_
 
ext::optional< DateGeneration::Rulerule_
 
ext::optional< boolendOfMonth_
 
Date firstDate_
 
Date nextToLastDate_
 
std::vector< Datedates_
 
std::vector< boolisRegular_
 
Schedule after (const Date &truncationDate) const
 truncated schedule More...
 
Schedule until (const Date &truncationDate) const
 

Detailed Description

Payment schedule.

Examples
BermudanSwaption.cpp, Bonds.cpp, CDS.cpp, CallableBonds.cpp, ConvertibleBonds.cpp, FittedBondCurve.cpp, Gaussian1dModels.cpp, MulticurveBootstrapping.cpp, and Repo.cpp.

Definition at line 40 of file schedule.hpp.

Member Typedef Documentation

◆ const_iterator

typedef std::vector<Date>::const_iterator const_iterator

Definition at line 98 of file schedule.hpp.

Constructor & Destructor Documentation

◆ Schedule() [1/3]

Schedule ( const std::vector< Date > &  dates,
Calendar  calendar = NullCalendar(),
BusinessDayConvention  convention = Unadjusted,
const ext::optional< BusinessDayConvention > &  terminationDateConvention = ext::nullopt,
const ext::optional< Period > &  tenor = ext::nullopt,
const ext::optional< DateGeneration::Rule > &  rule = ext::nullopt,
const ext::optional< bool > &  endOfMonth = ext::nullopt,
std::vector< bool isRegular = std::vector<bool>(0) 
)

constructor that takes any list of dates, and optionally meta information that can be used by client classes. Note that neither the list of dates nor the meta information is checked for plausibility in any sense.

Definition at line 58 of file schedule.cpp.

+ Here is the call graph for this function:

◆ Schedule() [2/3]

Schedule ( Date  effectiveDate,
const Date terminationDate,
const Period tenor,
Calendar  calendar,
BusinessDayConvention  convention,
BusinessDayConvention  terminationDateConvention,
DateGeneration::Rule  rule,
bool  endOfMonth,
const Date firstDate = Date(),
const Date nextToLastDate = Date() 
)

rule based constructor

Definition at line 81 of file schedule.cpp.

+ Here is the call graph for this function:

◆ Schedule() [3/3]

Schedule ( )
default

Member Function Documentation

◆ size()

Size size ( ) const

Definition at line 69 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ operator[]()

const Date & operator[] ( Size  i) const

Definition at line 164 of file schedule.hpp.

◆ at()

const Date & at ( Size  i) const

Definition at line 172 of file schedule.hpp.

◆ date()

const Date & date ( Size  i) const
Examples
ConvertibleBonds.cpp.

Definition at line 160 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ previousDate()

Date previousDate ( const Date refDate) const

Definition at line 508 of file schedule.cpp.

+ Here is the call graph for this function:

◆ nextDate()

Date nextDate ( const Date refDate) const

Definition at line 500 of file schedule.cpp.

+ Here is the call graph for this function:

◆ dates()

const std::vector< Date > & dates ( ) const

Definition at line 75 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ hasIsRegular()

bool hasIsRegular ( ) const

Definition at line 516 of file schedule.cpp.

+ Here is the caller graph for this function:

◆ isRegular() [1/2]

bool isRegular ( Size  i) const

Definition at line 518 of file schedule.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegular() [2/2]

const std::vector< bool > & isRegular ( ) const

Definition at line 527 of file schedule.cpp.

◆ empty()

bool empty ( ) const

Definition at line 82 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ calendar()

const Calendar & calendar ( ) const

Definition at line 176 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ startDate()

const Date & startDate ( ) const

Definition at line 180 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ endDate()

const Date & endDate ( ) const

Definition at line 184 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ hasTenor()

bool hasTenor ( ) const

Definition at line 186 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ tenor()

const Period & tenor ( ) const

Definition at line 190 of file schedule.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ businessDayConvention()

BusinessDayConvention businessDayConvention ( ) const

Definition at line 196 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ hasTerminationDateBusinessDayConvention()

bool hasTerminationDateBusinessDayConvention ( ) const

Definition at line 201 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ terminationDateBusinessDayConvention()

BusinessDayConvention terminationDateBusinessDayConvention ( ) const

Definition at line 206 of file schedule.hpp.

+ Here is the call graph for this function:

◆ hasRule()

bool hasRule ( ) const

Definition at line 212 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ rule()

DateGeneration::Rule rule ( ) const

Definition at line 216 of file schedule.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasEndOfMonth()

bool hasEndOfMonth ( ) const

Definition at line 221 of file schedule.hpp.

+ Here is the caller graph for this function:

◆ endOfMonth()

bool endOfMonth ( ) const

Definition at line 225 of file schedule.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ begin()

const_iterator begin ( ) const
Examples
CDS.cpp.

Definition at line 99 of file schedule.hpp.

◆ end()

const_iterator end ( ) const
Examples
CDS.cpp.

Definition at line 100 of file schedule.hpp.

◆ lower_bound()

std::vector< Date >::const_iterator lower_bound ( const Date d = Date()) const

Definition at line 493 of file schedule.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ after()

Schedule after ( const Date truncationDate) const

truncated schedule

Definition at line 425 of file schedule.cpp.

◆ until()

Schedule until ( const Date truncationDate) const

Definition at line 459 of file schedule.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ tenor_

ext::optional<Period> tenor_
private

Definition at line 110 of file schedule.hpp.

◆ calendar_

Calendar calendar_
private

Definition at line 111 of file schedule.hpp.

◆ convention_

BusinessDayConvention convention_
private

Definition at line 112 of file schedule.hpp.

◆ terminationDateConvention_

ext::optional<BusinessDayConvention> terminationDateConvention_
private

Definition at line 113 of file schedule.hpp.

◆ rule_

ext::optional<DateGeneration::Rule> rule_
private

Definition at line 114 of file schedule.hpp.

◆ endOfMonth_

ext::optional<bool> endOfMonth_
private

Definition at line 115 of file schedule.hpp.

◆ firstDate_

Date firstDate_
private

Definition at line 116 of file schedule.hpp.

◆ nextToLastDate_

Date nextToLastDate_
private

Definition at line 116 of file schedule.hpp.

◆ dates_

std::vector<Date> dates_
private

Definition at line 117 of file schedule.hpp.

◆ isRegular_

std::vector<bool> isRegular_
private

Definition at line 118 of file schedule.hpp.