File tree 2 files changed +3
-10
lines changed
Bridges/Constraint/bridges
2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,7 @@ function bridge_constraint(
45
45
scalar_f:: G ,
46
46
set:: MOI.Utilities.ScalarLinearSet{T} ,
47
47
) where {T,F,S,G}
48
- scalar_const = MOI. constant (scalar_f, T)
49
- if ! iszero (scalar_const)
50
- throw (MOI. ScalarFunctionConstantNotZero {T,G,typeof(set)} (scalar_const))
51
- end
48
+ MOI. throw_if_scalar_and_constant_not_zero (scalar_f, typeof (set))
52
49
set_const = MOI. constant (set)
53
50
vector_f = MOI. Utilities. operate (
54
51
vcat,
Original file line number Diff line number Diff line change @@ -181,12 +181,8 @@ function MOI.add_constraint(
181
181
) where {T}
182
182
if ! mock. add_con_allowed
183
183
throw (MOI. AddConstraintNotAllowed {typeof(func),typeof(set)} ())
184
- elseif mock. scalar_function_constant_non_zero && ! iszero (func. constant)
185
- throw (
186
- MOI. ScalarFunctionConstantNotZero {T,typeof(func),typeof(set)} (
187
- func. constant,
188
- ),
189
- )
184
+ elseif mock. scalar_function_constant_non_zero
185
+ MOI. throw_if_scalar_and_constant_not_zero (func, typeof (set))
190
186
end
191
187
ci = MOI. add_constraint (mock. inner_model, xor_indices (func), set)
192
188
return xor_index (ci)
You can’t perform that action at this time.
0 commit comments