#include <SgStatistics.h>
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 |
| SgStatistics< VALUE, COUNT >::SgStatistics | ( | ) |
| 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.
| 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().
| 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().
| 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().
| 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().
| 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().
| 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.
| 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().
| 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.
| VALUE SgStatistics< VALUE, COUNT >::Variance | ( | ) | const |
| 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().
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().
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().