Yggdrasill  0.2
Introduction to the Dynamic Segment Tree

The dynamic segment tree is something between a classic segment tree and Boost ICL's interval_map. You can find an example of its usage at DynamicSegmentTree Example.

It allows you to insert (and remove) intervals that are associated with a value. For every point x in the key space, you can query for the aggregate of the values that contain x. You are free to define what an aggregate is. If your values are numbers, a reasonable aggregate may be the sum. If your values are lists of objects, an aggregate may be the concatenation of the lists, …

This is more or less what Boost ICL's interval_map offers. On top of that, you can define (or use the pre-defined) combiners. Combiners combine different aggregate values over an interval in the key space. For example, if your values are numbers, the "max" function is a reasonable (and in fact, pre-defined) combiner. Adding this combiner to your dynamic segment tree allows you to efficiently (see TODO) query for the maximum aggregated value over any arbitrary interval in your key space. Possible combiners need to satisfy a couple of constraints, see TODO.

The DynamicSegmentTree needs an underlying balanced binary search tree, for which you can either use the supplied red-black tree, the weight balanced tree or the Zip Tree. The selection is done via the TreeSelector template parameter.

An in-depth technical description of how the dynamic segment tree works can be found at TODO.

Requirements