JuliaPolyhedra / Polyhedra.jl

Polyhedral Computation Interface
Other
172 stars 27 forks source link

Error using cartesian_product #294

Closed chelseas closed 2 years ago

chelseas commented 2 years ago

I am trying to cartesian product two hyperrectangles:

tv_domain::Hyperrectangle{Float64, Vector{Float64}, Vector{Float64}} = Hyperrectangle{Float64, Vector{Float64}, Vector{Float64}}([0.0], [6.283185307179586])
xerr_domain::Hyperrectangle{Float64, Vector{Float64}, Vector{Float64}} = Hyperrectangle{Float64, Vector{Float64}, Vector{Float64}}([0.0, 0.0, 0.0], [0.5, 0.5, 1.0])

And I get this error:

ERROR: LoadError: MethodError: no method matching sum_fulldim(::StaticArrays.Size{(1,)}, ::Int64)
Closest candidates are:
  sum_fulldim(::Int64, ::Int64) at /home/csidrane/.julia/packages/Polyhedra/NGGvZ/src/dimension.jl:61
  sum_fulldim(::StaticArrays.Size{N1}, ::StaticArrays.Size{N2}) where {N1, N2} at /home/csidrane/.julia/packages/Polyhedra/NGGvZ/src/dimension.jl:63

Anyone know what is up?

blegat commented 2 years ago

I can reproduce without LazySets

julia> using Polyhedra

julia> using StaticArrays

julia> intersect(HalfSpace(@SVector([1]), 0)) * intersect(HalfSpace([1], 0))
ERROR: MethodError: no method matching sum_fulldim(::Size{(1,)}, ::Int64)
Closest candidates are:
  sum_fulldim(::Size{N1}, ::Size{N2}) where {N1, N2} at ~/.julia/dev/Polyhedra/src/dimension.jl:63
  sum_fulldim(::Int64, ::Int64) at ~/.julia/dev/Polyhedra/src/dimension.jl:61
Stacktrace:
 [1] hcartesianproduct(p1::Polyhedra.Intersection{Int64, SVector{1, Int64}, Size{(1,)}}, p2::Polyhedra.Intersection{Int64, Vector{Int64}, Int64})
   @ Polyhedra ~/.julia/dev/Polyhedra/src/repop.jl:147
 [2] cartesianproduct(p1::Polyhedra.Intersection{Int64, SVector{1, Int64}, Size{(1,)}}, p2::Polyhedra.Intersection{Int64, Vector{Int64}, Int64})
   @ Polyhedra ~/.julia/dev/Polyhedra/src/repop.jl:170
 [3] *(p1::Polyhedra.Intersection{Int64, SVector{1, Int64}, Size{(1,)}}, p2::Polyhedra.Intersection{Int64, Vector{Int64}, Int64})
   @ Polyhedra ~/.julia/dev/Polyhedra/src/repop.jl:186
 [4] top-level scope
   @ REPL[4]:1