Skip to content
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

mid(X) doesn't work for a IntervalBox in 0.7 #175

Closed
eeshan9815 opened this issue Jul 1, 2018 · 4 comments
Closed

mid(X) doesn't work for a IntervalBox in 0.7 #175

eeshan9815 opened this issue Jul 1, 2018 · 4 comments

Comments

@eeshan9815
Copy link
Contributor

Both mid(X) and mid.(X) seem to hang on Julia 0.7
mid.(X.v) works absolutely fine though.

@dpsanders
Copy link
Member

Oh :/
Thanks for the report. Probably something to do with the broadcasting?

@eeshan9815
Copy link
Contributor Author

eeshan9815 commented Jul 4, 2018

Possibly due to JuliaLang/julia#26435

@dpsanders
Copy link
Member

#176 makes broadcasting work, but it's currently very slow, so is presumably not the correct solution on 0.7:

julia> using IntervalArithmetic, BenchmarkTools

julia> X = IntervalBox(1..2, 3..4)
[1, 2] × [3, 4]

julia> @btime mid.($X.v)
  5.186 ns (0 allocations: 0 bytes)
2-element StaticArrays.SArray{Tuple{2},Float64,1,2}:
 1.5
 3.5

julia> @btime mid.($X)
  159.861 ns (5 allocations: 208 bytes)
2-element StaticArrays.SArray{Tuple{2},Float64,1,2}:
 1.5
 3.5

julia> @btime mid($X)
  147.446 ns (4 allocations: 160 bytes)
2-element StaticArrays.SArray{Tuple{2},Float64,1,2}:
 1.5
 3.5

@dpsanders
Copy link
Member

dpsanders commented Jul 19, 2018

This is now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants