Skip to content

Commit

Permalink
remove redundant convert methods
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Aug 3, 2024
1 parent 623a947 commit 9f49917
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.jl
Original file line number Diff line number Diff line change
Expand Up @@ -593,32 +593,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 9f49917

Please sign in to comment.