Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2007-07-31 18:31:34

Hugo Duncan wrote:
>> 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":
> I read this pretty carefully before, and couldn't reach a definitive
> conclusion.
> If I assumed that I could use both insert(value,start) and
> insert(value,start,stop) for piecewise_constant_series, and could insert
> runs non-contiguously (as in the examples in the section you reference),
> then I could not decide if that resulted in a piecewise_constant series
> that was densely specified between the lowest and highest inserted
> ordinals, or if it resulted in a sparsely specified series with zeros, in
> which case I had problems seeing much difference between the
> piecewise_constant and the sparse series.
> I tend to be a little obtuse when it comes to inferring semantics from
> examples. Your statement above is more explicit than the documentation
> and all is now clear :-)

OK, thanks for the feedback. I'll add an unambiguous statement to this
effect to make it perfectly clear.

>>> 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?
> piecewise_constant_dense_series? (as opposed to the current
> "piecewise_constant_sparse_series"...)

Interesting observation. Yes, or perhaps
dense_piecewise_constant_series. Thanks.

Eric Niebler
Boost Consulting
The Astoria Seminar ==>

Boost list run by bdawes at, gregod at, cpdaniel at, john at