Conversion between set representations

Conversion between set representations

This section of the manual lists the conversion functions between set representations.

Base.convertMethod.
convert(::Type{HPOLYGON1}, P::HPOLYGON2) where
    {HPOLYGON1<:Union{HPolygon, HPolygonOpt}, HPOLYGON2<:AbstractHPolygon}

Convert between polygon types in H-representation.

Input

  • type – target type

  • P – 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.

source
Base.convertMethod.
convert(::Type{HPolytope}, P::AbstractHPolygon)

Convert from polygon in H-representation to polytope in H-representation.

Input

  • type – target type

  • P – source polygon

Output

The polygon represented as 2D polytope.

source
Base.convertMethod.
convert(::Type{HPOLYGON}, P::HPolytope) where {HPOLYGON<:AbstractHPolygon}

Convert from 2D polytope in H-representation to polygon in H-representation.

Input

  • type – target type

  • P – source polytope (must be 2D)

Output

The 2D polytope represented as polygon.

source
Base.convertMethod.
convert(::Type{Zonotope}, H::AbstractHyperrectangle{N}) where {N}

Converts a hyperrectangular set to a zonotope.

Input

  • Zonotope

  • H – hyperrectangular set

Output

A zonotope.

source
Base.convertMethod.
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])
source