OpenLB 1.7
|
Simple circular buffer to compute average and other quantities over pre-defined temporal windows. More...
#include <benchmarkUtil.h>
Public Member Functions | |
CircularBuffer (int size) | |
void | insert (T entry) |
insert a new entry ed eventually erases the oldest one | |
T | average () |
average over all the entries | |
T & | get (int pos) |
get reference to the last entry for pos=0, the second-to-last for pos=1, and so on | |
int | getSize () |
return size of the buffer | |
Simple circular buffer to compute average and other quantities over pre-defined temporal windows.
Works with every T supporting += (T or scalar), and /= (scalar) operations, including double and Vector<double, size>.
Definition at line 158 of file benchmarkUtil.h.
olb::util::CircularBuffer< T >::CircularBuffer | ( | int | size | ) |
Definition at line 328 of file benchmarkUtil.hh.
T olb::util::CircularBuffer< T >::average | ( | ) |
average over all the entries
Definition at line 342 of file benchmarkUtil.hh.
T & olb::util::CircularBuffer< T >::get | ( | int | pos | ) |
get reference to the last entry for pos=0, the second-to-last for pos=1, and so on
Definition at line 353 of file benchmarkUtil.hh.
int olb::util::CircularBuffer< T >::getSize | ( | ) |
return size of the buffer
Definition at line 367 of file benchmarkUtil.hh.
void olb::util::CircularBuffer< T >::insert | ( | T | entry | ) |
insert a new entry ed eventually erases the oldest one
Definition at line 333 of file benchmarkUtil.hh.