@@ -2288,6 +2288,46 @@ function test_wrong_coefficient_2()
22882288 return
22892289end
22902290
2291+ MOI. Utilities. @model (
2292+ Model2838,
2293+ (),
2294+ (MOI. GreaterThan,),
2295+ (),
2296+ (),
2297+ (),
2298+ (MOI. ScalarAffineFunction,),
2299+ (),
2300+ ()
2301+ )
2302+
2303+ function test_issue_2838 ()
2304+ inner = MOI. Utilities. MockOptimizer (Model2838 {Float64} ())
2305+ model = MOI. Bridges. full_bridge_optimizer (inner, Float64)
2306+ x = MOI. add_variables (model, 2 )
2307+ f = MOI. Utilities. operate (vcat, Float64, (1.0 * x). .. )
2308+ c = MOI. add_constraint (model, f, MOI. Nonnegatives (2 ))
2309+ F, S = MOI. ScalarAffineFunction{Float64}, MOI. GreaterThan{Float64}
2310+ ci = MOI. get (inner, MOI. ListOfConstraintIndices {F,S} ())
2311+ function cmp (a, b)
2312+ if a == MOI. IN_CONFLICT || b == MOI. IN_CONFLICT
2313+ return MOI. IN_CONFLICT
2314+ elseif a == MOI. MAYBE_IN_CONFLICT || b == MOI. MAYBE_IN_CONFLICT
2315+ return MOI. MAYBE_IN_CONFLICT
2316+ else
2317+ return MOI. NOT_IN_CONFLICT
2318+ end
2319+ end
2320+ list = (MOI. NOT_IN_CONFLICT, MOI. IN_CONFLICT, MOI. MAYBE_IN_CONFLICT)
2321+ for a in list, b in list
2322+ MOI. set (inner, MOI. ConflictCount (), 1 )
2323+ MOI. set (inner, MOI. ConstraintConflictStatus (), ci[1 ], a)
2324+ MOI. set (inner, MOI. ConstraintConflictStatus (), ci[2 ], b)
2325+ MOI. compute_conflict! (model)
2326+ @test MOI. get (model, MOI. ConstraintConflictStatus (), c) == cmp (a, b)
2327+ end
2328+ return
2329+ end
2330+
22912331end # module
22922332
22932333TestBridgesLazyBridgeOptimizer. runtests ()
0 commit comments