Skip to content

Commit

Permalink
Merge pull request #3561 from JuliaReach/schillic/convert_AS
Browse files Browse the repository at this point in the history
Remove redundant `convert` methods
  • Loading branch information
schillic authored Nov 20, 2024
2 parents 3a1b4d6 + ff9ff34 commit 6d5e270
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
2 changes: 0 additions & 2 deletions docs/src/lib/conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ convert(::Type{Hyperrectangle}, ::Rectification{N, AH}) where {N, AH<:AbstractHy
convert(::Type{HPolygon}, ::LazySet)
convert(::Type{HPolygon}, ::VPolygon)
convert(::Type{HPolygon}, ::LineSegment{N}) where {N}
convert(::Type{HPolygon}, ::AbstractSingleton{N}) where {N}
convert(::Type{HPolygonOpt}, ::LazySet)
convert(::Type{HPolygonOpt}, ::VPolygon)
convert(::Type{HPolygonOpt}, ::LineSegment{N}) where {N}
convert(::Type{HPolygonOpt}, ::AbstractSingleton{N}) where {N}
convert(::Type{VPolygon}, ::AbstractHPolygon)
convert(::Type{Zonotope}, ::LinearMap{N, ZN}) where {N, ZN<:AbstractZonotope}
convert(::Type{Zonotope}, ::LinearMap{N, CartesianProduct{N, HN1, HN2}}) where {N, HN1<:AbstractHyperrectangle, HN2<:AbstractHyperrectangle}
Expand Down
26 changes: 0 additions & 26 deletions src/Convert/convert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,32 +103,6 @@ for T in subtypes(AbstractHPolygon, true)
return VPolygonModule.tohrep(P, T)
end

"""
convert(::Type{$($T)}, S::AbstractSingleton{N}) where {N}
Convert a singleton to a polygon in constraint representation.
### Input
- `$($T)` -- target type
- `S` -- singleton
### Output
A polygon in constraint representation with the minimal number of constraints
(three).
"""
function convert(::Type{$T}, S::AbstractSingleton{N}) where {N}
constraints_list = Vector{HalfSpace{N,Vector{N}}}(undef, 3)
o = one(N)
z = zero(N)
v = element(S)
constraints_list[1] = HalfSpace([o, o], v[1] + v[2])
constraints_list[2] = HalfSpace([-o, z], -v[1])
constraints_list[3] = HalfSpace([z, -o], -v[2])
return $T(constraints_list)
end

"""
convert(::Type{$($T)}, L::LineSegment{N}) where {N}
Expand Down

0 comments on commit 6d5e270

Please sign in to comment.