Anasazi Version of the Day
Public Member Functions | Static Public Member Functions
TSQR::TimeStats Class Reference

Collect running statistics. More...

#include <Tsqr_TimeStats.hpp>

List of all members.

Public Member Functions

void init ()
void update (const double curTime)
void print (std::ostream &out, const bool humanReadable, const std::string &label, const std::string &labelLabel, const bool printHeaders) const
double min () const
double max () const
double mean () const
double total () const
int count () const

Static Public Member Functions

static TimeStats globalTimeStats (MessengerBase< double > *const comm, const TimeStats &localStats)

Detailed Description

Collect running statistics.

TimeStats collects running statistics on a particular timing, which is collected count() times. When you get a new timing, call update().

Definition at line 23 of file Tsqr_TimeStats.hpp.


Member Function Documentation

void TSQR::TimeStats::init ( )

Reset the statistics

Definition at line 13 of file Tsqr_TimeStats.cpp.

void TSQR::TimeStats::update ( const double  curTime)

Add a new data point and update the running statistics

Definition at line 22 of file Tsqr_TimeStats.cpp.

void TSQR::TimeStats::print ( std::ostream &  out,
const bool  humanReadable,
const std::string &  label,
const std::string &  labelLabel,
const bool  printHeaders 
) const

Print to out

Parameters:
out[in/out] Output stream to which to print
humanReadable[in] Whether to print in a format easy for humans to read, or easy for automatic parsing
label[in] If not humanReadable, then print this string as a row identifier at the beginning of the row
labelLabel[in] If not humanReadable, then use this as the column header for the "label" (first) column
printHeaders[in] If not humanReadable, then print column headers, preceded by a "%" so that the parser will ignore the line

Definition at line 39 of file Tsqr_TimeStats.cpp.

double TSQR::TimeStats::min ( ) const [inline]

Minimum value seen thus far (+Inf if no data has been collected)

Definition at line 57 of file Tsqr_TimeStats.hpp.

double TSQR::TimeStats::max ( ) const [inline]

Maximum value seen thus far (-Inf if no data has been collected)

Definition at line 61 of file Tsqr_TimeStats.hpp.

double TSQR::TimeStats::mean ( ) const [inline]

Arithmetic mean thus far (0 if no data has been collected)

Definition at line 65 of file Tsqr_TimeStats.hpp.

double TSQR::TimeStats::total ( ) const [inline]

Total thus far (0 if no data has been collected)

Definition at line 69 of file Tsqr_TimeStats.hpp.

int TSQR::TimeStats::count ( ) const [inline]

Count of data points collected thus far

Definition at line 73 of file Tsqr_TimeStats.hpp.

TimeStats TSQR::TimeStats::globalTimeStats ( MessengerBase< double > *const  comm,
const TimeStats localStats 
) [static]

Produce global time statistics out of all the local ones.

Definition at line 90 of file Tsqr_TimeStats.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends