Main Page · Modules · All Classes · Class Hierarchy |
Sample cache class. More...
#include <MCSamples.hpp>
Public Member Functions | |
MCSamples (int size, MCSampleStatistic< T > &statistic) | |
Class constructor. More... | |
MCSamples (const MCSamples &other) | |
Class copy constructor. More... | |
virtual | ~MCSamples () |
Class destructor. | |
int | GetSize () const |
Get the size of the sample cache. More... | |
bool | IsEmpty () const |
Check if the sample cache is empty. More... | |
bool | IsValid () const |
Check if the sample cache is valid for calculations. More... | |
int | GetSampleCount () const |
Get the sample count in the cache. More... | |
void | AddStatistic (MCSampleStatistic< T > &statistic) |
Add a statistic calculation. More... | |
MCSampleStatistic< T > & | GetDefaultStatistic () |
Get the default (first) statistic. More... | |
MCSampleStatistic< T > * | GetStatistic (const std::string &statistic_name) |
Get a statistic by name. More... | |
void | RemoveStatistic (MCSampleStatistic< T > &statistic) |
Remove a statistic calculation. More... | |
void | Reset () |
Get the size of the sample cache. More... | |
void | ClearStatistics () |
Clear the statistics of the sample cache. | |
template<typename U > | |
void | AddValues (const U &container) |
Put a whole container into the cache. More... | |
MCSamples< T > & | operator= (const MCSamples< T > &other) |
Copy assignment operator. More... | |
bool | operator== (const MCSamples< T > &other) const |
Equality (==) operator. More... | |
bool | operator!= (const MCSamples< T > &other) const |
Inequality (!=) operator. More... | |
MCSamples< T > & | operator<< (const T value) |
Bitwise left shift (<<) operator. More... | |
MCSamples< T > & | operator<< (const std::vector< T > &container) |
Bitwise left shift (<<) operator. More... | |
MCSamples< T > & | operator<< (const std::pair< const T, float > &value) |
Bitwise left shift (<<) operator. More... | |
const MCSamples< T > | operator+ (const T value) const |
Increment (+) operator. More... | |
const MCSamples< T > | operator+ (const std::pair< const T, float > &value) const |
Increment (+) operator. More... | |
MCSamples< T > & | operator+= (const T value) |
Addition assignment (+=) operator. More... | |
MCSamples< T > & | operator+= (const std::vector< T > &container) |
Addition assignment (+=) operator. More... | |
MCSamples< T > & | operator+= (const std::pair< const T, float > &value) |
Addition assignment (+=) operator. More... | |
Private Attributes | |
T * | Samples |
Sample storage. | |
float * | Weights |
Weight storage. | |
int | Size |
The size of the sample cache. | |
bool | Valid |
Whenever the sample cache has been filled at least once to do calculations. | |
int | LastElementIndex |
Last element index in the cache. | |
MC::Statistic< T >::List | Statistics |
The list of the calculated statistics for the sample cache. | |
Sample cache class.
Definition at line 52 of file MCSamples.hpp.
|
inlineexplicit |
Class constructor.
size | Sample cache size |
statistic | Sample statistic |
Definition at line 63 of file MCSamples.hpp.
|
inline |
Add a statistic calculation.
statistic | New statistic for the cache |
The statistic will be owned by the sample cache and destroyed when the cache is deleted.
Definition at line 159 of file MCSamples.hpp.
|
inline |
Put a whole container into the cache.
container | Container |
Definition at line 260 of file MCSamples.hpp.
|
inline |
Get the default (first) statistic.
Definition at line 174 of file MCSamples.hpp.
|
inline |
Get the sample count in the cache.
Definition at line 136 of file MCSamples.hpp.
|
inline |
Get the size of the sample cache.
Definition at line 98 of file MCSamples.hpp.
|
inline |
Get a statistic by name.
statistic_name | Statistic name |
Definition at line 188 of file MCSamples.hpp.
|
inline |
Check if the sample cache is empty.
Definition at line 110 of file MCSamples.hpp.
|
inline |
Check if the sample cache is valid for calculations.
The cache reaches this state after it is filled.
Definition at line 124 of file MCSamples.hpp.
Inequality (!=) operator.
other | Other sample cache to be compared |
Definition at line 351 of file MCSamples.hpp.
Increment (+) operator.
value | Value |
The oldest element is dropped out of the sample cache and the new value is included.
Definition at line 420 of file MCSamples.hpp.
|
inline |
Increment (+) operator.
value | Value |
The oldest element is dropped out of the sample cache and the new value is included.
Definition at line 437 of file MCSamples.hpp.
Addition assignment (+=) operator.
value | Value |
The oldest element is dropped out of the sample cache and the new value is included.
Definition at line 454 of file MCSamples.hpp.
|
inline |
Addition assignment (+=) operator.
container | Vector container |
The oldest element is dropped out of the sample cache and the new value is included.
Definition at line 471 of file MCSamples.hpp.
|
inline |
Addition assignment (+=) operator.
value | Value |
The oldest element is dropped out of the sample cache and the new value is included.
Definition at line 493 of file MCSamples.hpp.
|
inline |
Bitwise left shift (<<) operator.
container | Vector container |
The oldest element is dropped out of the sample cache and the new value is included.
Definition at line 385 of file MCSamples.hpp.
Bitwise left shift (<<) operator.
value | Value |
The oldest element is dropped out of the sample cache and the new value is included.
Definition at line 368 of file MCSamples.hpp.
|
inline |
Bitwise left shift (<<) operator.
value | Value |
The oldest element is dropped out of the sample cache and the new value is included.
Definition at line 403 of file MCSamples.hpp.
Copy assignment operator.
other | Other sample cache to be assigned |
Definition at line 277 of file MCSamples.hpp.
Equality (==) operator.
other | Other sample cache to be compared |
Definition at line 323 of file MCSamples.hpp.
|
inline |
Remove a statistic calculation.
statistic | A statistic to be removed from the cache |
The statistic will not be owned by the cache anymore and must be deleted manually.
Definition at line 208 of file MCSamples.hpp.
|
inline |
Get the size of the sample cache.
Definition at line 227 of file MCSamples.hpp.