Union
Note that the union of convex sets is generally not convex. Hence these set types are not part of the convex-set family LazySet
.
Binary set union (UnionSet)
LazySets.UnionSet
— TypeUnionSet{N, S1<:LazySet{N}, S2<:LazySet{N}}
Type that represents the set union of two convex sets.
Fields
X
– convex setY
– convex set
Base.:∪
— Method∪
Alias for UnionSet
.
LazySets.swap
— Methodswap(cup::UnionSet)
Return a new UnionSet
object with the arguments swapped.
Input
cup
– union of two convex sets
Output
A new UnionSet
object with the arguments swapped.
LazySets.dim
— Methoddim(cup::UnionSet)
Return the dimension of the set union of two convex sets.
Input
cup
– union of two convex sets
Output
The ambient dimension of the union of two convex sets.
LazySets.σ
— Methodσ(d::AbstractVector, cup::UnionSet; [algorithm]="support_vector")
Return the support vector of the union of two convex sets in a given direction.
Input
d
– directioncup
– union of two convex setsalgorithm
– (optional, default: "supportvector"): the algorithm to compute the support vector; if "supportvector", use the support vector of each argument; if "support_function" use the support function of each argument and evaluate the support vector of only one of them
Output
The support vector in the given direction.
Algorithm
The support vector of the union of two convex sets $X$ and $Y$ can be obtained as the vector that maximizes the support function of either $X$ or $Y$, i.e. it is sufficient to find the $\argmax(ρ(d, X), ρ(d, Y)])$ and evaluate its support vector.
The default implementation, with option algorithm="support_vector"
, computes the support vector of $X$ and $Y$ and then compares the support function using a dot product. If it happens that the support function can be more efficiently computed (without passing through the support vector), consider using the alternative algorithm="support_function"
implementation, which evaluates the support function of each set directly and then calls only the support vector of either $X$ or $Y$.
LazySets.ρ
— Methodρ(d::AbstractVector, cup::UnionSet)
Return the support function of the union of two convex sets in a given direction.
Input
d
– directioncup
– union of two convex sets
Output
The support function in the given direction.
Algorithm
The support function of the union of two convex sets $X$ and $Y$ is the maximum of the support functions of $X$ and $Y$.
LazySets.an_element
— Methodan_element(cup::UnionSet)
Return some element of a union of two convex sets.
Input
cup
– union of two convex sets
Output
An element in the union of two convex sets.
Algorithm
We use an_element
on the first wrapped set.
Base.:∈
— Method∈(x::AbstractVector, cup::UnionSet)
Check whether a given point is contained in a union of two convex sets.
Input
x
– point/vectorcup
– union of two convex sets
Output
true
iff $x ∈ cup$.
Base.isempty
— Methodisempty(cup::UnionSet)
Check whether a union of two convex sets is empty.
Input
cup
– union of two convex sets
Output
true
iff the union is empty.
LazySets.isbounded
— Methodisbounded(cup::UnionSet)
Determine whether a union of two convex sets is bounded.
Input
cup
– union of two convex sets
Output
true
iff the union is bounded.
LazySets.vertices_list
— Methodvertices_list(cup::UnionSet; apply_convex_hull::Bool=false, backend=nothing)
Return the list of vertices of a union of two convex sets.
Input
cup
– union of two convex setsapply_convex_hull
– (optional, default:false
) iftrue
, post-process the vertices using a convex-hull algorithmbackend
– (optional, default:nothing
) backend for computing the convex hull (see argumentapply_convex_hull
)
Output
The list of vertices, possibly reduced to the list of vertices of the convex hull.
Inherited from LazySet
:
$n$-ary set union (UnionSetArray)
LazySets.UnionSetArray
— TypeUnionSetArray{N, S<:LazySet{N}}
Type that represents the set union of a finite number of convex sets.
Fields
array
– array of convex sets
LazySets.dim
— Methoddim(cup::UnionSetArray)
Return the dimension of the set union of a finite number of convex sets.
Input
cup
– union of a finite number of convex sets
Output
The ambient dimension of the union of a finite number of convex sets.
LazySets.array
— Methodarray(cup::UnionSetArray)
Return the array of a union of a finite number of convex sets.
Input
cup
– union of a finite number of convex sets
Output
The array that holds the union of a finite number of convex sets.
LazySets.σ
— Methodσ(d::AbstractVector, cup::UnionSetArray; [algorithm]="support_vector")
Return the support vector of the union of a finite number of convex sets in a given direction.
Input
d
– directioncup
– union of a finite number of convex setsalgorithm
– (optional, default: "supportvector"): the algorithm to compute the support vector; if "supportvector", use the support vector of each argument; if "support_function" use the support function of each argument and evaluate the support vector of only one of them
Output
The support vector in the given direction.
Algorithm
The support vector of the union of a finite number of convex sets $X₁, X₂, ...$ can be obtained as the vector that maximizes the support function, i.e. it is sufficient to find the $\argmax(ρ(d, X₂), ρ(d, X₂), ...])$ and evaluate its support vector.
The default implementation, with option algorithm="support_vector"
, computes the support vector of all $X₁, X₂, ...$ and then compares the support function using a dot product. If it happens that the support function can be more efficiently computed (without passing through the support vector), consider using the alternative algorithm="support_function"
implementation, which evaluates the support function of each set directly and then calls only the support vector of one of the $Xᵢ$.
LazySets.ρ
— Methodρ(d::AbstractVector, cup::UnionSetArray)
Return the support function of the union of a finite number of convex sets in a given direction.
Input
d
– directioncup
– union of a finite number of convex sets
Output
The support function in the given direction.
Algorithm
The support function of the union of a finite number of convex sets $X₁, X₂, ...$ can be obtained as the maximum of $ρ(d, X₂), ρ(d, X₂), ...$.
LazySets.an_element
— Methodan_element(cup::UnionSetArray)
Return some element of a union of a finite number of convex sets.
Input
cup
– union of a finite number of convex sets
Output
An element in the union of a finite number of convex sets.
Algorithm
We use an_element
on the first wrapped set.
Base.:∈
— Method∈(x::AbstractVector, cup::UnionSetArray)
Check whether a given point is contained in a union of a finite number of convex sets.
Input
x
– point/vectorcup
– union of a finite number of convex sets
Output
true
iff $x ∈ cup$.
Base.isempty
— Methodisempty(cup::UnionSetArray)
Check whether a union of a finite number of convex sets is empty.
Input
cup
– union of a finite number of convex sets
Output
true
iff the union is empty.
LazySets.isbounded
— Methodisbounded(cup::UnionSetArray)
Determine whether a union of a finite number of convex sets is bounded.
Input
cup
– union of a finite number of convex sets
Output
true
iff the union is bounded.
LazySets.vertices_list
— Methodvertices_list(cup::UnionSetArray; apply_convex_hull::Bool=false,
backend=nothing)
Return the list of vertices of a union of a finite number of convex sets.
Input
cup
– union of a finite number of convex setsapply_convex_hull
– (optional, default:false
) iftrue
, post-process the vertices using a convex-hull algorithmbackend
– (optional, default:nothing
) backend for computing the convex hull (see argumentapply_convex_hull
)
Output
The list of vertices, possibly reduced to the list of vertices of the convex hull.
Inherited from LazySet
: