Affine maps (AbstractAffineMap)
An affine map consists of a linear map and a translation.
LazySets.AbstractAffineMap
— TypeAbstractAffineMap{N, S<:LazySet{N}} <: LazySet{N}
Abstract type for affine maps.
Notes
See AffineMap
for a standard implementation of this interface.
Every concrete AbstractAffineMap
must define the following methods:
matrix(::AbstractAffineMap)
– return the linear mapvector(::AbstractAffineMap)
– return the affine translation vectorset(::AbstractAffineMap)
– return the set that the map is applied to
The subtypes of AbstractAffineMap
:
julia> subtypes(AbstractAffineMap)
7-element Vector{Any}:
AffineMap
ExponentialMap
ExponentialProjectionMap
InverseLinearMap
LinearMap
ResetMap
Translation
This interface requires to implement the following functions:
LazySets.matrix
— Methodmatrix(X::AbstractAffineMap)
Return the matrix of an affine map.
Input
X
– affine map
Output
The matrix of X
.
LazySets.vector
— Methodvector(X::AbstractAffineMap)
Return the vector of an affine map.
Input
X
– affine map
Output
The vector of X
.
LazySets.set
— Methodset(X::AbstractAffineMap)
Return the set of an affine map.
Input
X
– affine map
Output
The set of X
before applying the map.
This interface defines the following functions:
LazySets.API.an_element
— Methodan_element(X::LazySet)
Return some element of a nonempty set.
Input
X
– set
Output
An element of X
unless X
is empty.
LazySets.API.an_element
— MethodExtended help
Algorithm
The implementation relies on the an_element
method of the wrapped set.
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
.
LazySets.API.center
— MethodExtended help
center(am::AbstractAffineMap)
Algorithm
The implementation relies on the center
method of the wrapped set.
LazySets.API.constraints_list
— Methodconstraints_list(X::LazySet)
Compute a list of linear constraints of a polyhedral set.
Input
X
– polyhedral set
Output
A list of the linear constraints of X
.
LazySets.API.constraints_list
— MethodExtended help
constraints_list(am::AbstractAffineMap)
Notes
We assume that the underlying set X
is polyhedral, i.e., offers a method constraints_list(X)
.
Algorithm
This implementation uses the constraints_list
method to compute the list of constraints of the translation of a lazy LinearMap
.
LazySets.API.isbounded
— Methodisbounded(X::LazySet)
Check whether a set is bounded.
Input
X
– set
Output
true
iff the set is bounded.
Notes
See also isboundedtype(::Type{<:LazySet})
.
LazySets.API.isbounded
— MethodExtended help
isbounded(am::AbstractAffineMap; cond_tol::Number=DEFAULT_COND_TOL)
Input
cond_tol
– (optional) tolerance of matrix condition (used to check whether the matrix is invertible)
Algorithm
We first check if the matrix is zero or the wrapped set is bounded. If not, we perform a sufficient check whether the matrix is invertible. If the matrix is invertible, then the map being bounded is equivalent to the wrapped set being bounded, and hence the map is unbounded. Otherwise, we check boundedness via _isbounded_unit_dimensions
.
Base.isempty
— Methodisempty(X::LazySet, witness::Bool=false)
Check whether a set is empty.
Input
X
– setwitness
– (optional, default:false
) compute a witness if activated
Output
- If the
witness
option is deactivated:true
iff $X = ∅$ - If the
witness
option is activated:(true, [])
iff $X = ∅$(false, v)
iff $X ≠ ∅$ for some $v ∈ X$
Base.isempty
— MethodExtended help
isempty(am::AbstractAffineMap)
Algorithm
The result is true
iff the wrapped set is empty.
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, am::AbstractAffineMap)
Algorithm
Observe that $x ∈ M⋅S ⊕ v$ iff $M^{-1}⋅(x - v) ∈ S$. This implementation does not explicitly invert the matrix, which is why it also works for non-square matrices.
Examples
julia> am = AffineMap([2.0 0.0; 0.0 1.0], BallInf([1., 1.], 1.), [-1.0, -1.0]);
julia> [5.0, 1.0] ∈ am
false
julia> [3.0, 1.0] ∈ am
true
An example with a non-square matrix:
julia> B = BallInf(zeros(4), 1.);
julia> M = [1. 0 0 0; 0 1 0 0]/2;
julia> [0.5, 0.5] ∈ M*B
true
LazySets.API.vertices_list
— Methodvertices_list(X::LazySet)
Compute a list of vertices of a polytopic set.
Input
X
– polytopic set
Output
A list of the vertices of X
.
LazySets.API.vertices_list
— MethodExtended help
vertices_list(am::AbstractAffineMap; [apply_convex_hull]::Bool=true)
Input
apply_convex_hull
– (optional, default:true
) iftrue
, apply the convex hull operation to the list of vertices transformed by the affine map
Algorithm
This implementation computes all vertices of X
, then transforms them through the affine map, i.e., x ↦ M*x + v
for each vertex x
of X
. By default, the convex-hull operation is taken before returning this list. For dimensions three or higher, this operation relies on the functionality through the concrete polyhedra library Polyhedra.jl
.
If you are not interested in taking the convex hull of the resulting vertices under the affine map, pass apply_convex_hull=false
as a keyword argument.
Note that we assume that the underlying set X
is polytopic, either concretely or lazily, i.e., the function vertices_list
should be applicable.
Undocumented implementations:
Inherited from LazySet
:
area
chebyshev_center_radius
complement
concretize
constraints
convex_hull
copy(::Type{LazySet})
delaunay
diameter
eltype
eltype
extrema
extrema
high
high
isboundedtype
isoperation
low
low
norm
polyhedron
radius
rationalize
rectify
reflect
singleton_list
surface
tosimplehrep
triangulate
vertices
affine_map
exponential_map
is_interior_point
project
sample
scale
translate
cartesian_product
convex_hull
exact_sum
≈
isdisjoint
==
isequivalent
⊂
⊆
linear_combination
minkowski_difference
minkowski_sum