@@ -59,7 +59,8 @@ function bridge_constraint(::Type{GeoMeanBridge{T, F, G}}, model,
5959
6060 xl1 = MOI. SingleVariable (xij[1 ])
6161 sN = one (T) / √ N
62- function _getx (i)
62+ A = MOIU. promote_operation (* , T, T, MOI. SingleVariable)
63+ function _getx (i):: A
6364 if i > n
6465 return sN * xl1
6566 else
@@ -69,10 +70,9 @@ function bridge_constraint(::Type{GeoMeanBridge{T, F, G}}, model,
6970
7071 t = f_scalars[1 ]
7172 # With sqrt(2)^l*t - xl1, we should scale both the ConstraintPrimal and ConstraintDual
72- tubc = MOIU. add_scalar_constraint (model,
73- MOIU. operate! (+ , T, t, - sN * xl1),
74- MOI. LessThan (zero (T)),
75- allow_modify_function= true )
73+ tubc = MOIU. add_scalar_constraint (
74+ model, MOIU. operate! (+ , T, t, - sN * xl1), MOI. LessThan (zero (T)),
75+ allow_modify_function= true )
7676
7777 socrc = Vector {CI{G, MOI.RotatedSecondOrderCone}} (undef, N- 1 )
7878 offset = offsetnext = 0
@@ -83,13 +83,13 @@ function bridge_constraint(::Type{GeoMeanBridge{T, F, G}}, model,
8383 a = _getx (2 j- 1 )
8484 b = _getx (2 j)
8585 else
86- a = one (T) * MOI. SingleVariable (xij[offsetnext+ 2 j- 1 ])
87- b = one (T) * MOI. SingleVariable (xij[offsetnext+ 2 j])
86+ a = convert (A, MOI. SingleVariable (xij[offsetnext+ 2 j- 1 ]) )
87+ b = convert (A, MOI. SingleVariable (xij[offsetnext+ 2 j]) )
8888 end
8989 c = MOI. SingleVariable (xij[offset+ j])
90- socrc[offset + j] = MOI. add_constraint (model,
91- MOIU. operate (vcat, T, a, b, c),
92- MOI. RotatedSecondOrderCone (3 ))
90+ socrc[offset + j] = MOI. add_constraint (
91+ model, MOIU. operate (vcat, T, a, b, c),
92+ MOI. RotatedSecondOrderCone (3 ))
9393 end
9494 offset = offsetnext
9595 end
0 commit comments