Singletons (AbstractSingleton)
A singleton is a special hyperrectangle consisting of only one point.
LazySets.AbstractSingleton
— TypeAbstractSingleton{N} <: AbstractHyperrectangle{N}
Abstract type for sets with a single value.
Notes
Every concrete AbstractSingleton
must define the following function:
element(::AbstractSingleton)
– return the single element
The following function is then automatically defined:
element(::AbstractSingleton, i::Int)
– return the single element at indexi
julia> subtypes(AbstractSingleton)
2-element Vector{Any}:
Singleton
ZeroSet
This interface requires to implement the following function:
LazySets.element
— Methodelement(S::AbstractSingleton)
Return the element of a set with a single value.
Input
S
– set with a single value
Output
The unique element of S
.
This interface defines the following functions:
LazySets.API.center
— Methodcenter(S::AbstractSingleton)
Return the center of a set with a single value.
Input
S
– set with a single value
Output
The center of the set.
LazySets.API.center
— Methodcenter(S::AbstractSingleton, i::Int)
Return the center of a set with a single value in a given dimension.
Input
S
– set with a single valuei
– dimension of interest
Output
The i
-th entry of the center of the set.
LazySets.element
— Methodelement(S::AbstractSingleton, i::Int)
Return the i-th entry of the element of a set with a single value.
Input
S
– set with a single valuei
– dimension of interest
Output
The i-th entry of the element.
LazySets.generators
— Methodgenerators(S::AbstractSingleton{N}) where {N}
Return an (empty) iterator over the generators of a set with a single value.
Input
S
– set with a single value
Output
An empty iterator.
LazySets.genmat
— Methodgenmat(S::AbstractSingleton{N}) where {N}
Return the (empty) generator matrix of a set with a single value.
Input
S
– set with a single value
Output
A matrix with no columns representing the generators of S
.
LazySets.API.high
— Methodhigh(S::AbstractSingleton)
Return the higher coordinates of a set with a single value.
Input
S
– set with a single value
Output
A vector with the higher coordinates.
LazySets.API.high
— Methodhigh(S::AbstractSingleton, i::Int)
Return the higher coordinate of a set with a single value in the given dimension.
Input
S
– set with a single valuei
– dimension of interest
Output
The higher coordinate in the given dimension.
LazySets.API.low
— Methodlow(S::AbstractSingleton)
Return the lower coordinates of a set with a single value.
Input
S
– set with a single value
Output
A vector with the lower coordinates.
LazySets.API.low
— Methodlow(S::AbstractSingleton, i::Int)
Return the lower coordinate of a set with a single value in the given dimension.
Input
S
– set with a single valuei
– dimension of interest
Output
The lower coordinate in the given dimension.
LazySets.ngens
— Methodngens(S::AbstractSingleton)
Return the number of generators of a set with a single value.
Input
H
– set with a single value
Output
The number of generators, which is $0$.
LazySets.radius_hyperrectangle
— Methodradius_hyperrectangle(S::AbstractSingleton{N}) where {N}
Return the box radius of a set with a single value in every dimension.
Input
S
– set with a single value
Output
The zero vector.
LazySets.radius_hyperrectangle
— Methodradius_hyperrectangle(S::AbstractSingleton{N}, i::Int) where {N}
Return the box radius of a set with a single value in a given dimension.
Input
S
– set with a single valuei
– dimension of interest
Output
Zero.
LazySets.API.reflect
— Methodreflect(S::AbstractSingleton)
Concrete reflection of a set with a single value S
, resulting in the reflected set -S
.
Input
S
– set with a single value
Output
A Singleton
representing -S
.
LazySets.API.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.
LazySets.API.vertices_list
— Methodvertices_list(S::AbstractSingleton)
Return the list of vertices of a set with a single value.
Input
S
– set with a single value
Output
A list containing only a single vertex.
Base.:∈
— Method∈(x::AbstractVector, S::AbstractSingleton)
Check whether a given point is contained in a set with a single value.
Input
x
– point/vectorS
– set with a single value
Output
true
iff $x ∈ S$.
Notes
This implementation performs an approximate comparison to account for imprecision in floating-point computations.
LazySets.API.ρ
— Methodρ(d::AbstractVector, S::AbstractSingleton)
Evaluate the support function of a set with a single value in a given direction.
Input
d
– directionS
– set with a single value
Output
The support value in the given direction.
LazySets.API.σ
— Methodσ(d::AbstractVector, S::AbstractSingleton)
Return the support vector of a set with a single value.
Input
d
– directionS
– set with a single value
Output
The support vector, which is the set's vector itself, irrespective of the given direction.
LazySets.plot_recipe
— Methodplot_recipe(S::AbstractSingleton{N}, [ε]=zero(N)) where {N}
Convert a singleton to a pair (x, y)
of points for plotting.
Input
S
– singletonε
– (optional, default:0
) ignored, used for dispatch
Output
A pair (x, y)
of one point that can be plotted.
RecipesBase.apply_recipe
— Methodplot_singleton(S::AbstractSingleton{N}, [ε]::Real=zero(N); ...) where {N}
Plot a singleton.
Input
S
– singletonε
– (optional, default:0
) ignored, used for dispatch
Examples
julia> plot(Singleton([0.5, 1.0]))