}
StatHist::StatHist(const StatHist &src) :
- bins(NULL),
+ bins(nullptr),
capacity_(src.capacity_),
min_(src.min_),
max_(src.max_),
val_in(src.val_in),
val_out(src.val_out)
{
- if (src.bins!=NULL) {
+ if (src.bins!=nullptr) {
bins = static_cast<bins_type *>(xcalloc(src.capacity_, sizeof(bins_type)));
memcpy(bins,src.bins,capacity_*sizeof(*bins));
}
void
StatHist::count(double v)
{
- if (bins==NULL) //do not count before initialization or after destruction
+ if (bins==nullptr) //do not count before initialization or after destruction
return;
const unsigned int bin = findBin(v);
++bins[bin];
Must(min_ == B.min_);
Must(max_ == B.max_);
- if (B.bins == NULL) { // B was not yet initializted
+ if (B.bins == nullptr) { // B was not yet initializted
return *this;
}
- if (bins == NULL) { // this histogram was not yet initialized
+ if (bins == nullptr) { // this histogram was not yet initialized
*this = B;
return *this;
}