Affine maps (AbstractAffineMap)

An affine map consists of a linear map and a translation.

LazySets.AbstractAffineMapType
AbstractAffineMap{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 map
  • vector(::AbstractAffineMap) – return the affine translation vector
  • set(::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
source

This interface requires to implement the following functions:

LazySets.matrixMethod
matrix(X::AbstractAffineMap)

Return the matrix of an affine map.

Input

  • X – affine map

Output

The matrix of X.

source
LazySets.vectorMethod
vector(X::AbstractAffineMap)

Return the vector of an affine map.

Input

  • X – affine map

Output

The vector of X.

source
LazySets.setMethod
set(X::AbstractAffineMap)

Return the set of an affine map.

Input

  • X – affine map

Output

The set of X before applying the map.

source

This interface defines the following functions:

LazySets.API.an_elementMethod
an_element(X::LazySet)

Return some element of a nonempty set.

Input

  • X – set

Output

An element of X unless X is empty.

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

source
LazySets.API.centerMethod

Extended help

center(am::AbstractAffineMap)

Algorithm

The implementation relies on the center method of the wrapped set.

source
LazySets.API.constraints_listMethod
constraints_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.

source
LazySets.API.constraints_listMethod

Extended 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.

source
LazySets.API.isboundedMethod

Extended 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.

source
Base.isemptyMethod
isempty(X::LazySet, witness::Bool=false)

Check whether a set is empty.

Input

  • X – set
  • witness – (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$
source
Base.isemptyMethod

Extended help

isempty(am::AbstractAffineMap)

Algorithm

The result is true iff the wrapped set is empty.

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, 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
source
LazySets.API.vertices_listMethod
vertices_list(X::LazySet)

Compute a list of vertices of a polytopic set.

Input

  • X – polytopic set

Output

A list of the vertices of X.

source
LazySets.API.vertices_listMethod

Extended help

vertices_list(am::AbstractAffineMap; [apply_convex_hull]::Bool=true)

Input

  • apply_convex_hull – (optional, default: true) if true, 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.

source

Undocumented implementations:

Inherited from LazySet:

Implementations