Conversion between set representations
This section of the manual lists the conversion functions between set representations.
Base.convert
— Method.convert(::Type{HPOLYGON1}, P::HPOLYGON2) where
{HPOLYGON1<:Union{HPolygon, HPolygonOpt}, HPOLYGON2<:AbstractHPolygon}
Convert between polygon types in H-representation.
Input
type
– target typeP
– source polygon
Output
The polygon represented as the target type.
Notes
We need the Union
type for HPOLYGON1
because the target type must be concrete.
Base.convert
— Method.convert(::Type{HPolytope}, P::AbstractHPolygon)
Convert from polygon in H-representation to polytope in H-representation.
Input
type
– target typeP
– source polygon
Output
The polygon represented as 2D polytope.
Base.convert
— Method.convert(::Type{HPOLYGON}, P::HPolytope) where {HPOLYGON<:AbstractHPolygon}
Convert from 2D polytope in H-representation to polygon in H-representation.
Input
type
– target typeP
– source polytope (must be 2D)
Output
The 2D polytope represented as polygon.
Base.convert
— Method.convert(::Type{Zonotope}, H::AbstractHyperrectangle{N}) where {N}
Converts a hyperrectangular set to a zonotope.
Input
Zonotope
H
– hyperrectangular set
Output
A zonotope.
Base.convert
— Method.convert(::Type{Hyperrectangle}, x::LazySets.Interval{N, IN}) where {N, IN <: AbstractInterval{N}}
Converts a unidimensional interval into a hyperrectangular set.
Input
AbstractHyperrectangle
x
– interval
Output
A hyperrectangle.
Examples
julia> convert(Hyperrectangle, Interval(0.0, 1.0))
LazySets.Hyperrectangle{Float64}([0.5], [0.5])