HPolytope

Polytope in constraint representation (HPolytope)

Convex polytopes are bounded polyhedra. The type HPolytope represents polytopes. While identical to HPolyhedron in implementation, HPolytope instances are assumed to be bounded.

HPolytope{N<:Real} <: AbstractPolytope{N}

Type that represents a convex polytope in H-representation.

Fields

  • constraints – vector of linear constraints
  • check_boundedness – (optional, default: false) flag for checking if the constraints make the polytope bounded; (boundedness is a running assumption of this type)

Note

Recall that a polytope is a bounded polyhedron. Boundedness is a running assumption in this type.

source

Some functionality is shared with HPolyhedron. Below follows the additional functionality specific to HPolytope.

Base.randMethod.
rand(::Type{HPolytope}; [N]::Type{<:Real}=Float64, [dim]::Int=2,
     [rng]::AbstractRNG=GLOBAL_RNG, [seed]::Union{Int, Nothing}=nothing)

Create a random polytope in constraint representation.

Input

  • HPolytope – type for dispatch
  • N – (optional, default: Float64) numeric type
  • dim – (optional, default: 2) dimension
  • rng – (optional, default: GLOBAL_RNG) random number generator
  • seed – (optional, default: nothing) seed for reseeding
  • num_vertices – (optional, default: -1) upper bound on the number of vertices of the polytope (see comment below)

Output

A random polytope in constraint representation.

Algorithm

We create a random polytope in vertex representation and convert it to constraint representation (hence the argument num_vertices). See rand(::Type{VPolytope}).

source
vertices_list(P::HPolytope{N};
              [backend]=nothing, [prune]::Bool=true) where {N<:Real}

Return the list of vertices of a polytope in constraint representation.

Input

  • P – polytope in constraint representation
  • backend – (optional, default: nothing) the polyhedral computations backend
  • prune – (optional, default: true) flag to remove redundant vertices

Output

List of vertices.

Algorithm

If the polytope is two-dimensional, the polytope is converted to a polygon in H-representation and then its vertices_list function is used. This ensures that, by default, the optimized two-dimensional methods are used.

It is possible to use the Polyhedra backend in two-dimensions as well by passing, e.g. backend=CDDLib.Library().

If the polytope is not two-dimensional, the concrete polyhedra manipulation library Polyhedra is used. The actual computation is performed by a given backend; for the default backend used in LazySets see default_polyhedra_backend(N). For further information on the supported backends see Polyhedra's documentation.

source
LazySets.isboundedFunction.
isbounded(P::HPolytope, [use_type_assumption]::Bool=true)

Determine whether a polytope in constraint representation is bounded.

Input

  • P – polytope in constraint representation
  • use_type_assumption – (optional, default: true) flag for ignoring the type assumption that polytopes are bounded

Output

true if use_type_assumption is activated. Otherwise, true iff P is bounded.

Algorithm

If !use_type_assumption, we convert P to an HPolyhedron P2 and then use isbounded(P2).

source

Inherited from AbstractPolytope: