@@ -24,9 +24,10 @@ There are five methods for which we implement `Utilities.promote_operation`:
24
24
c. `promote_operation(::typeof(-), ::Type{T}, ::Type{F1}, ::Type{Vector{T}})`
25
25
3. `*`
26
26
a. `promote_operation(::typeof(*), ::Type{T}, ::Type{T}, ::Type{F})`
27
- b. `promote_operation(::typeof(*), ::Type{T}, ::Type{F1}, ::Type{F2})`
27
+ b. `promote_operation(::typeof(*), ::Type{T}, ::Type{T}, ::Type{F})`
28
+ c. `promote_operation(::typeof(*), ::Type{T}, ::Type{F1}, ::Type{F2})`
28
29
where `F1` and `F2` are `VariableIndex` or `ScalarAffineFunction`
29
- c . `promote_operation(::typeof(*), ::Type{T}, ::Type{<:Diagonal{T}}, ::Type{F}`
30
+ d . `promote_operation(::typeof(*), ::Type{T}, ::Type{<:Diagonal{T}}, ::Type{F}`
30
31
4. `/`
31
32
a. `promote_operation(::typeof(/), ::Type{T}, ::Type{F}, ::Type{T})`
32
33
5. `vcat`
243
244
244
245
# ## Method 3b
245
246
247
+ function promote_operation (
248
+ :: typeof (* ),
249
+ :: Type{T} ,
250
+ :: Type{F} ,
251
+ :: Type{T} ,
252
+ ) where {
253
+ T,
254
+ F<: Union {
255
+ # T, # Stackoverflow if included
256
+ MOI. ScalarAffineFunction{T},
257
+ MOI. ScalarQuadraticFunction{T},
258
+ MOI. ScalarNonlinearFunction,
259
+ AbstractVector{T},
260
+ MOI. VectorAffineFunction{T},
261
+ MOI. VectorQuadraticFunction{T},
262
+ },
263
+ }
264
+ return F
265
+ end
266
+
267
+ function promote_operation (
268
+ :: typeof (* ),
269
+ :: Type{T} ,
270
+ :: Type{MOI.VariableIndex} ,
271
+ :: Type{T} ,
272
+ ) where {T}
273
+ return MOI. ScalarAffineFunction{T}
274
+ end
275
+
276
+ function promote_operation (
277
+ :: typeof (* ),
278
+ :: Type{T} ,
279
+ :: Type{MOI.VectorOfVariables} ,
280
+ :: Type{T} ,
281
+ ) where {T}
282
+ return MOI. VectorAffineFunction{T}
283
+ end
284
+
285
+ # ## Method 3c
286
+
246
287
function promote_operation (
247
288
:: typeof (* ),
248
289
:: Type{T} ,
@@ -252,7 +293,7 @@ function promote_operation(
252
293
return MOI. ScalarQuadraticFunction{T}
253
294
end
254
295
255
- # ## Method 3c
296
+ # ## Method 3d
256
297
257
298
function promote_operation (
258
299
:: typeof (* ),
0 commit comments