File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1661,6 +1661,20 @@ function test_obj_constant_max_to_max()
16611661 return
16621662end
16631663
1664+ function test_duplicate_coefficient ()
1665+ model = MPS. Model ()
1666+ MOI. read_from_file (model, joinpath (@__DIR__ , " duplicate_coefficient.mps" ))
1667+ dest = MOI. Utilities. Model {Float64} ()
1668+ MOI. copy_to (dest, model)
1669+ F, S = MOI. ScalarAffineFunction{Float64}, MOI. EqualTo{Float64}
1670+ x = only (MOI. get (dest, MOI. ListOfVariableIndices ()))
1671+ c = only (MOI. get (dest, MOI. ListOfConstraintIndices {F,S} ()))
1672+ f = MOI. get (dest, MOI. ConstraintFunction (), c)
1673+ @test isapprox (f, 2.0 * x)
1674+ @test MOI. get (dest, MOI. ConstraintSet (), c) == MOI. EqualTo (1.0 )
1675+ return
1676+ end
1677+
16641678end # TestMPS
16651679
16661680TestMPS. runtests ()
Original file line number Diff line number Diff line change 1+ NAME DUPLICATE_COEFFICIENT
2+ ROWS
3+ N obj
4+ E c
5+ COLUMNS
6+ x obj 1
7+ x c 1
8+ x c 1
9+ RHS
10+ rhs c 1
11+ BOUNDS
12+ FR bounds x
13+ ENDATA
You can’t perform that action at this time.
0 commit comments