feisty meow concerns codebase  2.140
mathematics::int_averager Class Reference

keeps an average on a stream of integers. More...

#include <averager.h>

Inheritance diagram for mathematics::int_averager:
Collaboration diagram for mathematics::int_averager:

Public Member Functions

 int_averager (int entries=100, bool compacting=true)
 
- Public Member Functions inherited from mathematics::averager< int >
 averager (int entries=100, bool compacting=true)
 creates an averager whose list length is restricted to "entries". More...
 
void add (int value, int count=1)
 adds a new "value" to the averager, with an optional "count". More...
 
int average () const
 reports the overall average of the whole list. More...
 
int average (int start, int end) const
 reports the average over the range from "start" to "end" inclusive. More...
 
int samples () const
 returns the total number of samples recorded in the average. More...
 
int length () const
 returns the current length of the averages list. More...
 
weighted_entry get (int index) const
 accesses the entry stored at the "index" specified. More...
 
void compact ()
 chops off the oldest portion of the averager. More...
 
void check_for_compaction ()
 checks whether the averager needs to be compacted yet or not. More...
 

Detailed Description

keeps an average on a stream of integers.

Definition at line 88 of file averager.h.

Constructor & Destructor Documentation

◆ int_averager()

mathematics::int_averager::int_averager ( int  entries = 100,
bool  compacting = true 
)
inline

Definition at line 91 of file averager.h.


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