76c76
< : mystream(false), stream(NULL), compat(false), descriptions(false)
---
> : mystream(false), stream(NULL), descriptions(false)
81c81
< : mystream(false), stream(NULL), compat(false), descriptions(false)
---
> : mystream(false), stream(NULL), descriptions(false)
87c87
< : mystream(false), stream(NULL), compat(false), descriptions(false)
---
> : mystream(false), stream(NULL), descriptions(false)
155c155
< ValueToString(Result value, int precision, bool compat)
---
> ValueToString(Result value, int precision)
169c169
< val << (compat ? "<err: div-0>" : "no value");
---
> val << "no_value";
181d180
< bool compat;
205,211c204,205
< if (compat && flags & __substat) {
< ccprintf(stream, "%32s %12s %10s %10s", name,
< ValueToString(value, precision, compat), pdfstr, cdfstr);
< } else {
< ccprintf(stream, "%-40s %12s %10s %10s", name,
< ValueToString(value, precision, compat), pdfstr, cdfstr);
< }
---
> ccprintf(stream, "%-40s %12s %10s %10s", name,
> ValueToString(value, precision), pdfstr, cdfstr);
227d220
< bool compat;
248c241
< string base = name + (compat ? "_" : "::");
---
> string base = name + "::";
253d245
< print.compat = compat;
265,268c257,258
< } else if (!compat) {
< for (off_type i = 0; i < _size; ++i) {
< if (havesub && (i >= subnames.size() || subnames[i].empty()))
< continue;
---
> return;
> }
270,272c260,262
< print.name = base + (havesub ? subnames[i] : to_string(i));
< print.desc = subdescs.empty() ? desc : subdescs[i];
< print.value = vec[i];
---
> for (off_type i = 0; i < _size; ++i) {
> if (havesub && (i >= subnames.size() || subnames[i].empty()))
> continue;
274,277c264,266
< if (_total && (flags & pdf)) {
< print.pdf = vec[i] / _total;
< print.cdf += print.pdf;
< }
---
> print.name = base + (havesub ? subnames[i] : to_string(i));
> print.desc = subdescs.empty() ? desc : subdescs[i];
> print.value = vec[i];
279c268,270
< print(stream);
---
> if (_total && flags & pdf) {
> print.pdf = vec[i] / _total;
> print.cdf += print.pdf;
282,292c273,274
< if (flags & ::Stats::total) {
< print.name = base + "total";
< print.desc = desc;
< print.value = total;
< print(stream);
< }
< } else {
< if (flags & ::Stats::total) {
< print.value = total;
< print(stream);
< }
---
> print(stream);
> }
294,341c276,282
< Result _pdf = 0.0;
< Result _cdf = 0.0;
< if (flags & dist) {
< ccprintf(stream, "%s.start_dist\n", name);
< for (off_type i = 0; i < _size; ++i) {
< print.name = havesub ? subnames[i] : to_string(i);
< print.desc = subdescs.empty() ? desc : subdescs[i];
< print.flags |= __substat;
< print.value = vec[i];
<
< if (_total) {
< _pdf = vec[i] / _total;
< _cdf += _pdf;
< }
<
< if (flags & pdf)
< print.pdf = _pdf;
< if (flags & cdf)
< print.cdf = _cdf;
<
< print(stream);
< }
< ccprintf(stream, "%s.end_dist\n", name);
< } else {
< for (off_type i = 0; i < _size; ++i) {
< if (havesub && subnames[i].empty())
< continue;
<
< print.name = base;
< print.name += havesub ? subnames[i] : to_string(i);
< print.desc = subdescs.empty() ? desc : subdescs[i];
< print.value = vec[i];
<
< if (_total) {
< _pdf = vec[i] / _total;
< _cdf += _pdf;
< } else {
< _pdf = _cdf = NAN;
< }
<
< if (flags & pdf) {
< print.pdf = _pdf;
< print.cdf = _cdf;
< }
<
< print(stream);
< }
< }
---
> if (flags & ::Stats::total) {
> print.pdf = NAN;
> print.cdf = NAN;
> print.name = base + "total";
> print.desc = desc;
> print.value = total;
> print(stream);
350d290
< bool compat;
393d332
< compat = text->compat;
413c352
< string base = name + (compat ? "_" : "::");
---
> string base = name + "::";
417d355
< print.compat = compat;
446c384
< string base = name + (compat ? "." : "::");
---
> string base = name + "::";
449c387
< print.desc = compat ? "" : desc;
---
> print.desc = desc;
451d388
< print.compat = compat;
457,463d393
< if (compat) {
< ccprintf(stream, "%-42s", base + "start_dist");
< if (descriptions && !desc.empty())
< ccprintf(stream, " # %s", desc);
< stream << endl;
< }
<
472,479c402,406
< if (!compat || data.underflow > 0.0) {
< print.name = base + "underflows";
< print.value = data.underflow;
< if (!compat && total) {
< print.pdf = data.underflow / total;
< print.cdf += print.pdf;
< }
< print(stream);
---
> print.name = base + "underflows";
> print.value = data.underflow;
> if (total) {
> print.pdf = data.underflow / total;
> print.cdf += print.pdf;
480a408
> print(stream);
482,485c410,412
< if (!compat) {
< for (off_type i = 0; i < size; ++i) {
< stringstream namestr;
< namestr << base;
---
> for (off_type i = 0; i < size; ++i) {
> stringstream namestr;
> namestr << base;
487,491c414,418
< Counter low = i * bucket_size + min;
< Counter high = ::min(low + bucket_size, max);
< namestr << low;
< if (low < high)
< namestr << "-" << high;
---
> Counter low = i * bucket_size + min;
> Counter high = ::min(low + bucket_size, max);
> namestr << low;
> if (low < high)
> namestr << "-" << high;
493,532c420,423
< print.name = namestr.str();
< print.value = data.cvec[i];
< if (total) {
< print.pdf = data.cvec[i] / total;
< print.cdf += print.pdf;
< }
< print(stream);
< }
< } else {
< Counter _min;
< Result _pdf;
< Result _cdf = 0.0;
<
< print.flags = flags | __substat;
<
< for (off_type i = 0; i < size; ++i) {
< if ((flags & nozero && data.cvec[i] == 0.0) ||
< (flags & nonan && isnan(data.cvec[i])))
< continue;
<
< _min = i * bucket_size + min;
< _pdf = data.cvec[i] / total * 100.0;
< _cdf += _pdf;
<
<
< print.name = ValueToString(_min, 0, compat);
< print.value = data.cvec[i];
< print.pdf = (flags & pdf) ? _pdf : NAN;
< print.cdf = (flags & cdf) ? _cdf : NAN;
< print(stream);
< }
<
< print.flags = flags;
< }
<
< if (!compat || data.overflow > 0.0) {
< print.name = base + "overflows";
< print.value = data.overflow;
< if (!compat && total) {
< print.pdf = data.overflow / total;
---
> print.name = namestr.str();
> print.value = data.cvec[i];
> if (total) {
> print.pdf = data.cvec[i] / total;
534,536d424
< } else {
< print.pdf = NAN;
< print.cdf = NAN;
540a429,439
> print.name = base + "overflows";
> print.value = data.overflow;
> if (total) {
> print.pdf = data.overflow / total;
> print.cdf += print.pdf;
> } else {
> print.pdf = NAN;
> print.cdf = NAN;
> }
> print(stream);
>
544,548c443,445
< if (!compat) {
< print.name = base + "total";
< print.value = total;
< print(stream);
< }
---
> print.name = base + "total";
> print.value = total;
> print(stream);
554,557c451,453
< if (!compat && data.samples != 0) {
< print.name = base + "mean";
< print.value = data.sum / data.samples;
< print(stream);
---
> print.name = base + "mean";
> print.value = data.sum / data.samples;
> print(stream);
559,565c455,457
< print.name = base + "stdev";
< print.value = stdev;
< print(stream);
< }
<
< if (compat)
< ccprintf(stream, "%send_dist\n\n", base);
---
> print.name = base + "stdev";
> print.value = stdev;
> print(stream);
579d470
< print.compat = compat;
600d490
< print.compat = compat;
638d527
< print.compat = compat;
711c600
< initText(const string &filename, bool desc, bool compat)
---
> initText(const string &filename, bool desc)
723d611
< text.compat = compat;