Hello,
The help and support on this list is unmatched by any of the paid
support you get from most companies. Thank you all for such detailed
responses.
For someone like be getting into boost, this really helps.
On Wed, Dec 24, 2008 at 12:49 AM, Eric Niebler
Eric Niebler wrote:
A moving average accumulator is an often requested feature. I knocked one together as a proof-of-concept during the accumulators review, but never polished it. You can find it in this message:
Whoops, that's a rolling average algorithm for the time series library. The implementation for the accumulators library is considerably simpler. I just knocked this together, but it seems to work.
/////////////////////////////////////////////////////////////////////////////// // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include
BOOST_PARAMETER_NESTED_KEYWORD(tag, rolling_average_window_size, window_size)
In this example, the window size is know and fixed (I agree it was
based on my requirement that I had posted in the original post).
However, my window is a time window. Something like weekly sliding
window average. Since the data collection frequency could vary in my
case, I will not be able to use a circular list. I used a deque where
I add at the end and pop off from the top till the difference between
the last time stamp (most recently added) to first time stamp is NOT
greater than the window size.
It is here that I intend to create the deque using interprocess. I
will have deque will have a pair of time stamp and value
(pair