Translation

LazySets.TranslationType
Translation{N, S<:LazySet{N}, VN<:AbstractVector{N}}
    <: AbstractAffineMap{N, S}

Type that represents a lazy translation.

The translation of set X along vector v is the map:

\[x ↦ x + v,\qquad x ∈ X\]

A translation is a special case of an affine map $A x + b, x ∈ X$ where the linear map $A$ is the identity matrix and the translation vector $b$ is $v$.

Fields

  • X – set
  • v – vector that defines the translation

Notes

Translation preserves convexity: if X is convex, then any translation of X is convex as well.

Example

julia> X = BallInf([2.0, 2.0, 2.0], 1.0);

julia> v = [1.0, 0.0, 0.0]; # translation along dimension 1

julia> tr = Translation(X, v);

julia> typeof(tr)
Translation{Float64, BallInf{Float64, Vector{Float64}}, Vector{Float64}}

julia> tr.X
BallInf{Float64, Vector{Float64}}([2.0, 2.0, 2.0], 1.0)

julia> tr.v
3-element Vector{Float64}:
 1.0
 0.0
 0.0

Both the sum operator + and the Minkowski-sum operator are overloaded to create translations:

julia> X + v == X ⊕ v == Translation(X, v)
true

The translation of a translation is performed immediately:

julia> tr = (X + v) + v
Translation{Float64, BallInf{Float64, Vector{Float64}}, Vector{Float64}}(BallInf{Float64, Vector{Float64}}([2.0, 2.0, 2.0], 1.0), [2.0, 0.0, 0.0])

julia> tr.v
3-element Vector{Float64}:
 2.0
 0.0
 0.0

The dimension of a translation is obtained with the dim function:

julia> dim(tr)
3

For the support vector (resp. support function) along vector d, use σ and ρ, respectively:

julia> σ([1.0, 0.0, 0.0], tr)
3-element Vector{Float64}:
 5.0
 2.0
 2.0

julia> ρ([1.0, 0.0, 0.0], tr)
5.0

See the docstring of each of these functions for details.

The an_element function is useful to obtain an element of a translation:

julia> e = an_element(tr)
3-element Vector{Float64}:
 4.0
 2.0
 2.0

The lazy linear map of a translation is an affine map, since the following simplification rule applies: $M * (X ⊕ v) = (M * X) ⊕ (M * v)$:

julia> using LinearAlgebra: I

julia> M = Matrix(2.0I, 3, 3);

julia> Q = M * tr;

julia> Q isa AffineMap && Q.M == M && Q.X == tr.X && Q.v == 2 * tr.v
true

Use the isempty method to check whether the translation is empty:

julia> isempty(tr)
false

The list of constraints of the translation of a polyhedral set (a set whose constraints_list is available) can be computed from a lazy translation:

julia> constraints_list(tr)
6-element Vector{HalfSpace{Float64, ReachabilityBase.Arrays.SingleEntryVector{Float64}}}:
 HalfSpace{Float64, ReachabilityBase.Arrays.SingleEntryVector{Float64}}([1.0, 0.0, 0.0], 5.0)
 HalfSpace{Float64, ReachabilityBase.Arrays.SingleEntryVector{Float64}}([0.0, 1.0, 0.0], 3.0)
 HalfSpace{Float64, ReachabilityBase.Arrays.SingleEntryVector{Float64}}([0.0, 0.0, 1.0], 3.0)
 HalfSpace{Float64, ReachabilityBase.Arrays.SingleEntryVector{Float64}}([-1.0, 0.0, 0.0], -3.0)
 HalfSpace{Float64, ReachabilityBase.Arrays.SingleEntryVector{Float64}}([0.0, -1.0, 0.0], -1.0)
 HalfSpace{Float64, ReachabilityBase.Arrays.SingleEntryVector{Float64}}([0.0, 0.0, -1.0], -1.0)
source
Base.:+Method
+(X::LazySet, v::AbstractVector)

Convenience constructor for a translation.

Input

  • X – set
  • v – vector

Output

The symbolic translation of $X$ along vector $v$.

source
LazySets.:⊕Method
⊕(X::LazySet, v::AbstractVector)

Unicode alias constructor ⊕ (oplus) for the lazy translation operator.

source
LazySets.ρMethod
ρ(d::AbstractVector, tr::Translation)

Evaluate the support function of a translation.

Input

  • d – direction
  • tr – translation of a set

Output

The evaluation of the support function in the given direction.

source
LazySets.σMethod
σ(d::AbstractVector, tr::Translation)

Return a support vector of a translation.

Input

  • d – direction
  • tr – translation of a set

Output

A support vector in the given direction. If the direction has norm zero, the result depends on the wrapped set.

source
LazySets.an_elementMethod
an_element(tr::Translation)

Return some element of a translation.

Input

  • tr – translation of a set

Output

An element in the translation.

Notes

This function first asks for an_element of the wrapped set, then translates this element according to the given translation vector.

source
LazySets.constraints_listMethod
constraints_list(tr::Translation)

Return a list of constraints of the translation of a set.

Input

  • tr – translation of a polyhedron

Output

A list of constraints of the translation.

Notes

We assume that the set wrapped by the lazy translation X offers a method constraints_list(⋅).

Algorithm

Let the translation be defined by the set of points y such that y = x + v for all x ∈ X. Then, each defining halfspace a⋅x ≤ b is transformed to a⋅y ≤ b + a⋅v.

source
LazySets.linear_mapMethod
linear_map(M::AbstractMatrix, tr::Translation)

Concrete linear map of a translation.

Input

  • M – matrix
  • tr – translation of a set

Output

A concrete set corresponding to the linear map. The type of the result depends on the type of the set wrapped by tr.

Algorithm

We compute translate(linear_map(M, tr.X), M * tr.v).

source
Base.:∈Method
∈(x::AbstractVector, tr::Translation)

Check whether a given point is contained in the translation of a set.

Input

  • x – point/vector
  • tr – translation of a set

Output

true iff $x ∈ tr$.

Algorithm

This implementation relies on the set-membership function for the wrapped set tr.X, since $x ∈ X ⊕ v$ iff $x - v ∈ X$.

source
LazySets.centerMethod
center(tr::Translation)

Return the center of the translation of a centrally-symmetric set.

Input

  • tr – translation of a centrally-symmetric set

Output

The translation of the center of the wrapped set by the translation vector.

source

Inherited from LazySet:

Inherited from AbstractAffineMap: