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(); }
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_
int getNumInRange() const
void getGrid(std::vector< double > &values)
double getEndPlusEps() const
void getGrid(std::vector< double > &values, double offset)
Range(const std::array< double, 3 > &interval, bool force_include_end=false)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const
double getProgressFactor(double t) const
Range(double start, double step, int num, bool force_include_end=false)
Range(double start, double step, double end, bool force_include_end=false)
double getRemainder() const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T fmod(const T &a, const T &b)
#define PRINT_INFO(msg)
Print msg-stream.
Range(double single_val, bool force_include_end=false)