Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgStatistics< VALUE, COUNT > Class Template Reference

#include <SgStatistics.h>

List of all members.


Detailed Description

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

Computes mean and variance of a statistical variable.

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

Definition at line 240 of file SgStatistics.h.

Public Member Functions

 SgStatistics ()
 SgStatistics (VALUE val, COUNT count)
 Create statistics initialized with values.
void Add (VALUE val)
void Clear ()
bool IsDefined () const
const VALUE & Mean () const
const COUNT & Count () const
VALUE Deviation () const
VALUE Variance () const
void Write (std::ostream &out) const
 Write in human readable format.
void SaveAsText (std::ostream &out) const
 Save in a compact platform-independent text format.
void LoadFromText (std::istream &in)
 Load from text format.

Private Attributes

SgStatisticsBase< VALUE, COUNT > m_statisticsBase
VALUE m_variance


Constructor & Destructor Documentation

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

Definition at line 285 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::Clear().

template<typename VALUE, typename COUNT>
SgStatistics< VALUE, COUNT >::SgStatistics ( VALUE  val,
COUNT  count 
)

Create statistics initialized with values.

Equivalent to creating a statistics and calling count times Add(val)

Definition at line 291 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::m_variance.


Member Function Documentation

template<typename VALUE, typename COUNT>
void SgStatistics< VALUE, COUNT >::Add ( VALUE  val  ) 

Definition at line 298 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::Count(), SgStatistics< VALUE, COUNT >::IsDefined(), SgStatistics< VALUE, COUNT >::m_statisticsBase, SgStatistics< VALUE, COUNT >::m_variance, and SgStatistics< VALUE, COUNT >::Mean().

Referenced by SgUctSearch::UpdateStatistics().

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

Definition at line 318 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::m_statisticsBase, and SgStatistics< VALUE, COUNT >::m_variance.

Referenced by SgUctSearchStat::Clear(), and SgStatistics< VALUE, COUNT >::SgStatistics().

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

Definition at line 325 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::m_statisticsBase.

Referenced by SgStatistics< VALUE, COUNT >::Add().

template<typename VALUE, typename COUNT>
VALUE SgStatistics< VALUE, COUNT >::Deviation (  )  const

Definition at line 331 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::m_variance.

Referenced by SgStatistics< VALUE, COUNT >::Write().

template<typename VALUE, typename COUNT>
bool SgStatistics< VALUE, COUNT >::IsDefined (  )  const

Definition at line 337 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::m_statisticsBase.

Referenced by SgStatistics< VALUE, COUNT >::Add(), and SgStatistics< VALUE, COUNT >::Write().

template<typename VALUE, typename COUNT>
void SgStatistics< VALUE, COUNT >::LoadFromText ( std::istream &  in  ) 

Load from text format.

See SaveAsText()

Definition at line 343 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::m_statisticsBase, and SgStatistics< VALUE, COUNT >::m_variance.

template<typename VALUE, typename COUNT>
const VALUE & SgStatistics< VALUE, COUNT >::Mean (  )  const

Definition at line 350 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::m_statisticsBase.

Referenced by SgStatistics< VALUE, COUNT >::Add(), SgUctSearchStat::Write(), and SgStatistics< VALUE, COUNT >::Write().

template<typename VALUE, typename COUNT>
void SgStatistics< VALUE, COUNT >::SaveAsText ( std::ostream &  out  )  const

Save in a compact platform-independent text format.

The data is written in a single line, without trailing newline.

Definition at line 371 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::m_statisticsBase, and SgStatistics< VALUE, COUNT >::m_variance.

template<typename VALUE, typename COUNT>
VALUE SgStatistics< VALUE, COUNT >::Variance (  )  const

Definition at line 356 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::m_variance.

template<typename VALUE, typename COUNT>
void SgStatistics< VALUE, COUNT >::Write ( std::ostream &  out  )  const

Write in human readable format.

Definition at line 362 of file SgStatistics.h.

References SgStatistics< VALUE, COUNT >::Deviation(), SgStatistics< VALUE, COUNT >::IsDefined(), and SgStatistics< VALUE, COUNT >::Mean().


Member Data Documentation

template<typename VALUE, typename COUNT>
SgStatisticsBase<VALUE,COUNT> SgStatistics< VALUE, COUNT >::m_statisticsBase [private]

Definition at line 279 of file SgStatistics.h.

Referenced by SgStatistics< VALUE, COUNT >::Add(), SgStatistics< VALUE, COUNT >::Clear(), SgStatistics< VALUE, COUNT >::Count(), SgStatistics< VALUE, COUNT >::IsDefined(), SgStatistics< VALUE, COUNT >::LoadFromText(), SgStatistics< VALUE, COUNT >::Mean(), and SgStatistics< VALUE, COUNT >::SaveAsText().

template<typename VALUE, typename COUNT>
VALUE SgStatistics< VALUE, COUNT >::m_variance [private]

Definition at line 281 of file SgStatistics.h.

Referenced by SgStatistics< VALUE, COUNT >::Add(), SgStatistics< VALUE, COUNT >::Clear(), SgStatistics< VALUE, COUNT >::Deviation(), SgStatistics< VALUE, COUNT >::LoadFromText(), SgStatistics< VALUE, COUNT >::SaveAsText(), SgStatistics< VALUE, COUNT >::SgStatistics(), and SgStatistics< VALUE, COUNT >::Variance().


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


17 Jun 2010 Doxygen 1.4.7