Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Types | Private Attributes

SgHistogram< VALUE, COUNT > Class Template Reference

Histogram. More...

#include <SgStatistics.h>

List of all members.

Public Member Functions

 SgHistogram ()
 SgHistogram (VALUE min, VALUE max, int bins)
void Init (VALUE min, VALUE max, int bins)
 Reinitialize and clear histogram.
void Add (VALUE value)
void Clear ()
int Bins () const
COUNT Count () const
COUNT Count (int i) const
 Get count in a certain bin.
void Write (std::ostream &out) const
 Write as x,y-table.
void WriteWithLabels (std::ostream &out, const std::string &label) const
 Write with labels.

Private Types

typedef std::vector< COUNT > Vector

Private Attributes

int m_bins
COUNT m_count
VALUE m_binSize
VALUE m_min
VALUE m_max
Vector m_array

Detailed Description

template<typename VALUE, typename COUNT>
class SgHistogram< VALUE, COUNT >

Histogram.

The template parameters are the floating point type and the counter type, depending on the precision-memory tradeoff.

Definition at line 597 of file SgStatistics.h.


Member Typedef Documentation

template<typename VALUE , typename COUNT >
typedef std::vector<COUNT> SgHistogram< VALUE, COUNT >::Vector [private]

Definition at line 636 of file SgStatistics.h.


Constructor & Destructor Documentation

template<typename VALUE , typename COUNT >
SgHistogram< VALUE, COUNT >::SgHistogram (  ) 

Definition at line 652 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::Init().

template<typename VALUE , typename COUNT >
SgHistogram< VALUE, COUNT >::SgHistogram ( VALUE  min,
VALUE  max,
int  bins 
)

Definition at line 658 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::Init().


Member Function Documentation

template<typename VALUE , typename COUNT >
void SgHistogram< VALUE, COUNT >::Add ( VALUE  value  ) 
template<typename VALUE , typename COUNT >
int SgHistogram< VALUE, COUNT >::Bins (  )  const

Definition at line 676 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::m_bins.

template<typename VALUE , typename COUNT >
void SgHistogram< VALUE, COUNT >::Clear (  ) 
template<typename VALUE , typename COUNT >
COUNT SgHistogram< VALUE, COUNT >::Count (  )  const

Definition at line 691 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::m_count.

template<typename VALUE , typename COUNT >
COUNT SgHistogram< VALUE, COUNT >::Count ( int  i  )  const

Get count in a certain bin.

Definition at line 697 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::m_array, SgHistogram< VALUE, COUNT >::m_bins, and SG_ASSERT.

template<typename VALUE , typename COUNT >
void SgHistogram< VALUE, COUNT >::Init ( VALUE  min,
VALUE  max,
int  bins 
)
template<typename VALUE , typename COUNT >
void SgHistogram< VALUE, COUNT >::Write ( std::ostream &  out  )  const

Write as x,y-table.

Writes the historgram in a format that likely can be used by other programs. Writes one x,y pair per line. The separator is TAB. The x-values are the left border values of the bins, the y-values are the counts of the bins.

Definition at line 716 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::m_array, SgHistogram< VALUE, COUNT >::m_bins, SgHistogram< VALUE, COUNT >::m_binSize, and SgHistogram< VALUE, COUNT >::m_min.

template<typename VALUE , typename COUNT >
void SgHistogram< VALUE, COUNT >::WriteWithLabels ( std::ostream &  out,
const std::string &  label 
) const

Write with labels.

Example output with label "Value", the numbers in brackets are the left border of each bin:

        Value[0]  100
        Value[10] 2000
        Value[20] 500
        

Definition at line 724 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::m_array, SgHistogram< VALUE, COUNT >::m_bins, SgHistogram< VALUE, COUNT >::m_binSize, and SgHistogram< VALUE, COUNT >::m_min.


Member Data Documentation

template<typename VALUE , typename COUNT >
Vector SgHistogram< VALUE, COUNT >::m_array [private]
template<typename VALUE , typename COUNT >
int SgHistogram< VALUE, COUNT >::m_bins [private]
template<typename VALUE , typename COUNT >
VALUE SgHistogram< VALUE, COUNT >::m_binSize [private]
template<typename VALUE , typename COUNT >
COUNT SgHistogram< VALUE, COUNT >::m_count [private]
template<typename VALUE , typename COUNT >
VALUE SgHistogram< VALUE, COUNT >::m_max [private]

Definition at line 646 of file SgStatistics.h.

Referenced by SgHistogram< VALUE, COUNT >::Init().

template<typename VALUE , typename COUNT >
VALUE SgHistogram< VALUE, COUNT >::m_min [private]

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


Sun Mar 13 2011 Doxygen 1.7.1