|
Boost Users : |
Subject: Re: [Boost-users] Accumulators: Using data vector from Interprocess
From: John Phillips (phillips_at_[hidden])
Date: 2008-12-23 11:34:32
dhruva wrote:
> Hi,
> I have large data to be processed hence planning to use memory mapped
> file backed vector from boost::interprocess. Could I use this vector
> directly in accumulators and perform computations on data in the
> boost::interprocess container without having to copy it all into the
> contain in accumulator_set?
>
> Also, is there a way to remove an entry once I add it to an
> accumulator_set? I want to emulate a sliding window calculation. Ex:
> If my window size is 100, when I add the 101st entry, I want to remove
> the 1st entry so that the size is always 100.
>
> -dhruva
>
You can use an accumulator with any container that allows you to walk
through the contained values, so it will work with this one. Most
accumulators don't store any of the data points, and the ones that do
store any, don't store all. So, in general you will not be making a copy
of all the data.
For the moving average on a widow, the accumulators library doesn't
currently include an accumulator that does this so a custom accumulator
has to be defined. However, you might look in the sandbox and see if one
is there. I don't recall who did it, but I remember a discussion about
making one of these in the past. I think there is an available version
somewhere.
John
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net