JuliaPolyhedra / CDDLib.jl

cdd wrapper module for Julia. cdd is a library for polyhedra manipulation such as double description and Fourier-Motzkin elimination
Other
36 stars 12 forks source link

No method matching sethrep!(::CDDLib.Polyhedron, ::CDDInequalityMatrix) #73

Closed schillic closed 2 years ago

schillic commented 2 years ago

After JuliaPolyhedra/Polyhedra.jl#298 I reach another problem (maybe this should rather be reported in CDDLib, not sure).

(@v1.7) pkg> status Polyhedra CDDLib
      Status `~/.julia/environments/v1.7/Project.toml`
  [3391f64e] CDDLib v0.9.0
  [67491407] Polyhedra v0.7.4

julia> using Polyhedra, CDDLib

julia> Q = polyhedron(vrep([[1.0]]), CDDLib.Library());

julia> removevredundancy!(Q; ztol=1e-7)

ERROR: MethodError: no method matching sethrep!(::CDDLib.Polyhedron{Float64}, ::CDDInequalityMatrix{Float64, Float64})
Closest candidates are:
  sethrep!(::Any, ::Any, ::Any) at ~/.julia/packages/Polyhedra/3AInN/src/defaultlibrary.jl:115
  sethrep!(::Interval, ::HRep) at ~/.julia/packages/Polyhedra/3AInN/src/interval.jl:207
  sethrep!(::DefaultPolyhedron, ::HRepresentation) at ~/.julia/packages/Polyhedra/3AInN/src/defaultlibrary.jl:120
  ...
Stacktrace:
 [1] sethrep!(p::CDDLib.Polyhedron{Float64}, h::CDDInequalityMatrix{Float64, Float64}, red::Redundancy)
   @ Polyhedra ~/.julia/packages/Polyhedra/3AInN/src/defaultlibrary.jl:115
 [2] detecthlinearity!(p::CDDLib.Polyhedron{Float64}, solver::Type; kws::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:ztol,), Tuple{Float64}}})
   @ Polyhedra ~/.julia/packages/Polyhedra/3AInN/src/linearity.jl:37
 [3] removevredundancy!(p::CDDLib.Polyhedron{Float64}; strongly::Bool, planar::Bool, kws::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:ztol,), Tuple{Float64}}})
   @ Polyhedra ~/.julia/packages/Polyhedra/3AInN/src/redundancy.jl:159
blegat commented 2 years ago

That's because ztol is not supported here: https://github.com/JuliaPolyhedra/CDDLib.jl/blob/a5d89291d228ea0907eaae9a75d51170608ad737/src/polyhedron.jl#L205 As CDDLib does not need any ztol, we should just ignore it.

blegat commented 2 years ago

CDDLib should now be failing the new test added in https://github.com/JuliaPolyhedra/Polyhedra.jl/pull/302