Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgHistogram< VALUE, COUNT > Class Template Reference

#include <SgStatistics.h>

List of all members.


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 612 of file SgStatistics.h.

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


Member Typedef Documentation

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

Definition at line 653 of file SgStatistics.h.


Constructor & Destructor Documentation

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

Definition at line 669 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 675 of file SgStatistics.h.

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


Member Function Documentation

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

Definition at line 681 of file SgStatistics.h.

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

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

Definition at line 693 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::m_bins.

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

Definition at line 699 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::m_array, and SgHistogram< VALUE, COUNT >::m_count.

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

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

Get count in a certain bin.

Definition at line 714 of file SgStatistics.h.

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

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

Definition at line 708 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::m_count.

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

Reinitialize and clear histogram.

Definition at line 722 of file SgStatistics.h.

References SgHistogram< VALUE, COUNT >::Clear(), SgHistogram< VALUE, COUNT >::m_array, SgHistogram< VALUE, COUNT >::m_bins, SgHistogram< VALUE, COUNT >::m_binSize, SgHistogram< VALUE, COUNT >::m_max, and SgHistogram< VALUE, COUNT >::m_min.

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

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 733 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 741 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]

Definition at line 665 of file SgStatistics.h.

Referenced by SgHistogram< VALUE, COUNT >::Add(), SgHistogram< VALUE, COUNT >::Clear(), SgHistogram< VALUE, COUNT >::Count(), SgHistogram< VALUE, COUNT >::Init(), SgHistogram< VALUE, COUNT >::Write(), and SgHistogram< VALUE, COUNT >::WriteWithLabels().

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

Definition at line 655 of file SgStatistics.h.

Referenced by SgHistogram< VALUE, COUNT >::Add(), SgHistogram< VALUE, COUNT >::Bins(), SgHistogram< VALUE, COUNT >::Count(), SgHistogram< VALUE, COUNT >::Init(), SgHistogram< VALUE, COUNT >::Write(), and SgHistogram< VALUE, COUNT >::WriteWithLabels().

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

Definition at line 659 of file SgStatistics.h.

Referenced by SgHistogram< VALUE, COUNT >::Add(), SgHistogram< VALUE, COUNT >::Init(), SgHistogram< VALUE, COUNT >::Write(), and SgHistogram< VALUE, COUNT >::WriteWithLabels().

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

Definition at line 657 of file SgStatistics.h.

Referenced by SgHistogram< VALUE, COUNT >::Add(), SgHistogram< VALUE, COUNT >::Clear(), and SgHistogram< VALUE, COUNT >::Count().

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

Definition at line 663 of file SgStatistics.h.

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

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

Definition at line 661 of file SgStatistics.h.

Referenced by SgHistogram< VALUE, COUNT >::Add(), SgHistogram< VALUE, COUNT >::Init(), SgHistogram< VALUE, COUNT >::Write(), and SgHistogram< VALUE, COUNT >::WriteWithLabels().


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


17 Jun 2010 Doxygen 1.4.7