Closed oyamad closed 6 years ago
I tested in the REPL, it is the last line that takes all the time:
polyhedron(rep, plib)
All this time seem to be only compilation as when I execute it again it is instantaneous.
The command polyhedron(rep, plib);
runs fast (even at the first time) if I replace the Nullable{T}
s in https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/b915c05123a563cb25a3f02ffdaf4510f34c194d/src/simplepolyhedron.jl#L18-L20
with Union{T, Nothing}
(where T
= HRepT
, VRepT
).
If I execute polyhedron(rep, plib)
without ;
, I get the error
Error showing value of type SimplePolyhedron{2,Float64,MixedMatHRep{2,Float64,Array{Float64,2}},MixedMatVRep{2,Float64,Array{Float64,2}}}:
ERROR: MethodError: no method matching get(::MixedMatHRep{2,Float64,Array{Float64,2}})
where get
is called in https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/b915c05123a563cb25a3f02ffdaf4510f34c194d/src/simplepolyhedron.jl#L85-L90
With the current master
, the following runs instantaneously:
using Polyhedra
A = [1. 1; 1 -1; -1 0]
b = [1, 0, 0]
rep = hrep(A, b)
plib = default_library(FullDim{2}(), Float64)
p = polyhedron(rep, plib);
(note the ;
in the last line).
Then just
p
takes minutes. (Maybe the above comment on Nullable
versus Union
is irrelevant.)
What is called just by p
? Is it display
?
Now it seems that it is points(p)
that is extremely slow in compilation, which is defined in https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/6007ee78748d2a41b708def2eb6a9e4c0b693808/src/iterators.jl#L79-L168
Is that still the case now that https://github.com/JuliaPolyhedra/Polyhedra.jl/pull/114 has been merged ?
Yes, points(p)
is still very slow even on the current master
.
@oyamad Can you check whether this is still the case on master or whether it has been resolved ? master should now work on Julia v1.0 with JuMP at branch release-0.18 except for the bug https://github.com/JuliaPolyhedra/Polyhedra.jl/issues/123
@blegat Thanks. Yes, the issue has been resolved by #122!
It takes more than 5 minutes (on OS X):