SST  6.1.0
StructuralSimulationToolkit
SST::Statistics::Histogram< HistoBinType, HistoCountType > Class Template Reference

Holder of data grouped into pre-determined width bins.
More...

#include <histo.h>

Inheritance diagram for SST::Statistics::Histogram< HistoBinType, HistoCountType >:
SST::Statistics::BaseStatistic

Public Types

typedef std::map< HistoBinType, HistoCountType >::iterator histo_itr
 Iterator over the histogram bins.
 

Public Member Functions

 Histogram (const std::string name, HistoBinType binW)
 Creates a new bin with a specific bin width. More...
 
 Histogram (const char *name, HistoBinType binW)
 Creates a new bin with a specific bin width. More...
 
void add (HistoBinType value)
 Adds a new value to the histogram. More...
 
HistoCountType getBinCount ()
 Count how many bins are active in this histogram.
 
HistoBinType getBinWidth ()
 Get the width of a bin in this histogram.
 
HistoCountType getBinCountByBinStart (HistoBinType v)
 Get the count of items in the bin by the start value (e.g. More...
 
HistoBinType getBinStart ()
 Get the smallest start value of a bin in this histogram (i.e. More...
 
HistoBinType getBinEnd ()
 Get the largest possible value represented by this histogram (i.e. More...
 
HistoCountType getItemCount ()
 Get the total number of items contained in all bins. More...
 
HistoBinType getValuesSummed ()
 Sum up every item presented for storage in the histogram. More...
 
- Public Member Functions inherited from SST::Statistics::BaseStatistic
 BaseStatistic (std::string statName)
 Constructor for the BaseStatistics class. More...
 
 BaseStatistic (char *statName)
 Constructor for the BaseStatistic class. More...
 
const char * getName ()
 Get the name of the statistic. More...
 
void enable ()
 Enable the statistic for collection.
 
void disable ()
 Disable the statistic collection.
 
bool isEnabled ()
 Query whether the statistic is currently enabled. More...
 

Additional Inherited Members

- Protected Attributes inherited from SST::Statistics::BaseStatistic
char * name
 
bool enabled
 

Detailed Description

template<class HistoBinType, class HistoCountType>
class SST::Statistics::Histogram< HistoBinType, HistoCountType >

Holder of data grouped into pre-determined width bins.
Template Parameters
HistoBinTypeis the type of the data held in each bin (i.e. what data type described the width of the bin)
HistoCountTypeis the count type of data held in each bin (i.e. what data type counts the number of items held in the bin itself)

Constructor & Destructor Documentation

template<class HistoBinType , class HistoCountType >
SST::Statistics::Histogram< HistoBinType, HistoCountType >::Histogram ( const std::string  name,
HistoBinType  binW 
)
inline

Creates a new bin with a specific bin width.

Parameters
binWThe width of the bin
template<class HistoBinType , class HistoCountType >
SST::Statistics::Histogram< HistoBinType, HistoCountType >::Histogram ( const char *  name,
HistoBinType  binW 
)
inline

Creates a new bin with a specific bin width.

Parameters

Member Function Documentation

template<class HistoBinType , class HistoCountType >
void SST::Statistics::Histogram< HistoBinType, HistoCountType >::add ( HistoBinType  value)
inline

Adds a new value to the histogram.

The correct bin is identified and then incremented. If no bin can be found to hold the value then a new bin is created.

template<class HistoBinType , class HistoCountType >
HistoCountType SST::Statistics::Histogram< HistoBinType, HistoCountType >::getBinCountByBinStart ( HistoBinType  v)
inline

Get the count of items in the bin by the start value (e.g.

give me the count of items in the bin which begins at value X).

Returns
The count of items in the bin else 0.
template<class HistoBinType , class HistoCountType >
HistoBinType SST::Statistics::Histogram< HistoBinType, HistoCountType >::getBinEnd ( )
inline

Get the largest possible value represented by this histogram (i.e.

the highest value in any of items bins rounded above to the size of the bin)

template<class HistoBinType , class HistoCountType >
HistoBinType SST::Statistics::Histogram< HistoBinType, HistoCountType >::getBinStart ( )
inline

Get the smallest start value of a bin in this histogram (i.e.

the minimum value possibly represented by this histogram)

template<class HistoBinType , class HistoCountType >
HistoCountType SST::Statistics::Histogram< HistoBinType, HistoCountType >::getItemCount ( )
inline

Get the total number of items contained in all bins.

Returns
The number of items contained in all bins
template<class HistoBinType , class HistoCountType >
HistoBinType SST::Statistics::Histogram< HistoBinType, HistoCountType >::getValuesSummed ( )
inline

Sum up every item presented for storage in the histogram.

Returns
The sum of all values added into the histogram

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