@@ -2328,6 +2328,47 @@ function test_issue_2838()
23282328 return
23292329end
23302330
2331+ MOI. Utilities. @model (
2332+ Model2870,
2333+ (),
2334+ (MOI. EqualTo,),
2335+ (),
2336+ (),
2337+ (),
2338+ (MOI. ScalarAffineFunction,),
2339+ (),
2340+ ()
2341+ )
2342+
2343+ function test_issue_2870 ()
2344+ inner = MOI. Utilities. MockOptimizer (MOI. Utilities. Model {Float64} ())
2345+ model = MOI. Bridges. Constraint. ScalarSlack {Float64} (inner)
2346+ x = MOI. add_variable (model)
2347+ c = MOI. add_constraint (model, 2.0 * x, MOI. Interval (1.0 , - 1.0 ))
2348+ F, S = MOI. ScalarAffineFunction{Float64}, MOI. EqualTo{Float64}
2349+ ci_eq = only (MOI. get (inner, MOI. ListOfConstraintIndices {F,S} ()))
2350+ F, S = MOI. VariableIndex, MOI. Interval{Float64}
2351+ ci_iv = only (MOI. get (inner, MOI. ListOfConstraintIndices {F,S} ()))
2352+ function cmp (a, b)
2353+ if a == MOI. IN_CONFLICT || b == MOI. IN_CONFLICT
2354+ return MOI. IN_CONFLICT
2355+ elseif a == MOI. MAYBE_IN_CONFLICT || b == MOI. MAYBE_IN_CONFLICT
2356+ return MOI. MAYBE_IN_CONFLICT
2357+ else
2358+ return MOI. NOT_IN_CONFLICT
2359+ end
2360+ end
2361+ list = (MOI. NOT_IN_CONFLICT, MOI. IN_CONFLICT, MOI. MAYBE_IN_CONFLICT)
2362+ for a in list, b in list
2363+ MOI. set (inner, MOI. ConflictCount (), 1 )
2364+ MOI. set (inner, MOI. ConstraintConflictStatus (), ci_eq, a)
2365+ MOI. set (inner, MOI. ConstraintConflictStatus (), ci_iv, b)
2366+ MOI. compute_conflict! (model)
2367+ @test MOI. get (model, MOI. ConstraintConflictStatus (), c) == cmp (a, b)
2368+ end
2369+ return
2370+ end
2371+
23312372end # module
23322373
23332374TestBridgesLazyBridgeOptimizer. runtests ()
0 commit comments