-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sum of ranges in a set-like context #33577
Comments
Now, we could potentially try to do something clever with |
I meanwhile stumbled over
Though for the other point you made I need to disagree. The range in the mathematical sense is just an intersection of a discrete set with an interval. (In case of AbstractUnitRange the discrete set is Z) |
Oh I see — I was misunderstanding the operation you were after. It looks like what you want is sometimes called the Minkowski sum. Ranges (and arrays in general) are totally capable set-like objects — they support |
FYI, there are discussions about using broadcasting to implement this kind of "product-based" arithmetics: #33282, JuliaMath/IntervalSets.jl#55 |
Right now we have
But I wonder whether it would be worthwhile to make + the set addition (aka r1+r2 = {a+b | a\in r1, b\in r2})
and thus the step wouldn't change.
Implementation:
The text was updated successfully, but these errors were encountered: