|
Boost Users : |
Subject: Re: [Boost-users] Accumulators: Using data vector from Interprocess
From: Eric Niebler (eric_at_[hidden])
Date: 2008-12-23 13:14:00
John Phillips wrote:
> 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.
>>
> 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.
Correct, thanks John.
> 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.
Also correct. 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:
http://lists.boost.org/Archives/boost/2007/07/124979.php
HTH,
-- Eric Niebler BoostPro Computing http://www.boostpro.com
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