This commit is contained in:
badaix 2015-09-12 19:26:08 +02:00
parent a221e431aa
commit 87ce37df8c
5 changed files with 11 additions and 80 deletions

View file

@ -22,6 +22,12 @@
#include<deque>
#include<algorithm>
/// Size limited queue
/**
* Size limited queue with basic statistic functions:
* median, mean, percentile
*/
template <class T>
class DoubleBuffer
{
@ -37,6 +43,7 @@ public:
buffer.pop_front();
}
/// Median as mean over N values around the median
T median(unsigned int mean = 1) const
{
if (buffer.empty())