Class to handle the generation of a list of values.
More...
#include <utilities.h>
Class to handle the generation of a list of values.
The class usage is based on the methods get(), next() and empty(). get() return the current value, next() upate the value and empty() return true if the generator reach the ends. If empty() is true calling next() or get() throws an out_of_range error.
◆ ListGenerator() [1/3]
| utilities::ListGenerator::ListGenerator |
( |
| ) |
|
|
inline |
◆ ListGenerator() [2/3]
| utilities::ListGenerator::ListGenerator |
( |
double |
_vstep, |
|
|
double |
_vstep_max = std::nan(""), |
|
|
double |
_vstep_min = std::nan("") |
|
) |
| |
|
inlineexplicit |
Constructor based on a step value. The values will be generated from _vstep_min to _vstep_max (can be not included) with step _vstep. If _vstep_max is not given the generation can last theoretically forever (_vstep_max default is 1E30).
- Parameters
-
| _vstep | step value to generate the values |
| _vstep_max | maximum value. |
| _vstep_min | Starting value. |
◆ ListGenerator() [3/3]
| utilities::ListGenerator::ListGenerator |
( |
const std::vector< double > & |
_tlist | ) |
|
|
inlineexplicit |
Constructor based on a vector of doubles. The class will slice all the values in the vector and will be marked as empty when the end of the vector is reached.
- Parameters
-
◆ empty()
| bool utilities::ListGenerator::empty |
( |
| ) |
const |
|
inline |
◆ forecast()
| double utilities::ListGenerator::forecast |
( |
| ) |
const |
|
inline |
Similar to next, but just return the next value withotu uptading anything
- Returns
- The next value if not empty, otherwise std::nan
◆ get()
| double utilities::ListGenerator::get |
( |
| ) |
const |
|
inline |
◆ get_max()
| double utilities::ListGenerator::get_max |
( |
| ) |
const |
|
inline |
◆ get_min()
| double utilities::ListGenerator::get_min |
( |
| ) |
const |
|
inline |
◆ initialise_tlist_iterators()
| void utilities::ListGenerator::initialise_tlist_iterators |
( |
| ) |
|
|
inlineprivate |
◆ make_unique() [1/2]
| std::unique_ptr< utilities::ListGenerator > utilities::ListGenerator::make_unique |
( |
double |
_vstep, |
|
|
double |
_vstep_max = std::nan(""), |
|
|
double |
_vstep_min = std::nan("") |
|
) |
| |
|
static |
◆ make_unique() [2/2]
◆ next()
| void utilities::ListGenerator::next |
( |
| ) |
|
|
inline |
◆ operator++() [1/2]
| double utilities::ListGenerator::operator++ |
( |
| ) |
|
|
inline |
◆ operator++() [2/2]
| double utilities::ListGenerator::operator++ |
( |
int |
| ) |
|
|
inline |
◆ begin
| std::vector<double>::iterator utilities::ListGenerator::begin |
|
private |
◆ current
| std::vector<double>::iterator utilities::ListGenerator::current |
|
private |
◆ end
| std::vector<double>::iterator utilities::ListGenerator::end |
|
private |
◆ end_of_list
| bool utilities::ListGenerator::end_of_list =false |
|
private |
◆ vcurrent
| double utilities::ListGenerator::vcurrent |
|
private |
◆ vlist
| std::vector<double> utilities::ListGenerator::vlist |
|
private |
◆ vmax
| double utilities::ListGenerator::vmax =2E30 |
|
private |
◆ vmin
| double utilities::ListGenerator::vmin =0. |
|
private |
◆ vstep
| double utilities::ListGenerator::vstep =std::nan("") |
|
private |
The documentation for this class was generated from the following files:
- /Users/giulianoiorio/Documents/sevn_public/src/general/utils/utilities.h
- /Users/giulianoiorio/Documents/sevn_public/src/general/utils/utilities.cpp