31 #if defined(__APPLE__)
32 #define _GLIBCPP_USE_C99 1
88 : mystream(false), stream(NULL), descriptions(false)
93 : mystream(false), stream(NULL), descriptions(false)
99 : mystream(false), stream(NULL), descriptions(false)
117 panic(
"stream already set!");
122 fatal(
"Unable to open output stream for writing\n");
129 panic(
"stream already set!");
132 stream =
new ofstream(file.c_str(), ios::trunc);
134 fatal(
"Unable to open statistics file for writing\n");
146 ccprintf(*
stream,
"\n---------- Begin Simulation Statistics ----------\n");
152 ccprintf(*
stream,
"\n---------- End Simulation Statistics ----------\n");
173 if (!std::isnan(value)) {
175 val.precision(precision);
176 else if (value == rint(value))
179 val.unsetf(ios::showpoint);
180 val.setf(ios::fixed);
201 void operator()(ostream &stream,
bool oneLine =
false)
const;
221 stringstream pdfstr, cdfstr;
223 if (!std::isnan(
pdf))
226 if (!std::isnan(
cdf))
230 ccprintf(stream,
" |%12s %10s %10s",
281 print.
pdf = _total ? 0.0 :
NAN;
282 print.
cdf = _total ? 0.0 :
NAN;
291 print.
name = base + (havesub ?
subnames[0] : std::to_string(0));
326 print.
name = base +
"total";
394 print.
name = base +
"bucket_size";
398 print.
name = base +
"min_bucket";
402 print.
name = base +
"max_bucket";
407 print.
name = base +
"samples";
411 print.
name = base +
"mean";
416 print.
name = base +
"gmean";
425 print.
name = base +
"stdev";
448 print.
name = base +
"underflows";
458 stringstream namestr;
465 namestr <<
"-" << high;
467 print.
name = namestr.str();
481 print.
name = base +
"overflows";
490 print.
name = base +
"min_value";
496 print.
name = base +
"max_value";
501 print.
name = base +
"total";
571 bool havesub =
false;
604 yvec[
j] = info.
cvec[iy +
j];
605 tot_vec[
j] += yvec[
j];
610 (havesub ? info.
subnames[
i] : std::to_string(
i));
619 total_subname.push_back(
"total");
712 print.
name = base +
"samples";
716 MCounter::const_iterator it;
718 stringstream namestr;
721 namestr <<(*it).first;
722 print.
name = namestr.str();
723 print.
value = (*it).second;
742 static bool connected =
false;
void ccprintf(cp::Print &print)
double Result
All results are doubles.
const FlagsType pdf
Print the percent of the total that this entry represents.
std::ostream * stream() const
Get the output underlying output stream.
std::string name
The name of the stat.
std::vector< std::string > subdescs
std::vector< std::string > subdescs
static std::string separatorString
The separator string used for vectors, dist, etc.
virtual bool zero() const =0
const FlagsType nonan
Don't print if this is NAN.
virtual size_type size() const =0
void init(const Text *text, const Info &info)
void operator()(ostream &stream) const
virtual Result total() const =0
std::vector< std::string > subnames
Names and descriptions of subfields.
list< Info * > & statsList()
SparseHistPrint(const Text *text, const SparseHistInfo &info)
void operator()(ostream &stream) const
void open(std::ostream &stream)
std::vector< std::string > y_subnames
virtual Result result() const =0
std::vector< std::string > subnames
Names and descriptions of subfields.
virtual bool valid() const
double Counter
All counters are of 64-bit values.
void operator()(ostream &stream, bool oneLine=false) const
virtual Result total() const =0
void operator()(ostream &stream) const
Data structure of sparse histogram.
const SparseHistData & data
virtual const VResult & result() const =0
VCounter cvec
Local storage for the entry values, used for printing.
const Info * prereq
A pointer to a prerequisite Stat.
void init(const Text *text, const Info &info)
Flags flags
The formatting flags.
DistPrint(const Text *text, const DistInfo &info)
vector< string > subdescs
const FlagsType oneline
Print all values on a single line.
virtual size_type size() const =0
virtual void visit(const ScalarInfo &info)
const FlagsType display
Print this stat.
#define NAN
Define Not a number.
vector< string > subnames
int precision
The display precision.
const FlagsType total
Print the total.
OutputStream * findOrCreate(const std::string &name, bool binary=false)
string ValueToString(Result value, int precision)
std::vector< Result > VResult
vector of results.
Output * initText(const string &filename, bool desc)
const FlagsType nozero
Don't print if this is zero.
const FlagsType cdf
Print the cumulative percentage of total upto this entry.
void update(Result val, Result total)
if(it_gpu==gpuTypeMap.end())
std::vector< std::string > subnames
Names and descriptions of subfields.
bool noOutput(const Info &info)
std::string desc
The description of the stat.