Universe
LazySets.Universe
— TypeUniverse{N} <: AbstractPolyhedron{N}
Type that represents the universal set, i.e., the set of all elements.
LazySets.dim
— Methoddim(U::Universe)
Return the dimension of a universe.
Input
U
– universe
Output
The dimension of a universe.
LazySets.ρ
— Methodρ(d::AbstractVector, U::Universe)
Return the support function of a universe.
Input
d
– directionU
– 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
.
LazySets.σ
— Methodσ(d::AbstractVector, U::Universe)
Return the support vector of a universe.
Input
d
– directionU
– universe
Output
A vector with infinity values, except in dimensions where the direction is zero.
Base.:∈
— Method∈(x::AbstractVector, U::Universe)
Check whether a given point is contained in a universe.
Input
x
– point/vectorU
– universe
Output
The output is always true
.
Examples
julia> [1.0, 0.0] ∈ Universe(2)
true
Base.rand
— Methodrand(::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 dispatchN
– (optional, default:Float64
) numeric typedim
– (optional, default: 2) dimensionrng
– (optional, default:GLOBAL_RNG
) random number generatorseed
– (optional, default:nothing
) seed for reseeding
Output
The (only) universe of the given numeric type and dimension.
LazySets.an_element
— Methodan_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]$.
an_element(P::AbstractPolyhedron{N};
[solver]=default_lp_solver(N)) where {N}
Return some element of a polyhedron.
Input
P
– polyhedronsolver
– (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.
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}$.
an_element(U::Universe{N}) where {N}
Return some element of a universe.
Input
U
– universe
Output
The origin.
Base.isempty
— Methodisempty(U::Universe)
Return if a universe is empty or not.
Input
U
– universe
Output
false
.
LazySets.isbounded
— Methodisbounded(U::Universe)
Determine whether a universe is bounded.
Input
U
– universe
Output
false
as the universe is unbounded.
LazySets.isuniversal
— Methodisuniversal(U::Universe{N}, [witness]::Bool=false) where {N}
Check whether a universe is universal.
Input
U
– universewitness
– (optional, default:false
) compute a witness if activated
Output
- If
witness
option is deactivated:true
- If
witness
option is activated:(true, [])
LinearAlgebra.norm
— Functionnorm(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
– universep
– (optional, default:Inf
) norm
Output
An error.
LazySets.radius
— Functionradius(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
– universep
– (optional, default:Inf
) norm
Output
An error.
LazySets.diameter
— Functiondiameter(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
– universep
– (optional, default:Inf
) norm
Output
An error.
LazySets.constraints
— Methodconstraints_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.
LazySets.constraints_list
— Methodconstraints_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.
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.
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.
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
.
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.
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
.
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.
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_list
s of the sets and remove redundant constraints.
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.
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.
LazySets.constrained_dimensions
— Methodconstrained_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.
LazySets.translate
— Methodtranslate(U::Universe, v::AbstractVector)
Translate (i.e., shift) a universe by a given vector.
Input
U
– universev
– translation vector
Output
The universe.