|
Boost : |
From: Eric Niebler (eric_at_[hidden])
Date: 2007-07-31 12:25:42
Hugo Duncan wrote:
>> I think what you want is a piecewise constant series of (value, offset,
>> end offset) tuples like this:
>>
>> (42, 0, 9)
>> (43, 9, 21)
>> (44, 21, 30)
>> ...
>
> yes, that is what I am after. Two observations:
>
> One inconvenience of this is that I assume it will always be necessary to
> have the next sample before inserting the current sample (so the end of
> the run can be specified), though this is not clear to me from the
> documentation (do I call inserter(42,0) or inserter(42,0,9)?).
The documentation is pretty explicit about this. inserter(42,0) inserts
a 42 at offset 0 and only at offset 0. See the section "Populating a
Series": http://tinyurl.com/gbg8u
> And as an inefficiency, each timestamp gets stored twice (again, if I
> understand correctly).
That is true. It might be useful to define a series type where the end
of one run is implicitly the beginning of another. Such a series would
easily fit within the framework. Any ideas what such a thing might be
called?
For the purposes of genericity, the inserter would still need to accept
runs in (value, offset, end offset) tuples, though.
-- Eric Niebler Boost Consulting www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk