18 #include "../declspec.h"
78 typedef std::int32_t size_type;
79 typedef std::int64_t count_type;
82 HistogramData(
const count_type* bins,
int nbins,
double min,
double max);
92 size_type getsize()
const {
return nbins_; }
93 const count_type* getbins()
const {
return bins_.get(); }
94 double getmin()
const {
return min_; }
95 double getmax()
const {
return max_; }
96 double getsmallestbinwidth()
const {
return 0.125; }
97 count_type get(
double value)
const;
98 count_type getcount()
const;
101 void scale(
double oldmin,
double oldmax,
double newmin,
double newmax);
106 static void getLinearTransform(
double *offset,
double *scale,
double oldmin,
double oldmax,
double newmin,
double newmax);
107 void calculateConversionFactors(
double* A,
double* B)
const;
108 void addToBinNumberUNSAFE(size_type binno) { bins_[binno] += 1; }
111 void addBins(
const count_type* bins,
int nbins,
double min,
double max,
bool add);
112 inline void addOne(
double value, count_type factor,
double A,
double B);
119 std::unique_ptr<count_type[]> bins_;
131 inline void HistogramData::addOne(
double value, count_type factor,
double A,
double B)
133 if (std::isfinite(value)) {
139 int n(RoundD2I(A + B*value));
142 if (
static_cast<unsigned int>(n) <
static_cast<unsigned int>(nbins_))