@@ -46,11 +46,6 @@ for N in @tN([Float64, Float32, Rational{Int}])
46
46
@test genmat (LMS) == N[5 6 ; 11 14 ]
47
47
@test expmat (LMS) == expmat (S)
48
48
49
- LMS2 = linear_map (N[1 // 2 0 ; 0 1 // 2 ], S)
50
- @test center (LMS2) == N[1 , 0 ]
51
- @test genmat (LMS2) == N[0.5 1 ; 1 1 ]
52
- @test expmat (LMS2) == expmat (LMS2)
53
-
54
49
MSS = minkowski_sum (S, S)
55
50
@test center (MSS) == N[4 , 0 ]
56
51
@test genmat (MSS) == N[1 2 1 2 ; 2 2 2 2.0 ]
@@ -61,33 +56,30 @@ for N in @tN([Float64, Float32, Rational{Int}])
61
56
@test genmat (CPS) == N[1 2 0 0 ; 2 2 0 0 ; 0 0 1 2 ; 0 0 2 2.0 ]
62
57
@test expmat (CPS) == [1 4 0 0 ; 1 2 0 0 ; 0 0 1 4 ; 0 0 1 2 ]
63
58
Z = overapproximate (S, Zonotope)
64
- PZZ = cartesian_product (S, Z)
65
- @test center (PZZ) == vcat (center (S), center (Z))
66
- @test genmat_dep (PZZ) == vcat (genmat_dep (S), zeros (N, 2 , 2 ))
67
- @test genmat_indep (PZZ) == vcat (zeros (N, 2 , 2 ), genmat (Z))
68
- @test expmat (PZZ) == expmat (S)
69
-
70
- _c = N[2 , 0 ]
71
- _g = N[0 0.5 1 0.5 1 0.5 1 - 0.5 - 1
72
- 0 1 1 1 1 1 1 - 1 - 1 ]
73
-
74
- _e = [0 1 4 1 4 0 0 0 0
75
- 0 1 2 1 2 0 0 0 0
76
- 0 0 0 0 0 1 4 1 4
77
- 0 0 0 0 0 1 2 1 2
78
- 1 0 0 1 1 0 0 1 1 ]
59
+ CPS = cartesian_product (S, Z)
60
+ @test center (CPS) == vcat (center (S), center (Z))
61
+ @test genmat_dep (CPS) == vcat (genmat_dep (S), zeros (N, 2 , 2 ))
62
+ @test genmat_indep (CPS) == vcat (zeros (N, 2 , 2 ), genmat (Z))
63
+ @test expmat (CPS) == expmat (S)
79
64
80
- LCS = linear_combination (S, S)
65
+ c = N[2 , 0 ]
66
+ G = N[0 0.5 1 0.5 1 0.5 1 - 0.5 - 1
67
+ 0 1 1 1 1 1 1 - 1 - 1 ]
68
+ E = [0 1 4 1 4 0 0 0 0
69
+ 0 1 2 1 2 0 0 0 0
70
+ 0 0 0 0 0 1 4 1 4
71
+ 0 0 0 0 0 1 2 1 2
72
+ 1 0 0 1 1 0 0 1 1 ]
81
73
82
- @test center (LCS) == _c
83
- @test genmat (LCS) == _g
84
- @test expmat (LCS) == _e
74
+ LCS = linear_combination (S, S)
75
+ @test center (LCS) == c
76
+ @test genmat (LCS) == G
77
+ @test expmat (LCS) == E
85
78
86
79
CH1 = convex_hull (S)
87
-
88
- @test center (CH1) == _c
89
- @test genmat (CH1) == _g
90
- @test expmat (CH1) == _e
80
+ @test center (CH1) == c
81
+ @test genmat (CH1) == G
82
+ @test expmat (CH1) == E
91
83
92
84
# convex hull with itself
93
85
CH2 = convex_hull (S, S)
@@ -102,20 +94,16 @@ for N in @tN([Float64, Float32, Rational{Int}])
102
94
q1 = quadratic_map (Q, S2)
103
95
@test concretize (QuadraticMap (Q, S2)) == q1
104
96
q2 = quadratic_map (Q, S2, S2)
105
-
106
97
@test center (q1) == center (q2) ≈ N[- 6 // 25 , - 52 // 125 ]
107
98
@test genmat (q1) ≈ genmat (q2) ≈ N[- 6 // 5 4 // 25 0 4 // 5 ;
108
99
- 272 // 100 192 // 1000 - 16 // 5 96 // 100 ]
109
-
110
100
@test expmat (q1) == expmat (q2) == [1 0 2 1 ;
111
101
0 1 0 1 ]
112
102
113
103
c = N[1 , 2 , 3 ]
114
-
115
104
G = N[0 1 4 7 10 13 16
116
105
0 2 5 8 11 14 17
117
106
0 3 6 9 12 15 18 ]
118
-
119
107
E = [1 4 1 3 0 3 7
120
108
2 5 2 4 0 4 8
121
109
3 6 3 5 0 5 9 ]
0 commit comments