Binary Functions on Sets

Binary Functions on Sets

This section of the manual describes the binary functions for set types.

Subset check

Base.:⊆Function.

Alias for is_subset.

is a Julia-internal function which is defined for every type combination, but crashes with a cryptic error message if it is not implemented:

`MethodError: no method matching start(::FIRST_SET_TYPE)`
source
LazySets.is_subsetMethod.
is_subset(S::LazySet{N}, H::AbstractHyperrectangle{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a convex set is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • S – inner convex set

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ H$

  • If witness option is activated:

    • (true, []) iff $S ⊆ H$

    • (false, v) iff $S \not\subseteq H$ and $v ∈ S \setminus H$

Algorithm

$S ⊆ H$ iff $\operatorname{ihull}(S) ⊆ H$, where $\operatorname{ihull}$ is the interval hull operator.

source
LazySets.is_subsetMethod.
is_subset(S::LazySet{N}, H::AbstractHyperrectangle{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a convex set is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • S – inner convex set

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ H$

  • If witness option is activated:

    • (true, []) iff $S ⊆ H$

    • (false, v) iff $S \not\subseteq H$ and $v ∈ S \setminus H$

Algorithm

$S ⊆ H$ iff $\operatorname{ihull}(S) ⊆ H$, where $\operatorname{ihull}$ is the interval hull operator.

source
is_subset(P::AbstractPolytope{N},
          H::AbstractHyperrectangle,
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ H$

  • If witness option is activated:

    • (true, []) iff $P ⊆ H$

    • (false, v) iff $P \not\subseteq H$ and $v ∈ P \setminus H$

Notes

This copy-pasted method just exists to avoid method ambiguities.

Algorithm

Since $H$ is convex, $P ⊆ H$ iff $v_i ∈ H$ for all vertices $v_i$ of $P$.

source
is_subset(P::AbstractPolytope{N}, S::LazySet{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a convex set, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • S – outer convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ S$

  • If witness option is activated:

    • (true, []) iff $P ⊆ S$

    • (false, v) iff $P \not\subseteq S$ and $v ∈ P \setminus S$

Algorithm

Since $S$ is convex, $P ⊆ S$ iff $v_i ∈ S$ for all vertices $v_i$ of $P$.

source
LazySets.is_subsetMethod.
is_subset(S::LazySet{N}, H::AbstractHyperrectangle{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a convex set is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • S – inner convex set

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ H$

  • If witness option is activated:

    • (true, []) iff $S ⊆ H$

    • (false, v) iff $S \not\subseteq H$ and $v ∈ S \setminus H$

Algorithm

$S ⊆ H$ iff $\operatorname{ihull}(S) ⊆ H$, where $\operatorname{ihull}$ is the interval hull operator.

source
is_subset(P::AbstractPolytope{N},
          H::AbstractHyperrectangle,
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ H$

  • If witness option is activated:

    • (true, []) iff $P ⊆ H$

    • (false, v) iff $P \not\subseteq H$ and $v ∈ P \setminus H$

Notes

This copy-pasted method just exists to avoid method ambiguities.

Algorithm

Since $H$ is convex, $P ⊆ H$ iff $v_i ∈ H$ for all vertices $v_i$ of $P$.

source
is_subset(H1::AbstractHyperrectangle{N},
          H2::AbstractHyperrectangle{N},
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a given hyperrectangle is contained in another hyperrectangle, and if not, optionally compute a witness.

Input

  • H1 – inner hyperrectangle

  • H2 – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H1 ⊆ H2$

  • If witness option is activated:

    • (true, []) iff $H1 ⊆ H2$

    • (false, v) iff $H1 \not\subseteq H2$ and $v ∈ H1 \setminus H2$

Algorithm

$H1 ⊆ H2$ iff $c_1 + r_1 ≤ c_2 + r_2 ∧ c_1 - r_1 ≥ c_2 - r_2$ iff $r_1 - r_2 ≤ c_1 - c_2 ≤ -(r_1 - r_2)$, where $≤$ is taken component-wise.

source
is_subset(P::AbstractPolytope{N}, S::LazySet{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a convex set, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • S – outer convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ S$

  • If witness option is activated:

    • (true, []) iff $P ⊆ S$

    • (false, v) iff $P \not\subseteq S$ and $v ∈ P \setminus S$

Algorithm

Since $S$ is convex, $P ⊆ S$ iff $v_i ∈ S$ for all vertices $v_i$ of $P$.

source
LazySets.is_subsetMethod.
is_subset(P::AbstractPolytope{N}, S::LazySet{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a convex set, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • S – outer convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ S$

  • If witness option is activated:

    • (true, []) iff $P ⊆ S$

    • (false, v) iff $P \not\subseteq S$ and $v ∈ P \setminus S$

Algorithm

Since $S$ is convex, $P ⊆ S$ iff $v_i ∈ S$ for all vertices $v_i$ of $P$.

source
LazySets.is_subsetMethod.
is_subset(P::AbstractPolytope{N}, S::LazySet{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a convex set, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • S – outer convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ S$

  • If witness option is activated:

    • (true, []) iff $P ⊆ S$

    • (false, v) iff $P \not\subseteq S$ and $v ∈ P \setminus S$

Algorithm

Since $S$ is convex, $P ⊆ S$ iff $v_i ∈ S$ for all vertices $v_i$ of $P$.

source
is_subset(S::AbstractSingleton{N}, set::LazySet{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a given set with a single value is contained in a convex set, and if not, optionally compute a witness.

Input

  • S – inner set with a single value

  • set – outer convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ \text{set}$

  • If witness option is activated:

    • (true, []) iff $S ⊆ \text{set}$

    • (false, v) iff $S \not\subseteq \text{set}$ and $v ∈ S \setminus \text{set}$

source
LazySets.is_subsetMethod.
is_subset(S::LazySet{N}, H::AbstractHyperrectangle{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a convex set is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • S – inner convex set

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ H$

  • If witness option is activated:

    • (true, []) iff $S ⊆ H$

    • (false, v) iff $S \not\subseteq H$ and $v ∈ S \setminus H$

Algorithm

$S ⊆ H$ iff $\operatorname{ihull}(S) ⊆ H$, where $\operatorname{ihull}$ is the interval hull operator.

source
is_subset(P::AbstractPolytope{N},
          H::AbstractHyperrectangle,
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ H$

  • If witness option is activated:

    • (true, []) iff $P ⊆ H$

    • (false, v) iff $P \not\subseteq H$ and $v ∈ P \setminus H$

Notes

This copy-pasted method just exists to avoid method ambiguities.

Algorithm

Since $H$ is convex, $P ⊆ H$ iff $v_i ∈ H$ for all vertices $v_i$ of $P$.

source
is_subset(H1::AbstractHyperrectangle{N},
          H2::AbstractHyperrectangle{N},
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a given hyperrectangle is contained in another hyperrectangle, and if not, optionally compute a witness.

Input

  • H1 – inner hyperrectangle

  • H2 – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H1 ⊆ H2$

  • If witness option is activated:

    • (true, []) iff $H1 ⊆ H2$

    • (false, v) iff $H1 \not\subseteq H2$ and $v ∈ H1 \setminus H2$

Algorithm

$H1 ⊆ H2$ iff $c_1 + r_1 ≤ c_2 + r_2 ∧ c_1 - r_1 ≥ c_2 - r_2$ iff $r_1 - r_2 ≤ c_1 - c_2 ≤ -(r_1 - r_2)$, where $≤$ is taken component-wise.

source
is_subset(P::AbstractPolytope{N}, S::LazySet{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a convex set, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • S – outer convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ S$

  • If witness option is activated:

    • (true, []) iff $P ⊆ S$

    • (false, v) iff $P \not\subseteq S$ and $v ∈ P \setminus S$

Algorithm

Since $S$ is convex, $P ⊆ S$ iff $v_i ∈ S$ for all vertices $v_i$ of $P$.

source
is_subset(S::AbstractSingleton{N}, set::LazySet{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a given set with a single value is contained in a convex set, and if not, optionally compute a witness.

Input

  • S – inner set with a single value

  • set – outer convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ \text{set}$

  • If witness option is activated:

    • (true, []) iff $S ⊆ \text{set}$

    • (false, v) iff $S \not\subseteq \text{set}$ and $v ∈ S \setminus \text{set}$

source
is_subset(S::AbstractSingleton{N},
          H::AbstractHyperrectangle{N},
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a given set with a single value is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • S – inner set with a single value

  • set – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ \text{set}$

  • If witness option is activated:

    • (true, []) iff $S ⊆ \text{set}$

    • (false, v) iff $S \not\subseteq \text{set}$ and $v ∈ S \setminus \text{set}$

Notes

This copy-pasted method just exists to avoid method ambiguities.

source
LazySets.is_subsetMethod.
is_subset(S::LazySet{N}, H::AbstractHyperrectangle{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a convex set is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • S – inner convex set

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ H$

  • If witness option is activated:

    • (true, []) iff $S ⊆ H$

    • (false, v) iff $S \not\subseteq H$ and $v ∈ S \setminus H$

Algorithm

$S ⊆ H$ iff $\operatorname{ihull}(S) ⊆ H$, where $\operatorname{ihull}$ is the interval hull operator.

source
is_subset(P::AbstractPolytope{N},
          H::AbstractHyperrectangle,
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ H$

  • If witness option is activated:

    • (true, []) iff $P ⊆ H$

    • (false, v) iff $P \not\subseteq H$ and $v ∈ P \setminus H$

Notes

This copy-pasted method just exists to avoid method ambiguities.

Algorithm

Since $H$ is convex, $P ⊆ H$ iff $v_i ∈ H$ for all vertices $v_i$ of $P$.

source
is_subset(H1::AbstractHyperrectangle{N},
          H2::AbstractHyperrectangle{N},
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a given hyperrectangle is contained in another hyperrectangle, and if not, optionally compute a witness.

Input

  • H1 – inner hyperrectangle

  • H2 – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H1 ⊆ H2$

  • If witness option is activated:

    • (true, []) iff $H1 ⊆ H2$

    • (false, v) iff $H1 \not\subseteq H2$ and $v ∈ H1 \setminus H2$

Algorithm

$H1 ⊆ H2$ iff $c_1 + r_1 ≤ c_2 + r_2 ∧ c_1 - r_1 ≥ c_2 - r_2$ iff $r_1 - r_2 ≤ c_1 - c_2 ≤ -(r_1 - r_2)$, where $≤$ is taken component-wise.

source
is_subset(P::AbstractPolytope{N}, S::LazySet{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a polytope is contained in a convex set, and if not, optionally compute a witness.

Input

  • P – inner polytope

  • S – outer convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $P ⊆ S$

  • If witness option is activated:

    • (true, []) iff $P ⊆ S$

    • (false, v) iff $P \not\subseteq S$ and $v ∈ P \setminus S$

Algorithm

Since $S$ is convex, $P ⊆ S$ iff $v_i ∈ S$ for all vertices $v_i$ of $P$.

source
is_subset(S::AbstractSingleton{N}, set::LazySet{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a given set with a single value is contained in a convex set, and if not, optionally compute a witness.

Input

  • S – inner set with a single value

  • set – outer convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ \text{set}$

  • If witness option is activated:

    • (true, []) iff $S ⊆ \text{set}$

    • (false, v) iff $S \not\subseteq \text{set}$ and $v ∈ S \setminus \text{set}$

source
is_subset(S::AbstractSingleton{N},
          H::AbstractHyperrectangle{N},
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a given set with a single value is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • S – inner set with a single value

  • set – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ \text{set}$

  • If witness option is activated:

    • (true, []) iff $S ⊆ \text{set}$

    • (false, v) iff $S \not\subseteq \text{set}$ and $v ∈ S \setminus \text{set}$

Notes

This copy-pasted method just exists to avoid method ambiguities.

source
is_subset(S1::AbstractSingleton{N},
          S2::AbstractSingleton{N},
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a given set with a single value is contained in another set with a single value, and if not, optionally compute a witness.

Input

  • S1 – inner set with a single value

  • S2 – outer set with a single value

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S1 ⊆ S2$ iff $S1 == S2$

  • If witness option is activated:

    • (true, []) iff $S1 ⊆ S2$

    • (false, v) iff $S1 \not\subseteq S2$ and $v ∈ S1 \setminus S2$

source
LazySets.is_subsetMethod.
is_subset(B1::Ball2{N}, B2::Ball2{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a ball in the 2-norm is contained in another ball in the 2-norm, and if not, optionally compute a witness.

Input

  • B1 – inner ball in the 2-norm

  • B2 – outer ball in the 2-norm

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $B1 ⊆ B2$

  • If witness option is activated:

    • (true, []) iff $B1 ⊆ B2$

    • (false, v) iff $B1 \not\subseteq B2$ and $v ∈ B1 \setminus B2$

Algorithm

$B1 ⊆ B2$ iff $‖ c_1 - c_2 ‖_2 + r_1 ≤ r_2$

source
LazySets.is_subsetMethod.
is_subset(S::LazySet{N}, H::AbstractHyperrectangle{N}, witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a convex set is contained in a hyperrectangle, and if not, optionally compute a witness.

Input

  • S – inner convex set

  • H – outer hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ⊆ H$

  • If witness option is activated:

    • (true, []) iff $S ⊆ H$

    • (false, v) iff $S \not\subseteq H$ and $v ∈ S \setminus H$

Algorithm

$S ⊆ H$ iff $\operatorname{ihull}(S) ⊆ H$, where $\operatorname{ihull}$ is the interval hull operator.

source
is_subset(B::Union{Ball2{N}, Ballp{N}},
          S::AbstractSingleton{N},
          witness::Bool=false
         )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}

Check whether a ball in the 2-norm is contained in a set with a single value, and if not, optionally compute a witness.

Input

  • B – inner ball in the 2-norm or p-norm

  • S – outer set with a single value

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $B ⊆ S$

  • If witness option is activated:

    • (true, []) iff $B ⊆ S$

    • (false, v) iff $B \not\subseteq S$ and $v ∈ B \setminus S$

source

Check for emptiness of intersection

is_intersection_empty(H1::AbstractHyperrectangle{N},
                      H2::AbstractHyperrectangle{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether two hyperrectangles do not intersect, and otherwise optionally compute a witness.

Input

  • H1 – first hyperrectangle

  • H2 – second hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H1 ∩ H2 = ∅$

  • If witness option is activated:

    • (true, []) iff $H1 ∩ H2 = ∅$

    • (false, v) iff $H1 ∩ H2 ≠ ∅$ and $v ∈ H1 ∩ H2$

Algorithm

$H1 ∩ H2 ≠ ∅$ iff $|c_2 - c_1| ≤ r_1 + r_2$, where $≤$ is taken component-wise.

A witness is computed by starting in one center and moving toward the other center for as long as the minimum of the radius and the center distance. In other words, the witness is the point in H1 that is closest to the center of H2.

source
is_intersection_empty(H1::AbstractHyperrectangle{N},
                      H2::AbstractHyperrectangle{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether two hyperrectangles do not intersect, and otherwise optionally compute a witness.

Input

  • H1 – first hyperrectangle

  • H2 – second hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H1 ∩ H2 = ∅$

  • If witness option is activated:

    • (true, []) iff $H1 ∩ H2 = ∅$

    • (false, v) iff $H1 ∩ H2 ≠ ∅$ and $v ∈ H1 ∩ H2$

Algorithm

$H1 ∩ H2 ≠ ∅$ iff $|c_2 - c_1| ≤ r_1 + r_2$, where $≤$ is taken component-wise.

A witness is computed by starting in one center and moving toward the other center for as long as the minimum of the radius and the center distance. In other words, the witness is the point in H1 that is closest to the center of H2.

source
is_intersection_empty(S::AbstractSingleton{N},
                      set::LazySet{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a singleton and a convex set do not intersect, and otherwise optionally compute a witness.

Input

  • S – singleton

  • set – convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ∩ \operatorname{set} = ∅$

  • If witness option is activated:

    • (true, []) iff $S ∩ \operatorname{set} = ∅$

    • (false, v) iff $S ∩ \operatorname{set} ≠ ∅$ and v = element(S) $∈ S ∩ \operatorname{set}$

Algorithm

$S ∩ \operatorname{set} = ∅$ iff element(S) $otin \operatorname{set}$.

source
is_intersection_empty(S::AbstractSingleton{N},
                      H::AbstractHyperrectangle{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a singleton and a hyperrectangle do not intersect, and otherwise optionally compute a witness.

Input

  • S – singleton

  • H – hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H ∩ S = ∅$

  • If witness option is activated:

    • (true, []) iff $H ∩ S = ∅$

    • (false, v) iff $H ∩ S ≠ ∅$ and v = element(S) $∈ H ∩ S$

Algorithm

$S ∩ H = ∅$ iff element(S) $otin H$.

source
is_intersection_empty(H1::AbstractHyperrectangle{N},
                      H2::AbstractHyperrectangle{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether two hyperrectangles do not intersect, and otherwise optionally compute a witness.

Input

  • H1 – first hyperrectangle

  • H2 – second hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H1 ∩ H2 = ∅$

  • If witness option is activated:

    • (true, []) iff $H1 ∩ H2 = ∅$

    • (false, v) iff $H1 ∩ H2 ≠ ∅$ and $v ∈ H1 ∩ H2$

Algorithm

$H1 ∩ H2 ≠ ∅$ iff $|c_2 - c_1| ≤ r_1 + r_2$, where $≤$ is taken component-wise.

A witness is computed by starting in one center and moving toward the other center for as long as the minimum of the radius and the center distance. In other words, the witness is the point in H1 that is closest to the center of H2.

source
is_intersection_empty(set::LazySet{N},
                      S::AbstractSingleton{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a convex set and a singleton do not intersect, and otherwise optionally compute a witness.

Input

  • set – convex set

  • S – singleton

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ∩ \operatorname{set} = ∅$

  • If witness option is activated:

    • (true, []) iff $S ∩ \operatorname{set} = ∅$

    • (false, v) iff $S ∩ \operatorname{set} ≠ ∅$ and v = element(S) $∈ S ∩ \operatorname{set}$

Algorithm

$S ∩ \operatorname{set} = ∅$ iff element(S) $otin \operatorname{set}$.

source
is_intersection_empty(H::AbstractHyperrectangle{N},
                      S::AbstractSingleton{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a hyperrectangle and a singleton do not intersect, and otherwise optionally compute a witness.

Input

  • H – hyperrectangle

  • S – singleton

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H ∩ S = ∅$

  • If witness option is activated:

    • (true, []) iff $H ∩ S = ∅$

    • (false, v) iff $H ∩ S ≠ ∅$ and v = element(S) $∈ H ∩ S$

Algorithm

$H ∩ S = ∅$ iff element(S) $otin H$.

source
is_intersection_empty(S::AbstractSingleton{N},
                      set::LazySet{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a singleton and a convex set do not intersect, and otherwise optionally compute a witness.

Input

  • S – singleton

  • set – convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ∩ \operatorname{set} = ∅$

  • If witness option is activated:

    • (true, []) iff $S ∩ \operatorname{set} = ∅$

    • (false, v) iff $S ∩ \operatorname{set} ≠ ∅$ and v = element(S) $∈ S ∩ \operatorname{set}$

Algorithm

$S ∩ \operatorname{set} = ∅$ iff element(S) $otin \operatorname{set}$.

source
is_intersection_empty(set::LazySet{N},
                      S::AbstractSingleton{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a convex set and a singleton do not intersect, and otherwise optionally compute a witness.

Input

  • set – convex set

  • S – singleton

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ∩ \operatorname{set} = ∅$

  • If witness option is activated:

    • (true, []) iff $S ∩ \operatorname{set} = ∅$

    • (false, v) iff $S ∩ \operatorname{set} ≠ ∅$ and v = element(S) $∈ S ∩ \operatorname{set}$

Algorithm

$S ∩ \operatorname{set} = ∅$ iff element(S) $otin \operatorname{set}$.

source
is_intersection_empty(H1::AbstractHyperrectangle{N},
                      H2::AbstractHyperrectangle{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether two hyperrectangles do not intersect, and otherwise optionally compute a witness.

Input

  • H1 – first hyperrectangle

  • H2 – second hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H1 ∩ H2 = ∅$

  • If witness option is activated:

    • (true, []) iff $H1 ∩ H2 = ∅$

    • (false, v) iff $H1 ∩ H2 ≠ ∅$ and $v ∈ H1 ∩ H2$

Algorithm

$H1 ∩ H2 ≠ ∅$ iff $|c_2 - c_1| ≤ r_1 + r_2$, where $≤$ is taken component-wise.

A witness is computed by starting in one center and moving toward the other center for as long as the minimum of the radius and the center distance. In other words, the witness is the point in H1 that is closest to the center of H2.

source
is_intersection_empty(S::AbstractSingleton{N},
                      set::LazySet{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a singleton and a convex set do not intersect, and otherwise optionally compute a witness.

Input

  • S – singleton

  • set – convex set

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ∩ \operatorname{set} = ∅$

  • If witness option is activated:

    • (true, []) iff $S ∩ \operatorname{set} = ∅$

    • (false, v) iff $S ∩ \operatorname{set} ≠ ∅$ and v = element(S) $∈ S ∩ \operatorname{set}$

Algorithm

$S ∩ \operatorname{set} = ∅$ iff element(S) $otin \operatorname{set}$.

source
is_intersection_empty(set::LazySet{N},
                      S::AbstractSingleton{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a convex set and a singleton do not intersect, and otherwise optionally compute a witness.

Input

  • set – convex set

  • S – singleton

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S ∩ \operatorname{set} = ∅$

  • If witness option is activated:

    • (true, []) iff $S ∩ \operatorname{set} = ∅$

    • (false, v) iff $S ∩ \operatorname{set} ≠ ∅$ and v = element(S) $∈ S ∩ \operatorname{set}$

Algorithm

$S ∩ \operatorname{set} = ∅$ iff element(S) $otin \operatorname{set}$.

source
is_intersection_empty(S1::AbstractSingleton{N},
                      S2::AbstractSingleton{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether two singletons do not intersect, and otherwise optionally compute a witness.

Input

  • S1 – first singleton

  • S2 – second singleton

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $S1 ∩ S2 = ∅$

  • If witness option is activated:

    • (true, []) iff $S1 ∩ S2 = ∅$

    • (false, v) iff $S1 ∩ S2 ≠ ∅$ and v = element(S1) $∈ S1 ∩ S2$

Algorithm

$S1 ∩ S2 = ∅$ iff $S1 ≠ S2$.

source
is_intersection_empty(H::AbstractHyperrectangle{N},
                      S::AbstractSingleton{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a hyperrectangle and a singleton do not intersect, and otherwise optionally compute a witness.

Input

  • H – hyperrectangle

  • S – singleton

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H ∩ S = ∅$

  • If witness option is activated:

    • (true, []) iff $H ∩ S = ∅$

    • (false, v) iff $H ∩ S ≠ ∅$ and v = element(S) $∈ H ∩ S$

Algorithm

$H ∩ S = ∅$ iff element(S) $otin H$.

source
is_intersection_empty(S::AbstractSingleton{N},
                      H::AbstractHyperrectangle{N},
                      witness::Bool=false
                     )::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether a singleton and a hyperrectangle do not intersect, and otherwise optionally compute a witness.

Input

  • S – singleton

  • H – hyperrectangle

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $H ∩ S = ∅$

  • If witness option is activated:

    • (true, []) iff $H ∩ S = ∅$

    • (false, v) iff $H ∩ S ≠ ∅$ and v = element(S) $∈ H ∩ S$

Algorithm

$S ∩ H = ∅$ iff element(S) $otin H$.

source
is_intersection_empty(B1::Ball2{N},
                      B2::Ball2{N},
                      witness::Bool=false
                     )::Union{Bool, Tuple{Bool,Vector{N}}} where {N<:Real}

Check whether two balls in the 2-norm do not intersect, and otherwise optionally compute a witness.

Input

  • B1 – first ball in the 2-norm

  • B2 – second ball in the 2-norm

  • witness – (optional, default: false) compute a witness if activated

Output

  • If witness option is deactivated: true iff $B1 ∩ B2 = ∅$

  • If witness option is activated:

    • (true, []) iff $B1 ∩ B2 = ∅$

    • (false, v) iff $B1 ∩ B2 ≠ ∅$ and $v ∈ B1 ∩ B2$

Algorithm

$B1 ∩ B2 = ∅$ iff $‖ c_2 - c_1 ‖_2 > r_1 + r_2$.

A witness is computed depending on the smaller/bigger ball (to break ties, choose B1 for the smaller ball) as follows.

  • If the smaller ball's center is contained in the bigger ball, we return it.

  • Otherwise start in the smaller ball's center and move toward the other center until hitting the smaller ball's border. In other words, the witness is the point in the smaller ball that is closest to the center of the bigger ball.

source