gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
Stats::AvgSampleStor Class Reference

Templatized storage for distribution that calculates per tick mean and variance. More...

#include <statistics.hh>

Classes

struct  Params
 

Public Member Functions

 AvgSampleStor (Info *info)
 Create and initialize this storage. More...
 
void sample (Counter val, int number)
 Add a value to the distribution for the given number of times. More...
 
size_type size () const
 Return the number of entries, in this case 1. More...
 
bool zero () const
 Return true if no samples have been added. More...
 
void prepare (Info *info, DistData &data)
 
void reset (Info *info)
 Reset stat value to default. More...
 

Private Attributes

Counter sum
 Current total. More...
 
Counter squares
 Current sum of squares. More...
 

Detailed Description

Templatized storage for distribution that calculates per tick mean and variance.

Definition at line 1744 of file statistics.hh.

Constructor & Destructor Documentation

Stats::AvgSampleStor::AvgSampleStor ( Info info)
inline

Create and initialize this storage.

Definition at line 1762 of file statistics.hh.

Member Function Documentation

void Stats::AvgSampleStor::prepare ( Info info,
DistData data 
)
inline
void Stats::AvgSampleStor::reset ( Info info)
inline

Reset stat value to default.

Definition at line 1808 of file statistics.hh.

References squares, and sum.

void Stats::AvgSampleStor::sample ( Counter  val,
int  number 
)
inline

Add a value to the distribution for the given number of times.

Update the running sum and sum of squares.

Parameters
valThe value to add.
numberThe number of times to add the value.

Definition at line 1773 of file statistics.hh.

References squares, and sum.

size_type Stats::AvgSampleStor::size ( ) const
inline

Return the number of entries, in this case 1.

Returns
1.

Definition at line 1784 of file statistics.hh.

bool Stats::AvgSampleStor::zero ( ) const
inline

Return true if no samples have been added.

Returns
True if the sum is zero.

Definition at line 1790 of file statistics.hh.

References sum.

Member Data Documentation

Counter Stats::AvgSampleStor::squares
private

Current sum of squares.

Definition at line 1756 of file statistics.hh.

Referenced by prepare(), reset(), and sample().

Counter Stats::AvgSampleStor::sum
private

Current total.

Definition at line 1754 of file statistics.hh.

Referenced by prepare(), reset(), sample(), and zero().


The documentation for this class was generated from the following file:

Generated on Fri Jun 9 2017 13:04:39 for gem5 by doxygen 1.8.6