gem5  v20.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Private Attributes | List of all members
Stats::SampleStor Class Reference

Templatized storage and interface for a distribution that calculates mean and variance. More...

#include <statistics.hh>

Classes

struct  Params
 

Public Member Functions

 SampleStor (Info *info)
 Create and initialize this storage. More...
 
void sample (Counter val, int number)
 Add a value the given number of times to this running average. More...
 
size_type size () const
 Return the number of entries in this stat, 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
 The current sum. More...
 
Counter squares
 The sum of squares. More...
 
Counter samples
 The number of samples. More...
 

Detailed Description

Templatized storage and interface for a distribution that calculates mean and variance.

Definition at line 1690 of file statistics.hh.

Constructor & Destructor Documentation

◆ SampleStor()

Stats::SampleStor::SampleStor ( Info info)
inline

Create and initialize this storage.

Definition at line 1710 of file statistics.hh.

Member Function Documentation

◆ prepare()

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

◆ reset()

void Stats::SampleStor::reset ( Info info)
inline

Reset stat value to default.

Definition at line 1757 of file statistics.hh.

◆ sample()

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

Add a value the given number of times to this running average.

Update the running sum and sum of squares, increment the number of values seen by the given number.

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

Definition at line 1722 of file statistics.hh.

◆ size()

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

Return the number of entries in this stat, 1.

Returns
1.

Definition at line 1733 of file statistics.hh.

◆ zero()

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

Return true if no samples have been added.

Returns
True if no samples have been added.

Definition at line 1739 of file statistics.hh.

Member Data Documentation

◆ samples

Counter Stats::SampleStor::samples
private

The number of samples.

Definition at line 1704 of file statistics.hh.

◆ squares

Counter Stats::SampleStor::squares
private

The sum of squares.

Definition at line 1702 of file statistics.hh.

◆ sum

Counter Stats::SampleStor::sum
private

The current sum.

Definition at line 1700 of file statistics.hh.


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

Generated on Thu May 28 2020 16:22:27 for gem5 by doxygen 1.8.13