QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
time grid class More...
#include <timegrid.hpp>
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< Time > | times_ |
std::vector< Time > | dt_ |
std::vector< Time > | mandatoryTimes_ |
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 |
typedef std::vector<Time>::const_iterator const_iterator |
Definition at line 158 of file timegrid.hpp.
typedef std::vector<Time>::const_reverse_iterator const_reverse_iterator |
Definition at line 160 of file timegrid.hpp.
|
default |
Regularly spaced time-grid.
Definition at line 26 of file timegrid.cpp.
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.
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.
Definition at line 136 of file timegrid.hpp.
Definition at line 138 of file timegrid.hpp.
returns the index i such that grid[i] = t
Definition at line 43 of file timegrid.cpp.
returns the index i such that grid[i] is closest to t
Definition at line 80 of file timegrid.cpp.
returns the time on the grid closest to the given t
Definition at line 148 of file timegrid.hpp.
const std::vector< Time > & mandatoryTimes | ( | ) | const |
Definition at line 162 of file timegrid.hpp.
Size size | ( | ) | const |
bool empty | ( | ) | const |
const_iterator begin | ( | ) | const |
const_iterator end | ( | ) | const |
const_reverse_iterator rbegin | ( | ) | const |
Definition at line 168 of file timegrid.hpp.
const_reverse_iterator rend | ( | ) | const |
Definition at line 169 of file timegrid.hpp.
Time front | ( | ) | const |
Time back | ( | ) | const |
|
private |
Definition at line 174 of file timegrid.hpp.
|
private |
Definition at line 175 of file timegrid.hpp.
|
private |
Definition at line 176 of file timegrid.hpp.