File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed
Bridges/Constraint/bridges Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,7 @@ function bridge_constraint(
4545 scalar_f:: G ,
4646 set:: MOI.Utilities.ScalarLinearSet{T} ,
4747) 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))
5249 set_const = MOI. constant (set)
5350 vector_f = MOI. Utilities. operate (
5451 vcat,
Original file line number Diff line number Diff line change @@ -181,12 +181,8 @@ function MOI.add_constraint(
181181) where {T}
182182 if ! mock. add_con_allowed
183183 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))
190186 end
191187 ci = MOI. add_constraint (mock. inner_model, xor_indices (func), set)
192188 return xor_index (ci)
You can’t perform that action at this time.
0 commit comments