Centrally symmetric sets (AbstractCentrallySymmetric)
Centrally symmetric sets such as balls of different norms are characterized by a center. Note that there is a special interface combination Centrally symmetric polytope.
LazySets.AbstractCentrallySymmetric
— TypeAbstractCentrallySymmetric{N} <: ConvexSet{N}
Abstract type for centrally symmetric compact convex sets.
Notes
Every concrete AbstractCentrallySymmetric
must define the following function:
center(::AbstractCentrallySymmetric)
– return the center point
The subtypes of AbstractCentrallySymmetric
:
julia> subtypes(AbstractCentrallySymmetric)
2-element Vector{Any}:
AbstractBallp
Ellipsoid
This interface requires to implement the following functions:
LazySets.API.center
— Methodcenter(X::LazySet)
Compute the center of a centrally symmetric set.
Input
X
– centrally symmetric set
Output
A vector with the center, or midpoint, of X
.
This interface defines the following functions:
LazySets.API.an_element
— Methodan_element(S::AbstractCentrallySymmetric)
Return some element of a centrally symmetric set.
Input
S
– centrally symmetric set
Output
The center of the centrally symmetric set.
LazySets.API.dim
— Methoddim(S::AbstractCentrallySymmetric)
Return the ambient dimension of a centrally symmetric set.
Input
S
– centrally symmetric set
Output
The ambient dimension of the set.
LazySets.API.center
— Methodcenter(H::AbstractCentrallySymmetric, i::Int)
Return the center of a centrally symmetric set along a given dimension.
Input
S
– centrally symmetric seti
– dimension of interest
Output
The center along the given dimension.
Base.extrema
— Methodextrema(S::AbstractCentrallySymmetric)
Return two vectors with the lowest and highest coordinate of a centrally symmetric set.
Input
S
– centrally symmetric set
Output
Two vectors with the lowest and highest coordinates of S
.
Notes
The result is equivalent to (low(S), high(S))
.
Algorithm
We compute high(S)
and then compute the lowest coordinates with the help of center(S)
(which is assumed to be cheaper to obtain).
Base.extrema
— Methodextrema(S::AbstractCentrallySymmetric, i::Int)
Return the lower and higher coordinate of a centrally symmetric set in a given dimension.
Input
S
– centrally symmetric seti
– dimension of interest
Output
The lower and higher coordinate of the centrally symmetric set in the given dimension.
Notes
The result is equivalent to (low(S, i), high(S, i))
.
Algorithm
We compute high(S, i)
and then compute the lowest coordinates with the help of center(S, i)
(which is assumed to be cheaper to obtain).
LazySets.API.isbounded
— Methodisbounded(S::AbstractCentrallySymmetric)
Check whether a centrally symmetric set is bounded.
Input
S
– centrally symmetric set
Output
true
(since a set with a unique center must be bounded).
Base.isempty
— Methodisempty(S::AbstractCentrallySymmetric)
Check whether a centrally symmetric set is empty.
Input
S
– centrally symmetric set
Output
false
.
LazySets.API.isuniversal
— Functionisuniversal(S::AbstractCentrallySymmetric, [witness]::Bool=false)
Check whether a centrally symmetric set is universal.
Input
S
– centrally symmetric 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$
Algorithm
Centrally symmetric sets are bounded. A witness is obtained by computing the support vector in direction d = [1, 0, …, 0]
and adding d
on top.