Conversation
178271c to
1fe06db
Compare
The concrete `MutableIntervalUnion` implementation is replaced with a `EmptyIntervalUnion` (closes #28) and `IntervalUnionPair`, the latter of which always holds exactly two other non-empty intervals. Combined with `Interval` (which is also a union), these can serve as nodes in an interval tree. As part of this, `getBounds()` is redefined to always return intervals in canonical form. Not only is this a more well-defined contract, it also prevents having to canonicalize or call `lowerBound/upperBound` within `IntervalUnion`; `start` and `end` can safely be used.
093a11f to
ae52908
Compare
There was an incorrect assumption that intervals using real numbers weren't adjacent if they had the same endpoints but those bounds had differing inclusion. `Interval.plus` an interval which preceded it also failed since `IntervalUnionPair` expected intervals to be passed in order.
83d8225 to
ceb6b49
Compare
Owner
Author
|
Currently, recursion is used to implement
To determine whether the interval |
9ca4990 to
31f71f8
Compare
plus and minus on IntervalUnionIntervalUnion.plus
This was referenced Aug 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous
MutableIntervalUniondata structure only allowed adding disjoint, non-adjacent intervals which followed the last addition.This PR changes the internal data structure to be a tree of
IntervalUnionPairnodes.Interval.plushas been promoted to theIntervalUnioninterface and is now fully supported.