Crate intervalues

Source
Expand description

§Intervalues

intervalues brings functionality to combine valued intervals together in an efficient manner.

Structs§

BaseInterval
Interval struct that contains a lowerbound and upperbound without a value or count.
Interval
Interval struct that contains a lowerbound, upperbound and value/count of the range within the interval. These can be aggregated together using intervalues::combine_intervals().
IntervalCollection
Result of combine_intervals: a collection of Intervals. This can be converted to a Vec of Intervals, or converted to a Counter (only integer and positive counts instead of values) or Set (any Interval with value >0 is included and if possible combined with neighbouring intervals).

Functions§

combine_as_set
Combine intervals with values to an efficient and reduced collection, taking overlaps and duplicates into account. This version returns the intervals with a positive final value. Returns a Vec of BaseIntervals.
combine_intervals
Combine intervals with values to an efficient and reduced collection, taking overlaps and duplicates into account. Returns an IntervalCollection struct which can be converted further.