@@ -100,13 +100,17 @@ end
100100 MOIT. normone1vtest (bridged_mock, config)
101101 MOIT. normone1ftest (bridged_mock, config)
102102
103+ var_names = [" x" , " y" , " z" ]
104+ MOI. set (bridged_mock, MOI. VariableName (), MOI. get (bridged_mock, MOI. ListOfVariableIndices ()), var_names)
105+
106+ nonneg = MOI. get (mock, MOI. ListOfConstraintIndices {MOI.VectorAffineFunction{Float64}, MOI.Nonnegatives} ())
107+ greater = MOI. get (mock, MOI. ListOfConstraintIndices {MOI.ScalarAffineFunction{Float64}, MOI.GreaterThan{Float64}} ())
108+ u, v = MOI. get (mock, MOI. ListOfVariableIndices ())[4 : 5 ]
103109 @testset " Test mock model" begin
104- var_names = [" x" , " y" , " z" , " u" , " v" ]
105- MOI. set (mock, MOI. VariableName (), MOI. get (mock, MOI. ListOfVariableIndices ()), var_names)
106- nonneg = MOI. get (mock, MOI. ListOfConstraintIndices {MOI.VectorAffineFunction{Float64}, MOI.Nonnegatives} ())
110+ MOI. set (mock, MOI. VariableName (), u, " u" )
111+ MOI. set (mock, MOI. VariableName (), v, " v" )
107112 @test length (nonneg) == 1
108113 MOI. set (mock, MOI. ConstraintName (), nonneg[1 ], " nonneg" )
109- greater = MOI. get (mock, MOI. ListOfConstraintIndices {MOI.ScalarAffineFunction{Float64}, MOI.GreaterThan{Float64}} ())
110114 @test length (greater) == 1
111115 MOI. set (mock, MOI. ConstraintName (), greater[1 ], " greater" )
112116 zeros = MOI. get (mock, MOI. ListOfConstraintIndices {MOI.VectorAffineFunction{Float64}, MOI.Zeros} ())
@@ -124,12 +128,10 @@ end
124128 """
125129 model = MOIU. Model {Float64} ()
126130 MOIU. loadfromstring! (model, s)
127- MOIU. test_models_equal (mock, model, var_names, [" nonneg" , " greater" , " x_eq" , " y_eq" ])
131+ MOIU. test_models_equal (mock, model, [ var_names; " u " ; " v " ] , [" nonneg" , " greater" , " x_eq" , " y_eq" ])
128132 end
129133
130134 @testset " Test bridged model" begin
131- var_names = [" x" , " y" , " z" ]
132- MOI. set (bridged_mock, MOI. VariableName (), MOI. get (bridged_mock, MOI. ListOfVariableIndices ()), var_names)
133135 normone = MOI. get (bridged_mock, MOI. ListOfConstraintIndices {MOI.VectorAffineFunction{Float64}, MOI.NormOneCone} ())
134136 @test length (normone) == 1
135137 MOI. set (bridged_mock, MOI. ConstraintName (), normone[1 ], " normone" )
151153 end
152154
153155 ci = first (MOI. get (bridged_mock, MOI. ListOfConstraintIndices {MOI.VectorAffineFunction{Float64}, MOI.NormOneCone} ()))
156+
157+ @testset " $attr " for attr in [MOI. ConstraintPrimalStart (), MOI. ConstraintDualStart ()]
158+ @test MOI. supports (bridged_mock, attr, typeof (ci))
159+ value = [4.0 , 1.0 , - 2.0 ]
160+ MOI. set (bridged_mock, attr, ci, value)
161+ @test MOI. get (bridged_mock, attr, ci) ≈ value
162+ if attr isa MOI. ConstraintPrimalStart
163+ @test MOI. get (mock, MOI. VariablePrimalStart (), u) == 1
164+ @test MOI. get (mock, MOI. VariablePrimalStart (), v) == 2
165+ @test MOI. get (mock, attr, nonneg[1 ]) == [0.0 , 4.0 , 2.0 , 0.0 ]
166+ @test MOI. get (mock, attr, greater[1 ]) == 1
167+ else
168+ @test MOI. get (mock, attr, nonneg[1 ]) == [0.0 , 2.0 , 1.0 , 0.0 ]
169+ @test MOI. get (mock, attr, greater[1 ]) == 4
170+ end
171+ end
172+
154173 test_delete_bridge (bridged_mock, ci, 3 , (
155174 (MOI. ScalarAffineFunction{Float64}, MOI. GreaterThan{Float64}, 0 ),
156175 (MOI. VectorAffineFunction{Float64}, MOI. Nonnegatives, 0 )))
0 commit comments