QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
List of all members
TimeGrid Class Reference

time grid class More...

#include <ql/timegrid.hpp>

+ Collaboration diagram for TimeGrid:

Public Member Functions

Constructors
 TimeGrid ()=default
 
 TimeGrid (Time end, Size steps)
 Regularly spaced time-grid. More...
 
template<class Iterator >
 TimeGrid (Iterator begin, Iterator end)
 Time grid with mandatory time points. More...
 
template<class Iterator >
 TimeGrid (Iterator begin, Iterator end, Size steps)
 Time grid with mandatory time points. More...
 
 TimeGrid (std::initializer_list< Time > times)
 
 TimeGrid (std::initializer_list< Time > times, Size steps)
 
Time grid interface
Size index (Time t) const
 returns the index i such that grid[i] = t More...
 
Size closestIndex (Time t) const
 returns the index i such that grid[i] is closest to t More...
 
Time closestTime (Time t) const
 returns the time on the grid closest to the given t More...
 
const std::vector< Time > & mandatoryTimes () const
 
Time dt (Size i) const
 

sequence interface

typedef std::vector< Time >::const_iterator const_iterator
 
typedef std::vector< Time >::const_reverse_iterator const_reverse_iterator
 
std::vector< Timetimes_
 
std::vector< Timedt_
 
std::vector< TimemandatoryTimes_
 
Time operator[] (Size i) const
 
Time at (Size i) const
 
Size size () const
 
bool empty () const
 
const_iterator begin () const
 
const_iterator end () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
Time front () const
 
Time back () const
 

Detailed Description

time grid class

Examples
BermudanSwaption.cpp.

Definition at line 43 of file timegrid.hpp.

Member Typedef Documentation

◆ const_iterator

typedef std::vector<Time>::const_iterator const_iterator

Definition at line 158 of file timegrid.hpp.

◆ const_reverse_iterator

typedef std::vector<Time>::const_reverse_iterator const_reverse_iterator

Definition at line 160 of file timegrid.hpp.

Constructor & Destructor Documentation

◆ TimeGrid() [1/6]

TimeGrid ( )
default

◆ TimeGrid() [2/6]

TimeGrid ( Time  end,
Size  steps 
)

Regularly spaced time-grid.

Definition at line 26 of file timegrid.cpp.

+ Here is the call graph for this function:

◆ TimeGrid() [3/6]

TimeGrid ( Iterator  begin,
Iterator  end 
)

Time grid with mandatory time points.

Mandatory points are guaranteed to belong to the grid. No additional points are added.

Definition at line 55 of file timegrid.hpp.

+ Here is the call graph for this function:

◆ TimeGrid() [4/6]

TimeGrid ( Iterator  begin,
Iterator  end,
Size  steps 
)

Time grid with mandatory time points.

Mandatory points are guaranteed to belong to the grid. Additional points are then added with regular spacing between pairs of mandatory times in order to reach the desired number of steps.

Definition at line 86 of file timegrid.hpp.

+ Here is the call graph for this function:

◆ TimeGrid() [5/6]

TimeGrid ( std::initializer_list< Time times)

Definition at line 136 of file timegrid.hpp.

◆ TimeGrid() [6/6]

TimeGrid ( std::initializer_list< Time times,
Size  steps 
)

Definition at line 138 of file timegrid.hpp.

Member Function Documentation

◆ index()

Size index ( Time  t) const

returns the index i such that grid[i] = t

Definition at line 43 of file timegrid.cpp.

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

◆ closestIndex()

Size closestIndex ( Time  t) const

returns the index i such that grid[i] is closest to t

Definition at line 80 of file timegrid.cpp.

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

◆ closestTime()

Time closestTime ( Time  t) const

returns the time on the grid closest to the given t

Definition at line 148 of file timegrid.hpp.

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

◆ mandatoryTimes()

const std::vector< Time > & mandatoryTimes ( ) const

Definition at line 151 of file timegrid.hpp.

+ Here is the caller graph for this function:

◆ dt()

Time dt ( Size  i) const

Definition at line 154 of file timegrid.hpp.

+ Here is the caller graph for this function:

◆ operator[]()

Time operator[] ( Size  i) const

Definition at line 162 of file timegrid.hpp.

◆ at()

Time at ( Size  i) const

Definition at line 163 of file timegrid.hpp.

+ Here is the caller graph for this function:

◆ size()

Size size ( ) const

Definition at line 164 of file timegrid.hpp.

+ Here is the caller graph for this function:

◆ empty()

bool empty ( ) const

Definition at line 165 of file timegrid.hpp.

+ Here is the caller graph for this function:

◆ begin()

const_iterator begin ( ) const

Definition at line 166 of file timegrid.hpp.

+ Here is the caller graph for this function:

◆ end()

const_iterator end ( ) const

Definition at line 167 of file timegrid.hpp.

+ Here is the caller graph for this function:

◆ rbegin()

const_reverse_iterator rbegin ( ) const

Definition at line 168 of file timegrid.hpp.

◆ rend()

const_reverse_iterator rend ( ) const

Definition at line 169 of file timegrid.hpp.

◆ front()

Time front ( ) const

Definition at line 170 of file timegrid.hpp.

+ Here is the caller graph for this function:

◆ back()

Time back ( ) const

Definition at line 171 of file timegrid.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ times_

std::vector<Time> times_
private

Definition at line 174 of file timegrid.hpp.

◆ dt_

std::vector<Time> dt_
private

Definition at line 175 of file timegrid.hpp.

◆ mandatoryTimes_

std::vector<Time> mandatoryTimes_
private

Definition at line 176 of file timegrid.hpp.