Empty set (EmptySet)
LazySets.EmptySet
— TypeEmptySet{N} <: LazySet{N}
Type that represents the empty set, i.e., the set with no elements.
LazySets.∅
— Type∅
Alias for EmptySet{Float64}
.
LazySets.dim
— Methoddim(∅::EmptySet)
Return the dimension of an empty set.
Input
∅
– an empty set
Output
The dimension of the empty set.
LazySets.σ
— Methodσ(d::AbstractVector, ∅::EmptySet)
Return the support vector of an empty set.
Input
d
– direction∅
– empty set
Output
An error.
LazySets.ρ
— Methodρ(d::AbstractVector, ∅::EmptySet)
Evaluate the support function of an empty set in a given direction.
Input
d
– direction∅
– empty set
Output
An error.
Base.:∈
— Method∈(x::AbstractVector, ∅::EmptySet)
Check whether a given point is contained in an empty set.
Input
x
– point/vector∅
– empty set
Output
The output is always false
.
Examples
julia> [1.0, 0.0] ∈ ∅(2)
false
LazySets.an_element
— Methodan_element(∅::EmptySet)
Return some element of an empty set.
Input
∅
– empty set
Output
An error.
Base.rand
— Methodrand(::Type{EmptySet}; [N]::Type{<:Real}=Float64, [dim]::Int=0,
[rng]::AbstractRNG=GLOBAL_RNG, [seed]::Union{Int, Nothing}=nothing)
Create an empty set (note that there is nothing to randomize).
Input
EmptySet
– 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) empty set of the given numeric type and dimension.
LazySets.isbounded
— Methodisbounded(∅::EmptySet)
Determine whether an empty set is bounded.
Input
∅
– empty set
Output
true
.
Base.isempty
— Methodisempty(∅::EmptySet)
Return if the empty set is empty or not.
Input
∅
– empty set
Output
true
.
LazySets.isuniversal
— Methodisuniversal(∅::EmptySet{N}, [witness]::Bool=false) where {N}
Check whether an empty is universal.
Input
∅
– empty setwitness
– (optional, default:false
) compute a witness if activated
Output
- If
witness
option is deactivated:false
- If
witness
option is activated:(false, v)
where $v ∉ S$, although we currently throw an error
LazySets.vertices
— Methodvertices(S::AbstractSingleton{N}) where {N}
Construct an iterator over the vertices of a set with a single value.
Input
S
– set with a single value
Output
An iterator with a single value.
vertices(∅::EmptySet{N}) where {N}
Construct an iterator over the vertices of an empty set.
Input
∅
– empty set
Output
The empty iterator, as the empty set does not contain any vertices.
LazySets.vertices_list
— Methodvertices_list(P::AbstractHPolygon{N};
apply_convex_hull::Bool=true,
check_feasibility::Bool=true) where {N}
Return the list of vertices of a polygon in constraint representation.
Input
P
– polygon in constraint representationapply_convex_hull
– (optional, default:true
) flag to post-process the intersection of constraints with a convex hullcheck_feasibility
– (optional, default:true
) flag to check whether the polygon was empty (required for correctness in case of empty polygons)
Output
List of vertices.
Algorithm
We compute each vertex as the intersection of consecutive lines defined by the half-spaces. If check_feasibility
is active, we then check if the constraints of the polygon were actually feasible (i.e., they pointed in the right direction). For this we compute the average of all vertices and check membership in each constraint.
vertices_list(B::Ball1{N, VN}) where {N, VN<:AbstractVector}
Return the list of vertices of a ball in the 1-norm.
Input
B
– ball in the 1-norm
Output
A list containing the vertices of the ball in the 1-norm.
vertices_list(∅::EmptySet{N}) where {N}
Return the list of vertices of an empty set.
Input
∅
– empty set
Output
The empty list of vertices, as the empty set does not contain any vertices.
vertices_list(P::HPolytope{N};
[backend]=nothing, [prune]::Bool=true) where {N}
Return the list of vertices of a polytope in constraint representation.
Input
P
– polytope in constraint representationbackend
– (optional, default:nothing
) the polyhedral computations backendprune
– (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(P)
. For further information on the supported backends see Polyhedra's documentation.
vertices_list(cp::CartesianProduct{N}) where {N}
Return the list of vertices of a (polytopic) Cartesian product.
Input
cp
– Cartesian product
Output
A list of vertices.
Algorithm
We assume that the underlying sets are polytopic. Then the high-dimensional set of vertices is just the Cartesian product of the low-dimensional sets of vertices.
vertices_list(cpa::CartesianProductArray{N}) where {N}
Return the list of vertices of a (polytopic) Cartesian product of a finite number of sets.
Input
cpa
– Cartesian product array
Output
A list of vertices.
Algorithm
We assume that the underlying sets are polytopic. Then the high-dimensional set of vertices is just the Cartesian product of the low-dimensional sets of vertices.
vertices_list(em::ExponentialMap{N}) where {N}
Return the list of vertices of a (polytopic) exponential map.
Input
em
– exponential map
Output
A list of vertices.
Algorithm
We assume that the underlying set X
is polytopic. Then the result is just the exponential map applied to the vertices of X
.
LinearAlgebra.norm
— Functionnorm(S::EmptySet, [p]::Real=Inf)
Return the norm of an empty set. It is the norm of the enclosing ball (of the given $p$-norm) of minimal volume that is centered in the origin.
Input
S
– empty setp
– (optional, default:Inf
) norm
Output
An error.
LazySets.radius
— Functionradius(S::EmptySet, [p]::Real=Inf)
Return the radius of an empty set. It is the radius of the enclosing ball (of the given $p$-norm) of minimal volume with the same center.
Input
S
– empty setp
– (optional, default:Inf
) norm
Output
An error.
LazySets.diameter
— Functiondiameter(S::EmptySet, [p]::Real=Inf)
Return the diameter of an empty set. 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
S
– empty setp
– (optional, default:Inf
) norm
Output
An error.
LazySets.linear_map
— Methodlinear_map(M::AbstractMatrix{N}, ∅::EmptySet{N}) where {N}
Return the linear map of an empty set.
Input
M
– matrix∅
– empty set
Output
The empty set.
LazySets.translate
— Methodtranslate(∅::EmptySet, v::AbstractVector)
Translate (i.e., shift) an empty set by a given vector.
Input
∅
– empty setv
– translation vector
Output
The empty set.
LazySets.plot_recipe
— Methodplot_recipe(∅::EmptySet{N}, [ε]=zero(N)) where {N}
Convert an empty set to a sequence of points for plotting. In the special case of an empty set, we define the sequence as nothing
.
Input
∅
– empty setε
– (optional, default:0
) ignored, used for dispatch
Output
nothing
.
RecipesBase.apply_recipe
— Methodplot_emptyset(∅::EmptySet, [ε]::N=zero(N); ...)
Plot an empty set.
Input
∅
– empty setε
– (optional, default:0
) ignored, used for dispatch
LazySets.area
— Methodarea(X::LazySet{N}) where {N}
Compute the area of a two-dimensional polytopic set using the Shoelace formula.
Input
X
– two-dimensional set
Output
A number representing the area of X
.
Notes
This algorithm is applicable to any lazy set X
such that its list of vertices, vertices_list
, can be computed.
Algorithm
Let m
be the number of vertices of X
. The following instances are considered:
m = 0, 1, 2
: the output is zero.m = 3
: the triangle case is computed using the Shoelace formula with 3 points.m = 4
: the quadrilateral case is obtained by the factored version of the Shoelace formula with 4 points.
Otherwise, the general Shoelace formula is used; for detals see the wikipedia article Shoelace formula.
area(∅::EmptySet{N}) where {N}
Return the area of an empty set.
Input
∅
– empty set
Output
The zero element of type N
.
Inherited from LazySet
: