-
Notifications
You must be signed in to change notification settings - Fork 71
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
Mince should return an iterator #431
Comments
I think it's just a question of replacing the array comprehension by a generator expression, i.e. replacing square brackets with parentheses: function mince(x::Interval, n)
nodes = range(x.lo, x.hi, length = n+1)
return (Interval(nodes[i], nodes[i+1]) for i in 1:length(nodes)-1)
end |
I've open #467, which improves performance (broadcasting!), but returns a vector... |
Is this still a wanted feature? |
@dpsanders what about using a new structure that relies on ranges? @lbenet and I have been discussing this issue and we think it would be useful to have an implementation of the |
I still wonder why this is so bad for julia> @btime mince($interval(1, 2), $10_000);
9.917 μs (2 allocations: 156.30 KiB) |
Solves issue JuliaIntervals#431
For efficiency
The text was updated successfully, but these errors were encountered: