
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": http://tinyurl.com/gbg8u
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 www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com