@@ -182,7 +182,7 @@ Options are:
182
182
- [ After deoverlap] ( #after-deoverlap )
183
183
- [ interval\_ tree deoverlap\_ copy()] ( #interval_tree-deoverlap_copy )
184
184
- [ 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 )
186
186
- [ After punching (with \[ -10, 60\] )] ( #after-punching-with--10-60 )
187
187
- [ interval\_ tree punch()] ( #interval_tree-punch )
188
188
- [ bool empty() const noexcept] ( #bool-empty-const-noexcept )
@@ -194,14 +194,16 @@ Options are:
194
194
- [ reverse\_ iterator rend()] ( #reverse_iterator-rend )
195
195
- [ reverse\_ iterator crbegin()] ( #reverse_iterator-crbegin )
196
196
- [ 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 )
197
199
- [ Members of Interval] ( #members-of-interval )
198
200
- [ using value\_ type] ( #using-value_type )
199
201
- [ using interval\_ kind] ( #using-interval_kind )
200
202
- [ friend bool operator==(interval const\& lhs, interval const\& other)] ( #friend-bool-operatorinterval-const-lhs-interval-const-other )
201
203
- [ friend bool operator!=(interval const\& lhs, interval const\& other)] ( #friend-bool-operatorinterval-const-lhs-interval-const-other-1 )
202
204
- [ value\_ type low() const] ( #value_type-low-const )
203
205
- [ 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 )
205
207
- [ bool overlaps\_ exclusive(value\_ type l, value\_ type h) const] ( #bool-overlaps_exclusivevalue_type-l-value_type-h-const )
206
208
- [ bool overlaps(interval const\& other) const] ( #bool-overlapsinterval-const-other-const )
207
209
- [ 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
379
381
` ival ` can be any subrange of the tree, including encompassing the whole tree.
380
382
381
383
** 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 )
384
386
### 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 )
386
388
387
389
---
388
390
### interval_tree punch()
@@ -444,6 +446,12 @@ Returns a past the end const_iterator in reverse.
444
446
445
447
** Returns** : past the end const_iterator.
446
448
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
+
447
455
## Members of Interval
448
456
___ You can implement your own interval if you provide the same functions, except (slice, operator-, size, operator!=).___
449
457
@@ -465,7 +473,7 @@ Which can be picked with the second template parameter of interval:
465
473
- [ friend bool operator!=(interval const& lhs, interval const& other)] ( #friend-bool-operatorinterval-const-lhs-interval-const-other-1 )
466
474
- [ value_type low() const] ( #value_type-low-const )
467
475
- [ 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 )
469
477
- [ bool overlaps_exclusive(value_type l, value_type h) const] ( #bool-overlaps_exclusivevalue_type-l-value_type-h-const )
470
478
- [ bool overlaps(interval const& other) const] ( #bool-overlapsinterval-const-other-const )
471
479
- [ 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:
474
482
- [ value_type operator-(interval const& other) const] ( #value_type-operator-interval-const-other-const )
475
483
- [ value_type size() const] ( #value_type-size-const )
476
484
- [ 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 )
477
486
478
487
### using value_type
479
488
The underlying interval numerical type
@@ -487,7 +496,7 @@ Comparison operator.
487
496
Lower bound.
488
497
### value_type high() const
489
498
Upper bound.
490
- ### \[\[ deprecated \]\] bool overlaps(value_type l, value_type h) const
499
+ ### DEPRECATED bool overlaps(value_type l, value_type h) const
491
500
Overlap these bounds with this interval?
492
501
Is deprecated because the overlapping does not work with the dynamic interval type.
493
502
### bool overlaps_exclusive(value_type l, value_type h) const
@@ -507,12 +516,14 @@ Overlapping intervals have 0 distance.
507
516
Returns The amount of elements in the interval when integral, or the distance between the 2 bounds when floating point.
508
517
### interval join(interval const& other) const
509
518
Joins 2 intervals and whatever is inbetween.
510
- ### slice_type< interval > slice(interval const& other) const
519
+ ### slice_type slice(interval const& other) const
511
520
Removes other from this interval returning what is remaining.
512
521
The range of other going beyond the range of this is ignored.
513
522
Returns a struct with 2 members: left_slice and right_slice.
523
+ ```
514
524
[ this interval ]
515
525
[left][other][right]
526
+ ```
516
527
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.
518
529
[ 0, 9] .slice([ 5, 19] ) => left: [ 0, 4] , right: nullopt
0 commit comments