Skip to content

Commit

Permalink
Merge pull request #1072 from JuliaReach/schillic/1070
Browse files Browse the repository at this point in the history
#1070 - Wrong handling of type parameter in tohrep of VPolygon
  • Loading branch information
schillic authored Jan 26, 2019
2 parents 8f09755 + 99ab63e commit e26fd52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/VPolygon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ end

"""
tohrep(P::VPolygon{N}, ::Type{HPOLYGON}=HPolygon
)::HPOLYGON{N} where {N<:Real, HPOLYGON<:AbstractHPolygon}
) where {N<:Real, HPOLYGON<:AbstractHPolygon}
Build a constraint representation of the given polygon.
Expand All @@ -152,7 +152,7 @@ constraints will be sorted automatically (CCW) if we start with the first edge
between the first and second vertex.
"""
function tohrep(P::VPolygon{N}, ::Type{HPOLYGON}=HPolygon
)::HPOLYGON{N} where {N<:Real, HPOLYGON<:AbstractHPolygon}
) where {N<:Real, HPOLYGON<:AbstractHPolygon}
vl = vertices_list(P)
n = length(vl)
if n == 0
Expand Down
1 change: 1 addition & 0 deletions test/unit_Polygon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ for N in [Float64, Float32, Rational{Int}]
points = i == 0 ? Vector{Vector{N}}() : points5[1:i]
vp = VPolygon(points, apply_convex_hull=i > 0)
h1 = tohrep(vp)
@test convert(HPolygon, vp) == h1
if i == 0
@test isempty(h1.constraints)
elseif i == 1
Expand Down

0 comments on commit e26fd52

Please sign in to comment.