@@ -30,14 +30,14 @@ REFERENCE
30
30
theorem, matrix geometric means and semidefinite optimization" by Hamza
31
31
Fawzi and James Saunderson (arXiv:1512.03401)
32
32
"""
33
- mutable struct GeomMeanHypoCone
33
+ mutable struct GeometricMeanHypoCone
34
34
A:: AbstractExpr
35
35
B:: AbstractExpr
36
36
t:: Rational
37
37
size:: Tuple{Int,Int}
38
38
fullhyp:: Bool
39
39
40
- function GeomMeanHypoCone (
40
+ function GeometricMeanHypoCone (
41
41
A:: AbstractExpr ,
42
42
B:: AbstractExpr ,
43
43
t:: Rational ,
@@ -56,64 +56,74 @@ mutable struct GeomMeanHypoCone
56
56
return new (A, B, t, (n, n), fullhyp)
57
57
end
58
58
59
- function GeomMeanHypoCone (
59
+ function GeometricMeanHypoCone (
60
60
A:: Value ,
61
61
B:: AbstractExpr ,
62
62
t:: Rational ,
63
63
fullhyp:: Bool = true ,
64
64
)
65
- return GeomMeanHypoCone (constant (A), B, t, fullhyp)
65
+ return GeometricMeanHypoCone (constant (A), B, t, fullhyp)
66
66
end
67
67
68
- function GeomMeanHypoCone (
68
+ function GeometricMeanHypoCone (
69
69
A:: AbstractExpr ,
70
70
B:: Value ,
71
71
t:: Rational ,
72
72
fullhyp:: Bool = true ,
73
73
)
74
- return GeomMeanHypoCone (A, constant (B), t, fullhyp)
74
+ return GeometricMeanHypoCone (A, constant (B), t, fullhyp)
75
75
end
76
76
77
- function GeomMeanHypoCone (
77
+ function GeometricMeanHypoCone (
78
78
A:: Value ,
79
79
B:: Value ,
80
80
t:: Rational ,
81
81
fullhyp:: Bool = true ,
82
82
)
83
- return GeomMeanHypoCone (constant (A), constant (B), t, fullhyp)
83
+ return GeometricMeanHypoCone (constant (A), constant (B), t, fullhyp)
84
84
end
85
85
86
- function GeomMeanHypoCone (
86
+ function GeometricMeanHypoCone (
87
87
A:: Union{AbstractExpr,Value} ,
88
88
B:: Union{AbstractExpr,Value} ,
89
89
t:: Integer ,
90
90
fullhyp:: Bool = true ,
91
91
)
92
- return GeomMeanHypoCone (A, B, t // 1 , fullhyp)
92
+ return GeometricMeanHypoCone (A, B, t // 1 , fullhyp)
93
93
end
94
94
end
95
95
96
- mutable struct GeomMeanHypoConeConstraint <: Constraint
96
+ mutable struct GeometricMeanHypoConeConstraint <: Constraint
97
97
T:: AbstractExpr
98
- cone:: GeomMeanHypoCone
98
+ cone:: GeometricMeanHypoCone
99
99
100
- function GeomMeanHypoConeConstraint (T:: AbstractExpr , cone:: GeomMeanHypoCone )
100
+ function GeometricMeanHypoConeConstraint (
101
+ T:: AbstractExpr ,
102
+ cone:: GeometricMeanHypoCone ,
103
+ )
101
104
if size (T) != cone. size
102
105
throw (DimensionMismatch (" T must be size $(cone. size) " ))
103
106
end
104
107
return new (T, cone)
105
108
end
106
109
107
- function GeomMeanHypoConeConstraint (T:: Value , cone:: GeomMeanHypoCone )
108
- return GeomMeanHypoConeConstraint (constant (T), cone)
110
+ function GeometricMeanHypoConeConstraint (
111
+ T:: Value ,
112
+ cone:: GeometricMeanHypoCone ,
113
+ )
114
+ return GeometricMeanHypoConeConstraint (constant (T), cone)
109
115
end
110
116
end
111
117
112
- head (io:: IO , :: GeomMeanHypoConeConstraint ) = print (io, " ∈(GeomMeanHypoCone)" )
118
+ function head (io:: IO , :: GeometricMeanHypoConeConstraint )
119
+ return print (io, " ∈(GeometricMeanHypoCone)" )
120
+ end
113
121
114
- Base. in (T, cone:: GeomMeanHypoCone ) = GeomMeanHypoConeConstraint (T, cone)
122
+ function Base. in (T, cone:: GeometricMeanHypoCone )
123
+ return GeometricMeanHypoConeConstraint (T, cone)
124
+ end
115
125
116
- function AbstractTrees. children (constraint:: GeomMeanHypoConeConstraint )
126
+ function AbstractTrees. children (constraint:: GeometricMeanHypoConeConstraint )
117
127
return (
118
128
constraint. T,
119
129
constraint. cone. A,
124
134
125
135
# For t ∈ [0,1] the t-weighted matrix geometric mean is matrix concave (arxiv:1512.03401).
126
136
# So if A and B are convex sets, then T ⪯ A #_t B will be a convex set.
127
- function vexity (constraint:: GeomMeanHypoConeConstraint )
137
+ function vexity (constraint:: GeometricMeanHypoConeConstraint )
128
138
A = vexity (constraint. cone. A)
129
139
B = vexity (constraint. cone. B)
130
140
T = vexity (constraint. T)
145
155
146
156
function _add_constraint! (
147
157
context:: Context ,
148
- constraint:: GeomMeanHypoConeConstraint ,
158
+ constraint:: GeometricMeanHypoConeConstraint ,
149
159
)
150
160
A = constraint. cone. A
151
161
B = constraint. cone. B
@@ -165,7 +175,7 @@ function _add_constraint!(
165
175
166
176
if fullhyp && t != 0 && t != 1
167
177
W = make_temporary ()
168
- add_constraint! (context, W in GeomMeanHypoCone (A, B, t, false ))
178
+ add_constraint! (context, W in GeometricMeanHypoCone (A, B, t, false ))
169
179
add_constraint! (context, W ⪰ T)
170
180
else
171
181
p = t. num
@@ -190,13 +200,13 @@ function _add_constraint!(
190
200
if t < 1 / 2
191
201
add_constraint! (
192
202
context,
193
- Z in GeomMeanHypoCone (A, B, 2 * t, false ),
203
+ Z in GeometricMeanHypoCone (A, B, 2 * t, false ),
194
204
)
195
205
add_constraint! (context, [A T; T' Z] ⪰ 0 )
196
206
else
197
207
add_constraint! (
198
208
context,
199
- Z in GeomMeanHypoCone (A, B, 2 * t - 1 , false ),
209
+ Z in GeometricMeanHypoCone (A, B, 2 * t - 1 , false ),
200
210
)
201
211
add_constraint! (context, [B T; T' Z] ⪰ 0 )
202
212
end
@@ -205,7 +215,7 @@ function _add_constraint!(
205
215
Z = make_temporary ()
206
216
add_constraint! (
207
217
context,
208
- Z in GeomMeanHypoCone (A, T, (2 * p - q) // p, false ),
218
+ Z in GeometricMeanHypoCone (A, T, (2 * p - q) // p, false ),
209
219
)
210
220
add_constraint! (context, [Z T; T B] ⪰ 0 )
211
221
elseif t < 1 / 2
@@ -215,15 +225,18 @@ function _add_constraint!(
215
225
l = floor (Int, log2 (q))
216
226
add_constraint! (
217
227
context,
218
- X in GeomMeanHypoCone (A, B, p // (2 ^ l), false ),
228
+ X in GeometricMeanHypoCone (A, B, p // (2 ^ l), false ),
219
229
)
220
230
add_constraint! (
221
231
context,
222
- T in GeomMeanHypoCone (A, X, (2 ^ l) // q, false ),
232
+ T in GeometricMeanHypoCone (A, X, (2 ^ l) // q, false ),
223
233
)
224
234
else
225
235
# println("geom_mean_hypocone p=$p q=$q else")
226
- add_constraint! (context, T in GeomMeanHypoCone (B, A, 1 - t, false ))
236
+ add_constraint! (
237
+ context,
238
+ T in GeometricMeanHypoCone (B, A, 1 - t, false ),
239
+ )
227
240
end
228
241
end
229
242
end
0 commit comments