Boost logo

Boost :

From: Hugo Duncan (hugoduncan_at_[hidden])
Date: 2007-08-01 15:11:32


>>> The resulting argument pack is passed as the constructor parameter to
>>> all the accumulators in the set. Your accumulator can then extract the
>>> coefficients argument from the pack with "args[coefficients]".
>>
>> My filter depends on the delay buffer I have defined which has the
>> cache_size constructor argument. Since I am specifying the list of
>> coefficients, I want the cache_size to be set to the number of elements
>> in
>> my coefficient list, with out having to specify it, ie without having to
>> write:
>>
>> array<double,5> coeffs={0.1,0.2,0.1};
>> accumulator_set<... > acc( .., coefficients = coeffs,
>> cache_size=5...);
>>
>
> Let me see if I understand. You want the delay buffer to use the
> cache_size parameter if it is specified, and if not, check to see if the
> coefficients parameter is specified, and if so, use the size of the
> coefficients array. This is possible.

[cut proposed solution]

Thanks Eric, that would probably work (as long as I define the
coefficients named paramter seperately from the filter or the delay).

Ideally, though, I was looking for a solution that allowed me to reuse
the delay buffer without modifying it. That way it could be used as a
lower layer for any algorithm that needed recent time history. Maybe I am
being over ambitious...


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk