2
2
minkowski_difference(P::LazySet, Q::LazySet)
3
3
4
4
Concrete Minkowski difference (geometric difference) of a polytopic set and a
5
- compact convex set.
5
+ compact set.
6
6
7
7
### Input
8
8
9
9
- `P` -- polytopic set
10
- - `Q` -- compact convex set that is subtracted from `P`
10
+ - `Q` -- compact set that is subtracted from `P`
11
11
12
12
### Output
13
13
@@ -25,15 +25,20 @@ This method implements [KolmanovskyG98; Theorem 2.3](@citet):
25
25
26
26
Suppose ``P`` is a polyhedron
27
27
```math
28
- P = \\ {z ∈ ℝ^n: sᵢᵀz ≤ rᵢ,~i = 1, …, N \\ }.
28
+ P = \\ {z ∈ ℝ^n: sᵢᵀz ≤ rᵢ,~i = 1, …, k \\ }.
29
29
```
30
30
where ``sᵢ ∈ ℝ^n, sᵢ ≠ 0``, and ``rᵢ ∈ ℝ``.
31
- Assume ``ρ(sᵢ,Q)`` is defined for ``i = 1, …, N ``.
31
+ Assume ``ρ(sᵢ,Q)`` is defined for ``i = 1, …, k ``.
32
32
Then the Minkowski difference is
33
33
34
34
```math
35
- \\ {z ∈ ℝ^n: sᵢᵀz ≤ rᵢ - ρ(sᵢ,Q),~i = 1, …, N \\ }.
35
+ \\ {z ∈ ℝ^n: sᵢᵀz ≤ rᵢ - ρ(sᵢ,Q),~i = 1, …, k \\ }.
36
36
```
37
+
38
+ While the algorithm applies the support function to `Q`, we have that
39
+ ``P ⊖ Q = P ⊖ \\ text{CH}(Q)`` whenever `P` is convex, where CH denotes the
40
+ convex hull. Hence, if `Q` is not convex by type information, we wrap it in a
41
+ lazy `ConvexHull`.
37
42
"""
38
43
function minkowski_difference (P:: LazySet , Q:: LazySet )
39
44
@assert dim (P) == dim (Q) " the dimensions of the given sets should match, " *
@@ -43,6 +48,10 @@ function minkowski_difference(P::LazySet, Q::LazySet)
43
48
@assert isbounded (Q) " this implementation requires that the second " *
44
49
" argument is bounded, but it is not"
45
50
51
+ if ! isconvextype (typeof (Q))
52
+ Q = ConvexHull (Q)
53
+ end
54
+
46
55
A, b = tosimplehrep (P)
47
56
g_PminusQ = [b[i] - ρ (A[i, :], Q) for i in eachindex (b)]
48
57
if isbounded (P)
0 commit comments