Universe

LazySets.UniverseType
Universe{N} <: AbstractPolyhedron{N}

Type that represents the universal set, i.e., the set of all elements.

source
LazySets.dimMethod
dim(U::Universe)

Return the dimension of a universe.

Input

  • U – universe

Output

The dimension of a universe.

source
LazySets.ρMethod
ρ(d::AbstractVector, U::Universe)

Return the support function of a universe.

Input

  • d – direction
  • U – universe

Output

The support function in the given direction.

Algorithm

If the direction is all zero, the result is zero. Otherwise, the result is Inf.

source
LazySets.σMethod
σ(d::AbstractVector, U::Universe)

Return the support vector of a universe.

Input

  • d – direction
  • U – universe

Output

A vector with infinity values, except in dimensions where the direction is zero.

source
Base.:∈Method
∈(x::AbstractVector, U::Universe)

Check whether a given point is contained in a universe.

Input

  • x – point/vector
  • U – universe

Output

The output is always true.

Examples

julia> [1.0, 0.0] ∈ Universe(2)
true
source
Base.randMethod
rand(::Type{Universe}; [N]::Type{<:Real}=Float64, [dim]::Int=2,
     [rng]::AbstractRNG=GLOBAL_RNG, [seed]::Union{Int, Nothing}=nothing)

Create a universe (note that there is nothing to randomize).

Input

  • Universe – 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

Output

The (only) universe of the given numeric type and dimension.

source
LazySets.an_elementMethod
an_element(S::LazySet{N}) where {N}

Return some element of a convex set.

Input

  • S – convex set

Output

An element of a convex set.

Algorithm

An element of the set is obtained by evaluating its support vector along direction $[1, 0, …, 0]$.

source
an_element(P::AbstractPolyhedron{N};
           [solver]=default_lp_solver(N)) where {N}

Return some element of a polyhedron.

Input

  • P – polyhedron
  • solver – (optional, default: default_lp_solver(N)) LP solver

Output

An element of the polyhedron, or an error if the polyhedron is empty.

Algorithm

An element of the polyhedron is obtained by solving a feasibility linear program.

source
an_element(L::Line2D{N}) where {N}

Return some element of a line.

Input

  • L – line

Output

An element on the line.

Algorithm

If the $b$ value of the line is zero, the result is the origin. Otherwise the result is some $x = [x1, x2]$ such that $a·[x1, x2] = b$. We first find out in which dimension $a$ is nonzero, say, dimension 1, and then choose $x1 = 1$ and accordingly $x2 = \frac{b - a1}{a2}$.

source
an_element(U::Universe{N}) where {N}

Return some element of a universe.

Input

  • U – universe

Output

The origin.

source
Base.isemptyMethod
isempty(U::Universe)

Return if a universe is empty or not.

Input

  • U – universe

Output

false.

source
LazySets.isboundedMethod
isbounded(U::Universe)

Determine whether a universe is bounded.

Input

  • U – universe

Output

false as the universe is unbounded.

source
LazySets.isuniversalMethod
isuniversal(U::Universe{N}, [witness]::Bool=false) where {N}

Check whether a universe is universal.

Input

  • U – universe
  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true
  • If witness option is activated: (true, [])
source
LinearAlgebra.normFunction
norm(U::Universe, [p]::Real=Inf)

Return the norm of a universe. It is the norm of the enclosing ball (of the given $p$-norm) of minimal volume that is centered in the origin.

Input

  • U – universe
  • p – (optional, default: Inf) norm

Output

An error.

source
LazySets.radiusFunction
radius(U::Universe, [p]::Real=Inf)

Return the radius of a universe. It is the radius of the enclosing ball (of the given $p$-norm) of minimal volume with the same center.

Input

  • U – universe
  • p – (optional, default: Inf) norm

Output

An error.

source
LazySets.diameterFunction
diameter(U::Universe, [p]::Real=Inf)

Return the diameter of a universe. It is the maximum distance between any two elements of the set, or, equivalently, the diameter of the enclosing ball (of the given $p$-norm) of minimal volume with the same center.

