return *this;
}
+StatHist::StatHist(const StatHist &src) :
+ capacity_(src.capacity_), min_(src.min_), max_(src.max_),
+ scale_(src.scale_), val_in(src.val_in), val_out(src.val_out)
+{
+ if(src.bins!=NULL) {
+ bins = static_cast<int *>(xcalloc(src.capacity_, sizeof(int)));
+ memcpy(bins,src.bins,capacity_*sizeof(*bins));
+ }
+}
+
void
StatHist::count(double val)
{
* relevant initializations are done at build-time
*/
StatHist() : scale_(1.0) {}
- StatHist &operator=(const StatHist &);
+ StatHist(const StatHist&); //not needed
~StatHist();
+
+ StatHist &operator=(const StatHist &);
/** clear the contents of the histograms
*
* \todo remove: this function has been replaced in its purpose
*/
void dump(StoreEntry *sentry, StatHistBinDumper * bd) const;
/** Initialize the Histogram using a logarithmic values distribution
- *
*/
void logInit(int capacity, double min, double max);
/** initialize the histogram to count occurrences in an enum-represented set
- *
*/
void enumInit(int last_enum);
protected:
double scale_;
hbase_f *val_in; /* e.g., log() for log-based histogram */
hbase_f *val_out; /* e.g., exp() for log based histogram */
-private:
- StatHist(const StatHist&); //not needed
};
double statHistDeltaMedian(const StatHist & A, const StatHist & B);