Centrally symmetric polytopes (AbstractCentrallySymmetricPolytope)
A centrally symmetric polytope is a combination of two other interfaces: Centrally symmetric sets and Polytope.
LazySets.AbstractCentrallySymmetricPolytope
— TypeAbstractCentrallySymmetricPolytope{N} <: AbstractPolytope{N}
Abstract type for centrally symmetric, polytopic sets. It combines the AbstractCentrallySymmetric
and AbstractPolytope
interfaces. Such a type combination is necessary as long as Julia does not support multiple inheritance.
Notes
Every concrete AbstractCentrallySymmetricPolytope
must define the following methods:
- from
AbstractCentrallySymmetric
:center(::AbstractCentrallySymmetricPolytope)
– return the center pointcenter(::AbstractCentrallySymmetricPolytope, i::Int)
– return the center point at indexi
- from
AbstractPolytope
:vertices_list(::AbstractCentrallySymmetricPolytope)
– return a list of all vertices
The subtypes of AbstractCentrallySymmetricPolytope
(including abstract interfaces):
julia> subtypes(AbstractCentrallySymmetricPolytope)
2-element Vector{Any}:
AbstractZonotope
Ball1
This interface defines the following functions:
LazySets.API.an_element
— Methodan_element(P::AbstractCentrallySymmetricPolytope)
Return some element of a centrally symmetric, polytopic set.
Input
P
– centrally symmetric, polytopic set
Output
The center of the centrally symmetric, polytopic set.
LazySets.API.dim
— Methoddim(P::AbstractCentrallySymmetricPolytope)
Return the ambient dimension of a centrally symmetric, polytopic set.
Input
P
– centrally symmetric, polytopic set
Output
The ambient dimension of the polytopic set.
LazySets.API.center
— Methodcenter(S::AbstractCentrallySymmetricPolytope, i::Int)
Return the center of a centrally symmetric, polytopic set along a given dimension.
Input
S
– centrally symmetric, polytopic seti
– dimension of interest
Output
The center along the given dimension.
Base.extrema
— Methodextrema(S::AbstractCentrallySymmetricPolytope)
Return two vectors with the lowest and highest coordinate of a centrally symmetric, polytopic set.
Input
S
– centrally symmetric, polytopic 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::AbstractCentrallySymmetricPolytope, i::Int)
Return the lower and higher coordinate of a centrally symmetric, polytopic set in a given dimension.
Input
S
– centrally symmetric, polytopic seti
– dimension of interest
Output
The lower and higher coordinate of the centrally symmetric, polytopic 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).
Base.isempty
— Methodisempty(P::AbstractCentrallySymmetricPolytope)
Check whether a centrally symmetric, polytopic set is empty.
Input
P
– centrally symmetric, polytopic set
Output
false
.
LazySets.API.isuniversal
— Methodisuniversal(S::AbstractCentrallySymmetricPolytope{N},
[witness]::Bool=false) where {N}
Check whether a centrally symmetric, polytopic set is universal.
Input
S
– centrally symmetric, polytopic 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, polytopic sets are bounded. A witness is obtained by computing the support vector in direction d = [1, 0, …, 0]
and adding d
on top.