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
See Singleton
for a standard implementation of this interface.
Every concrete AbstractSingleton
must define the following function:
element(::AbstractSingleton)
– return the single element
Among other functions, 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.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.API.reflect
— Methodreflect(X::LazySet)
Compute the reflection of a set in the origin.
Input
X
– set
Output
A set representing the reflection $-X$.
LazySets.API.reflect
— MethodExtended help
reflect(S::AbstractSingleton)
Output
A Singleton
.
Base.:∈
— Method∈(x::AbstractVector, X::LazySet)
Check whether a point lies in a set.
Input
x
– point/vectorX
– set
Output
true
iff $x ∈ X$.
Base.:∈
— MethodExtended help
∈(x::AbstractVector, S::AbstractSingleton)
Notes
This implementation performs an approximate comparison to account for imprecision in floating-point computations.
LazySets.API.σ
— Methodσ(d::AbstractVector, X::LazySet)
Compute a support vector of a set in a given direction.
Input
d
– directionX
– set
Output
A support vector of X
in direction d
.
Notes
A convenience alias support_vector
is also available.
LazySets.API.σ
— MethodExtended help
σ(d::AbstractVector, S::AbstractSingleton)
Algorithm
The support vector is the set's vector itself, irrespective of the given direction.
Undocumented implementations:
Inherited from LazySet
:
complement
concretize
constraints
convex_hull
copy(::Type{LazySet})
delaunay
diameter
eltype
eltype
isoperation
polyhedron
rationalize
singleton_list
surface
tosimplehrep
triangulate
affine_map
exponential_map
is_interior_point
sample
scale
translate
convex_hull
exact_sum
≈
==
⊂
Inherited from ConvexSet
:
Inherited from AbstractPolyhedron
:
Inherited from AbstractPolytope
:
Inherited from AbstractCentrallySymmetricPolytope
:
Inherited from AbstractZonotope
:
Inherited from AbstractHyperrectangle
:
Plotting singletons is available too:
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]))