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

Every concrete AbstractSingleton must define the following function:

  • element(::AbstractSingleton) – return the single element
  • element(::AbstractSingleton, i::Int) – return the single element at index i
julia> subtypes(AbstractSingleton)
2-element Vector{Any}:
 Singleton
 ZeroSet
source

This interface defines the following functions:

LazySets.σMethod
σ(d::AbstractVector, S::AbstractSingleton)

Return the support vector of a set with a single value.

Input

  • d – direction
  • S – set with a single value

Output

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

source
LazySets.ρMethod
ρ(d::AbstractVector, S::AbstractSingleton)

Evaluate the support function of a set with a single value in a given direction.

Input

  • d – direction
  • S – set with a single value

Output

The support value in the given direction.

source
Base.:∈Method
∈(x::AbstractVector, S::AbstractSingleton)

Check whether a given point is contained in a set with a single value.

Input

  • x – point/vector
  • S – 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.

source
LazySets.centerMethod
center(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.

source
LazySets.centerMethod
center(S::AbstractSingleton, i::Int)

Return the center of a set with a single value in a given dimension.

Input

  • S – set with a single value
  • i – dimension of interest

Output

The i-th entry of the center of the set.

source
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.verticesMethod
vertices(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.

source
LazySets.vertices_listMethod
vertices_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.

source
LazySets.radius_hyperrectangleMethod
radius_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.

source
LazySets.radius_hyperrectangleMethod
radius_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 value
  • i – dimension of interest

Output

Zero.

source
LazySets.highMethod
high(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.

source
LazySets.highMethod
high(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 value
  • i – dimension of interest

Output

The higher coordinate in the given dimension.

source
LazySets.lowMethod
low(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.

source
LazySets.lowMethod
low(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 value
  • i – dimension of interest

Output

The lower coordinate in the given dimension.

source
LazySets.generatorsMethod
generators(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.

source
LazySets.genmatMethod

genmat(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.

source
LazySets.ngensMethod
ngens(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$.

source
LazySets.reflectMethod
reflect(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.

source
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