JuliaPolyhedra / Polyhedra.jl

Polyhedral Computation Interface
Other
172 stars 27 forks source link

Bug in function polyhedron #173

Open ga73kud opened 5 years ago

ga73kud commented 5 years ago

It seems that the function polyhedron doesn't compute all my polyhedrons without errors. I also used the MPT Toolbox of the ETH Zürich in Matlab, and the result is different. The polyhedra shouldn't have white spaces between their neighbor polyhedron. In Matlab it works fine, in Julia, the computation seems problematic. The code:

using MAT
using Polyhedra
using Plots
default(show = false)
function readData()
    println("fcn read data start")
    file = matread("myDat.mat")
    data=file["mydat"]
    vertices=data["polyVertices"]
    for qrt=1:length(vertices)
        first=vertices[qrt]
        v=Polyhedra.vrep(first)
        p=polyhedron(v)
        display(plot!(p, yflip=true))
    end
    println("fcn read data end")
end
readData()
blegat commented 5 years ago

The polyhedra shouldn't have white spaces between their neighbor polyhedron

Not sure what you mean mean by that. You can try replacing polyhedron(v) by polyhedron(v, CDDLib.Library(:float)) (adding using CDDLib at the beginning) of the script if you want to use the same underlying library than MPT.

Otherwise, it may be a bug in the default library, we would be interested by an example of instance for which this occur.

ga73kud commented 5 years ago

In Matlab the polyhedrons are perfectly aligned to each other. Like in a mosaic picture. In Julia there are some "white spaces" (I colored the polyhedrons).

I get following error with polyhedron(v, CDDLib.Library(:float))

LoadError: MethodError: objects of type Symbol are not callable
in expression starting at /home/hartmannadm/JULIA_PRO/Scripts/pomdp/visualizeInffeld.jl:20
readData() at visualizeInffeld.jl:15
top-level scope at none:0
blegat commented 5 years ago

Which version of CDDLib, Polyhedra and Julia are you using ? Can you try CDDLib.Library() in the REPL to isolate the issue ?

blegat commented 4 years ago

Any update ?