@@ -182,7 +182,7 @@ Options are:
182182 - [ After deoverlap] ( #after-deoverlap )
183183 - [ interval\_ tree deoverlap\_ copy()] ( #interval_tree-deoverlap_copy )
184184 - [ interval\_ tree punch(interval\_ type const\& ival)] ( #interval_tree-punchinterval_type-const-ival )
185- - [ Before punching (closed\_ adjacent intervals)] ( #before-punching-closed_adjacent -intervals )
185+ - [ Before punching (closed intervals)] ( #before-punching-closed -intervals )
186186 - [ After punching (with \[ -10, 60\] )] ( #after-punching-with--10-60 )
187187 - [ interval\_ tree punch()] ( #interval_tree-punch )
188188 - [ bool empty() const noexcept] ( #bool-empty-const-noexcept )
@@ -194,14 +194,16 @@ Options are:
194194 - [ reverse\_ iterator rend()] ( #reverse_iterator-rend )
195195 - [ reverse\_ iterator crbegin()] ( #reverse_iterator-crbegin )
196196 - [ reverse\_ iterator crend()] ( #reverse_iterator-crend )
197+ - [ void erase\_ range(interval\_ type const\& ival)] ( #void-erase_rangeinterval_type-const-ival )
198+ - [ void erase\_ range(interval\_ type const\& ival, bool retainSlices)] ( #void-erase_rangeinterval_type-const-ival-bool-retainslices )
197199 - [ Members of Interval] ( #members-of-interval )
198200 - [ using value\_ type] ( #using-value_type )
199201 - [ using interval\_ kind] ( #using-interval_kind )
200202 - [ friend bool operator==(interval const\& lhs, interval const\& other)] ( #friend-bool-operatorinterval-const-lhs-interval-const-other )
201203 - [ friend bool operator!=(interval const\& lhs, interval const\& other)] ( #friend-bool-operatorinterval-const-lhs-interval-const-other-1 )
202204 - [ value\_ type low() const] ( #value_type-low-const )
203205 - [ value\_ type high() const] ( #value_type-high-const )
204- - [ \[\[ deprecated \]\] bool overlaps(value\_ type l, value\_ type h) const] ( #deprecated-bool-overlapsvalue_type-l-value_type-h-const )
206+ - [ DEPRECATED bool overlaps(value\_ type l, value\_ type h) const] ( #deprecated-bool-overlapsvalue_type-l-value_type-h-const )
205207 - [ bool overlaps\_ exclusive(value\_ type l, value\_ type h) const] ( #bool-overlaps_exclusivevalue_type-l-value_type-h-const )
206208 - [ bool overlaps(interval const\& other) const] ( #bool-overlapsinterval-const-other-const )
207209 - [ bool overlaps\_ exclusive(interval const\& other) const] ( #bool-overlaps_exclusiveinterval-const-other-const )
@@ -379,10 +381,10 @@ Open intervals with integral numbers will also not produce the gap (5, 6), becau
379381` ival ` can be any subrange of the tree, including encompassing the whole tree.
380382
381383** Returns** : A new interval_tree containing the gaps.
382- ### Before punching (closed_adjacent intervals)
383- ![ BeforePunch] ( https://private-user-images.githubusercontent.com/6238896/471147224-5c631e00-dea4-4b75-a3bf-6fdd8ec1440b .png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTM1NjI1MzQsIm5iZiI6MTc1MzU2MjIzNCwicGF0aCI6Ii82MjM4ODk2LzQ3MTE0NzIyNC01YzYzMWUwMC1kZWE0LTRiNzUtYTNiZi02ZmRkOGVjMTQ0MGIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDcyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA3MjZUMjAzNzE0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDQ0NWIwMTcwMjZhNDA1YmUwNGI1YTIzNTBhZTQ5OTNhMWFiOTU5ZmU0N2E3NDI0NTQ0MzYwODA4N2E2MGFiZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.P5zLeXg0-9bd20Thj6pfq_WxriMn4GC_lDSLzzGKMbw )
384+ ### Before punching (closed intervals)
385+ ![ BeforePunch] ( https://5cript.github.io/readme-images/interval-tree/punch_source .png )
384386### After punching (with [ -10, 60] )
385- ![ AfterPunch] ( https://private-user-images.githubusercontent.com/6238896/471147227-5c226d1d-d544-4a43-89a4-b3545145107d .png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTM1NjI1MzQsIm5iZiI6MTc1MzU2MjIzNCwicGF0aCI6Ii82MjM4ODk2LzQ3MTE0NzIyNy01YzIyNmQxZC1kNTQ0LTRhNDMtODlhNC1iMzU0NTE0NTEwN2QucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDcyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA3MjZUMjAzNzE0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmE2ZDUzMjU2ZTNjZWQ0Y2QzYjQ3ZGUyYjgyNWM2NDViYTAxMTdlY2RjYmQyMzg4OWFmZDlhMWU5YjY4NjlmZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.Infe9i281LDOEC5GeBFuLHVE6Xjqw7KvcUo-gv3hjpk )
387+ ![ AfterPunch] ( https://5cript.github.io/readme-images/interval-tree/punch_result .png )
386388
387389---
388390### interval_tree punch()
@@ -444,6 +446,12 @@ Returns a past the end const_iterator in reverse.
444446
445447** Returns** : past the end const_iterator.
446448
449+ ### void erase_range(interval_type const& ival)
450+ Removes all intervals overlapping ival from the tree
451+
452+ ### void erase_range(interval_type const& ival, bool retainSlices)
453+ Removes all intervals overlapping ival from the tree, but retains the overlap beyond the erase interval.
454+
447455## Members of Interval
448456___ You can implement your own interval if you provide the same functions, except (slice, operator-, size, operator!=).___
449457
@@ -465,7 +473,7 @@ Which can be picked with the second template parameter of interval:
465473 - [ friend bool operator!=(interval const& lhs, interval const& other)] ( #friend-bool-operatorinterval-const-lhs-interval-const-other-1 )
466474 - [ value_type low() const] ( #value_type-low-const )
467475 - [ value_type high() const] ( #value_type-high-const )
468- - [ \[\[ deprecated \]\] bool overlaps(value_type l, value_type h) const] ( #bool-overlapsvalue_type-l-value_type-h-const )
476+ - [ DEPRECATED bool overlaps(value_type l, value_type h) const] ( #bool-overlapsvalue_type-l-value_type-h-const )
469477 - [ bool overlaps_exclusive(value_type l, value_type h) const] ( #bool-overlaps_exclusivevalue_type-l-value_type-h-const )
470478 - [ bool overlaps(interval const& other) const] ( #bool-overlapsinterval-const-other-const )
471479 - [ bool overlaps_exclusive(interval const& other) const] ( #bool-overlaps_exclusiveinterval-const-other-const )
@@ -474,6 +482,7 @@ Which can be picked with the second template parameter of interval:
474482 - [ value_type operator-(interval const& other) const] ( #value_type-operator-interval-const-other-const )
475483 - [ value_type size() const] ( #value_type-size-const )
476484 - [ interval join(interval const& other) const] ( #interval-joininterval-const-other-const )
485+ - [ slice\_ type slice(interval const\& other) const] ( #slice_type-sliceinterval-const-other-const )
477486
478487### using value_type
479488The underlying interval numerical type
@@ -487,7 +496,7 @@ Comparison operator.
487496Lower bound.
488497### value_type high() const
489498Upper bound.
490- ### \[\[ deprecated \]\] bool overlaps(value_type l, value_type h) const
499+ ### DEPRECATED bool overlaps(value_type l, value_type h) const
491500Overlap these bounds with this interval?
492501Is deprecated because the overlapping does not work with the dynamic interval type.
493502### bool overlaps_exclusive(value_type l, value_type h) const
@@ -507,12 +516,14 @@ Overlapping intervals have 0 distance.
507516Returns The amount of elements in the interval when integral, or the distance between the 2 bounds when floating point.
508517### interval join(interval const& other) const
509518Joins 2 intervals and whatever is inbetween.
510- ### slice_type< interval > slice(interval const& other) const
519+ ### slice_type slice(interval const& other) const
511520Removes other from this interval returning what is remaining.
512521The range of other going beyond the range of this is ignored.
513522Returns a struct with 2 members: left_slice and right_slice.
523+ ```
514524[ this interval ]
515525[left][other][right]
526+ ```
516527
517- When the intervals are closed , adjacent results are differenty by 1.
528+ When the intervals are closed_adjacent , adjacent results are differenty by 1.
518529[ 0, 9] .slice([ 5, 19] ) => left: [ 0, 4] , right: nullopt
0 commit comments