Singletons (AbstractSingleton)

A singleton is a special hyperrectangle consisting of only one point.

LazySets.AbstractSingletonType
AbstractSingleton{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 index i
julia> subtypes(AbstractSingleton)
2-element Vector{Any}:
 Singleton
 ZeroSet
source

This interface requires to implement the following function:

LazySets.elementMethod
element(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.

source

This interface defines the following functions:

LazySets.elementMethod
element(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 value
  • i – dimension of interest

Output

The i-th entry of the element.

source
LazySets.API.reflectMethod
reflect(X::LazySet)

Compute the reflection of a set in the origin.

Input

  • X – set

Output

A set representing the reflection $-X$.

source
Base.:∈Method
∈(x::AbstractVector, X::LazySet)

Check whether a point lies in a set.

Input

  • x – point/vector
  • X – set

Output

true iff $x ∈ X$.

source
Base.:∈Method

Extended help

∈(x::AbstractVector, S::AbstractSingleton)

Notes

This implementation performs an approximate comparison to account for imprecision in floating-point computations.

source
LazySets.API.σMethod
σ(d::AbstractVector, X::LazySet)

Compute a support vector of a set in a given direction.

Input

  • d – direction
  • X – set

Output

A support vector of X in direction d.

Notes

A convenience alias support_vector is also available.

source
LazySets.API.σMethod

Extended help

σ(d::AbstractVector, S::AbstractSingleton)

Algorithm

The support vector is the set's vector itself, irrespective of the given direction.

source

Undocumented implementations:

Inherited from LazySet:

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_recipeMethod
plot_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.

source
RecipesBase.apply_recipeMethod
plot_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]))
source

Implementations