25 #ifndef SRC_CORE_INCLUDE_CORBO_CORE_RANGE_H_
26 #define SRC_CORE_INCLUDE_CORBO_CORE_RANGE_H_
40 explicit Range(
double single_val,
bool force_include_end =
false)
45 explicit Range(
double start,
double step,
double end,
bool force_include_end =
false)
50 explicit Range(
double start,
double step,
int num,
bool force_include_end =
false)
56 explicit Range(
const std::array<double, 3>& interval,
bool force_include_end =
false)
68 inline double getEndPlusEps()
const {
return _end + std::numeric_limits<double>::epsilon(); }
75 void getGrid(std::vector<double>& values)
78 for (
int i = 0; i <
n; ++i) values.push_back(
_start + (
double)i *
_step);
82 void getGrid(std::vector<double>& values,
double offset)
85 for (
int i = 0; i <
n; ++i) values.push_back(
_start + (
double)i *
_step + offset);
135 #endif // SRC_CORE_INCLUDE_CORBO_CORE_RANGE_H_