Conversions 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<:AbstractHPolygon,
                             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(T::Type{HPOLYGON}, P::VPolygon) where {HPOLYGON<:AbstractHPolygon}

Converts a polygon in vertex representation to a polygon in constraint representation.

Input

  • HPOLYGON – type used for dispatch
  • P – polygon in vertex representation

Output

A polygon in constraint representation.

source
Base.convertMethod.
convert(::Type{Hyperrectangle}, x::Interval)

Converts a unidimensional interval into a hyperrectangular set.

Input

  • AbstractHyperrectangle
  • x – interval

Output

A hyperrectangle.

Examples

julia> convert(Hyperrectangle, Interval(0.0, 1.0))
Hyperrectangle{Float64}([0.5], [0.5])
source
Base.convertMethod.
convert(::Type{HPOLYGON}, H::AbstractHyperrectangle) where
    {HPOLYGON<:AbstractHPolygon}

Converts a hyperrectangular set to a polygon in constraint representation.

Input

  • HPOLYGON – type used for dispatch
  • H – hyperrectangular set

Output

A polygon in constraint representation.

source
Base.convertMethod.
convert(::Type{HPOLYGON}, P::HPolytope{N}) where
    {N<:Real, 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{HPOLYGON}, S::AbstractSingleton{N}
       ) where {N<:Real, HPOLYGON<:AbstractHPolygon}

Convert from singleton to polygon in H-representation.

Input

  • type – target type
  • S – singleton

Output

A polygon in constraint representation with the minimal number of constraints (three).

source
Base.convertMethod.
convert(::Type{HPOLYGON}, L::LineSegment{N}
      ) where {N<:Real, HPOLYGON<:AbstractHPolygon}

Convert from line segment to polygon in H-representation.

Input

  • type – target type
  • L – line segment

Output

A flat polygon in constraint representation with the minimal number of constraints (four).

source
Base.convertMethod.
convert(::Type{HPolyhedron}, P::AbstractPolytope)

Convert a polytopic set to a polyhedron in H-representation.

Input

  • type – target type
  • P – source polytope

Output

The given polytope represented as a polyhedron in constraint representation.

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{HPolytope}, H::AbstractHyperrectangle)

Converts a hyperrectangular set to a polytope in constraint representation.

Input

  • HPolytope – type used for dispatch
  • H – hyperrectangular set

Output

A polytope in constraint representation.

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

Convert a polytopic set to a polytope in H-representation.

Input

  • type – target type
  • P – source polytope

Output

The given polytope represented as a polytope in constraint representation.

Algorithm

$P$ is first converted to a polytope in V-representation. Then, the conversion method to a polytope in H-representation is invoked. This conversion may require the Polyhedra library.

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

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

Input

  • type – target type
  • P – source polytope

Output

The polytope in the dual representation.

Algorithm

The tohrep function is invoked. It requires the Polyhedra package.

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

Converts a polygon in constraint representation to a polygon in vertex representation.

Input

  • VPolygon – type used for dispatch
  • P – polygon in constraint representation

Output

A polygon in vertex representation.

source
Base.convertMethod.
convert(::Type{VPolygon}, P::AbstractPolytope)

Convert polytopic set to polygon in V-representation.

Input

  • type – target type
  • P – source polytope

Output

The 2D polytope represented as a polygon.

source
Base.convertMethod.
convert(::Type{VPolytope}, P::AbstractPolytope)

Convert polytopic type to polytope in V-representation.

Input

  • type – target type
  • P – source polytope

Output

The set P represented as a VPolytope.

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

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

Input

  • type – target type
  • P – source polytope

Output

The polytope in the dual representation.

Algorithm

The tovrep function is invoked. It requires the Polyhedra package.

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

Converts a hyperrectangular set to a zonotope.

Input

  • Zonotope
  • H – hyperrectangular set

Output

A zonotope.

source