Input

  • U – universe
  • p – (optional, default: Inf) norm

Output

An error.

source
LazySets.constraintsMethod
constraints_list(U::Universe{N}) where {N}

Construct an iterator over the constraints of a universe.

Input

  • U – universe

Output

The empty iterator, as the universe is unconstrained.

source
LazySets.constraints_listMethod
constraints_list(H::AbstractHyperrectangle{N}) where {N}

Return the list of constraints of an axis-aligned hyperrectangular set.

Input

  • H – hyperrectangular set

Output

A list of linear constraints.

source
constraints_list(P::Ball1{N}) where {N}

Return the list of constraints defining a ball in the 1-norm.

Input

  • B – ball in the 1-norm

Output

The list of constraints of the ball.

Algorithm

The constraints can be defined as $d_i^T (x-c) ≤ r$ for all $d_i$, where $d_i$ is a vector with elements $1$ or $-1$ in $n$ dimensions. To span all possible $d_i$, the function Iterators.product is used.

source
constraints_list(x::Interval{N}) where {N}

Return the list of constraints of the given interval.

Input

  • x – interval

Output

The list of constraints of the interval represented as two one-dimensional half-spaces.

source
constraints_list(L::Line{N, VN}) where {N, VN}

Return the list of constraints of a line.

Input

  • L – line

Output

A list containing 2n-2 half-spaces whose intersection is L, where n is the ambient dimension of L.

source
constraints_list(U::Universe{N}) where {N}

Return the list of constraints defining a universe.

Input

  • U – universe

Output

The empty list of constraints, as the universe is unconstrained.

source
constraints_list(P::HParallelotope{N, VN}) where {N, VN}

Return the list of constraints of the given parallelotope.

Input

  • P – parallelotope in constraint representation

Output

The list of constraints of P.

source

constraints_list(cpa::CartesianProductArray{N}) where {N}

Return the list of constraints of a (polyhedral) Cartesian product of a finite number of sets.

Input

  • cpa – Cartesian product array

Output

A list of constraints.

source
constraints_list(ia::IntersectionArray{N}) where {N}

Return the list of constraints of an intersection of a finite number of (polyhedral) sets.

Input

  • ia – intersection of a finite number of (polyhedral) sets

Output

The list of constraints of the intersection.

Notes

We assume that the underlying sets are polyhedral, i.e., offer a method constraints_list.

Algorithm

We create the polyhedron from the constraints_lists of the sets and remove redundant constraints.

source
constraints_list(rm::ResetMap{N}) where {N}

Return the list of constraints of a polytopic reset map.

Input

  • rm – reset map of a polytope

Output

The list of constraints of the reset map.

Notes

We assume that the underlying set X is a polytope, i.e., is bounded and offers a method constraints_list(X).

Algorithm

We fall back to constraints_list of a LinearMap of the A-matrix in the affine-map view of a reset map. Each reset dimension $i$ is projected to zero, expressed by two constraints for each reset dimension. Then it remains to shift these constraints to the new value.

For instance, if the dimension $5$ was reset to $4$, then there will be constraints $x₅ ≤ 0$ and $-x₅ ≤ 0$. We then modify the right-hand side of these constraints to $x₅ ≤ 4$ and $-x₅ ≤ -4$, respectively.

source
constraints_list(rm::ResetMap{N, S}) where {N, S<:AbstractHyperrectangle}

Return the list of constraints of a hyperrectangular reset map.

Input

  • rm – reset map of a hyperrectangular set

Output

The list of constraints of the reset map.

Algorithm

We iterate through all dimensions. If there is a reset, we construct the corresponding (flat) constraints. Otherwise, we construct the corresponding constraints of the underlying set.

source
LazySets.constrained_dimensionsMethod
constrained_dimensions(U::Universe)

Return the indices in which a universe is constrained.

Input

  • U – universe

Output

The empty vector, as the universe is unconstrained in every dimension.

source
LazySets.translateMethod
translate(U::Universe, v::AbstractVector)

Translate (i.e., shift) a universe by a given vector.

Input

  • U – universe
  • v – translation vector

Output

The universe.

source