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)`
LazySets.is_subset
— Method.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 setH
– outer hyperrectanglewitness
– (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.
LazySets.is_subset
— Method.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 setH
– outer hyperrectanglewitness
– (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.
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 polytopeH
– outer hyperrectanglewitness
– (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$.
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 polytopeS
– outer convex setwitness
– (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$.
LazySets.is_subset
— Method.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 setH
– outer hyperrectanglewitness
– (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.
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 polytopeH
– outer hyperrectanglewitness
– (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$.
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 hyperrectangleH2
– outer hyperrectanglewitness
– (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.
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 polytopeS
– outer convex setwitness
– (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$.
LazySets.is_subset
— Method.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 polytopeS
– outer convex setwitness
– (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$.
LazySets.is_subset
— Method.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 polytopeS
– outer convex setwitness
– (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$.
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 valueset
– outer convex setwitness
– (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}$
LazySets.is_subset
— Method.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 setH
– outer hyperrectanglewitness
– (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.
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 polytopeH
– outer hyperrectanglewitness
– (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$.
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 hyperrectangleH2
– outer hyperrectanglewitness
– (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.
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 polytopeS
– outer convex setwitness
– (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$.
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 valueset
– outer convex setwitness
– (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}$
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 valueset
– outer hyperrectanglewitness
– (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.
LazySets.is_subset
— Method.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 setH
– outer hyperrectanglewitness
– (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.
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 polytopeH
– outer hyperrectanglewitness
– (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$.
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 hyperrectangleH2
– outer hyperrectanglewitness
– (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.
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 polytopeS
– outer convex setwitness
– (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$.
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 valueset
– outer convex setwitness
– (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}$
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 valueset
– outer hyperrectanglewitness
– (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.
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 valueS2
– outer set with a single valuewitness
– (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$
LazySets.is_subset
— Method.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-normB2
– outer ball in the 2-normwitness
– (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$
LazySets.is_subset
— Method.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 setH
– outer hyperrectanglewitness
– (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.
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-normS
– outer set with a single valuewitness
– (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$
Check for emptiness of intersection
LazySets.is_intersection_empty
— Method.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 hyperrectangleH2
– second hyperrectanglewitness
– (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
.
LazySets.is_intersection_empty
— Method.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 hyperrectangleH2
– second hyperrectanglewitness
– (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
.
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
– singletonset
– convex setwitness
– (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} ≠ ∅$ andv
=element(S)
$∈ S ∩ \operatorname{set}$
Algorithm
$S ∩ \operatorname{set} = ∅$ iff element(S)
$otin \operatorname{set}$.
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
– singletonH
– hyperrectanglewitness
– (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 ≠ ∅$ andv
=element(S)
$∈ H ∩ S$
Algorithm
$S ∩ H = ∅$ iff element(S)
$otin H$.
LazySets.is_intersection_empty
— Method.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 hyperrectangleH2
– second hyperrectanglewitness
– (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
.
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 setS
– singletonwitness
– (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} ≠ ∅$ andv
=element(S)
$∈ S ∩ \operatorname{set}$
Algorithm
$S ∩ \operatorname{set} = ∅$ iff element(S)
$otin \operatorname{set}$.
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
– hyperrectangleS
– singletonwitness
– (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 ≠ ∅$ andv
=element(S)
$∈ H ∩ S$
Algorithm
$H ∩ S = ∅$ iff element(S)
$otin H$.
LazySets.is_intersection_empty
— Method.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
– singletonset
– convex setwitness
– (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} ≠ ∅$ andv
=element(S)
$∈ S ∩ \operatorname{set}$
Algorithm
$S ∩ \operatorname{set} = ∅$ iff element(S)
$otin \operatorname{set}$.
LazySets.is_intersection_empty
— Method.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 setS
– singletonwitness
– (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} ≠ ∅$ andv
=element(S)
$∈ S ∩ \operatorname{set}$
Algorithm
$S ∩ \operatorname{set} = ∅$ iff element(S)
$otin \operatorname{set}$.
LazySets.is_intersection_empty
— Method.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 hyperrectangleH2
– second hyperrectanglewitness
– (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
.
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
– singletonset
– convex setwitness
– (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} ≠ ∅$ andv
=element(S)
$∈ S ∩ \operatorname{set}$
Algorithm
$S ∩ \operatorname{set} = ∅$ iff element(S)
$otin \operatorname{set}$.
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 setS
– singletonwitness
– (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} ≠ ∅$ andv
=element(S)
$∈ S ∩ \operatorname{set}$
Algorithm
$S ∩ \operatorname{set} = ∅$ iff element(S)
$otin \operatorname{set}$.
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 singletonS2
– second singletonwitness
– (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 ≠ ∅$ andv
=element(S1)
$∈ S1 ∩ S2$
Algorithm
$S1 ∩ S2 = ∅$ iff $S1 ≠ S2$.
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
– hyperrectangleS
– singletonwitness
– (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 ≠ ∅$ andv
=element(S)
$∈ H ∩ S$
Algorithm
$H ∩ S = ∅$ iff element(S)
$otin H$.
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
– singletonH
– hyperrectanglewitness
– (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 ≠ ∅$ andv
=element(S)
$∈ H ∩ S$
Algorithm
$S ∩ H = ∅$ iff element(S)
$otin H$.
LazySets.is_intersection_empty
— Method.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-normB2
– second ball in the 2-normwitness
– (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.