On Sun, Nov 12, 2017 at 9:44 AM, Henning Thielemann <email obscured>> wrote: > It does the binary search for you. Summing two curves and doing the merge > would be a nice addition, though. Oh ok, I'll take a closer look at the source. I thought the underlying representation was a list, but it's hard to tell how anything works with no documentation. It seems like arbitrary math operations might be tricky though. All you need to resample the signals to have the same breakpoints is a split for the curve, but what about multiplication, or max, or some more ad-hoc function? I guess constant samples work with anything, linear ones only work for linear functions (so multiplication yes, but something like max or an ad-hoc function requires an ad-hoc solution), and curves... maybe you wind up having to just sample them. But that means that a fancy curve representation could degenerate to flat samples as soon as the "wrong kind" of transformation is applied, which in practice might mean just about always. Of course linear has the same kind of problem, but maybe it's easier to come up with the ad-hoc solution (e.g. for max, find where they cross and splice there). For instance, long ago I actually originally used the linear segments representation, but even that gets hard for integration, while for flat samples it's trivial. Now that I think of it, I think that's one of the reasons I gave up on linear segments way back when. I guess you can find where curves cross in exactly the same way as lines, but somehow it seems like it might be more complicated. I'll try sketching out all of the operations I'll need.