24 #ifndef SKA_CHEETAH_UTILS_BINMAP_H 25 #define SKA_CHEETAH_UTILS_BINMAP_H 47 template<
typename DataType>
58 BinMap(
unsigned int number_of_bins, DataType start, DataType
const& end);
62 void reset(
unsigned int number_of_bins);
68 void set_bounds(DataType lower, DataType upper);
72 void set_upper_bound(DataType
const&);
78 inline DataType upper_bound()
const;
79 inline DataType lower_bound()
const;
86 unsigned int bin_index(DataType
const&)
const;
99 DataType bin_start(
unsigned int index)
const;
102 DataType bin_end(
unsigned int index)
const;
105 inline DataType bin_assignment_number(
int index)
const;
108 inline unsigned last_bin_index()
const;
111 DataType last_bin_assignment_value()
const;
112 DataType first_bin_assignment_value()
const;
117 unsigned int _n_bins;
124 template<
typename DataType>
130 #include "cheetah/utils/detail/BinMap.cpp" 132 #endif // SKA_CHEETAH_UTILS_BINMAP_H unsigned int bin_index(DataType const &) const
give the bin Index of the value. n.b no range checks are made so passing endValue() will return an i...
Explicitly map a range on to a set of constant width indexed data bins.
Some limits and constants for FLDO.
void reset(unsigned int number_of_bins)
reset the number of bins
void set_bin_width(DataType)
set the width of each bin
void set_lower_bound(DataType)
set the assignemnt value for the first bin (n.b. not the same as the lower limit of the first bin) ...
unsigned int number_of_bins() const
the total number of bins
DataType bin_width() const
the width of a the bin (all are the same width)
void set_bounds(DataType lower, DataType upper)
set the the lower bound for first bin