File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,28 @@ function test_ideal_point()
206206 return
207207end
208208
209+ function test_SubproblemCount ()
210+ model = MOA. Optimizer (HiGHS. Optimizer)
211+ @test MOI. get (model, MOA. SubproblemCount ()) == 0
212+ @test MOI. is_set_by_optimize (MOA. SubproblemCount ())
213+ MOI. set (model, MOI. Silent (), true )
214+ x = MOI. add_variables (model, 2 )
215+ MOI. add_constraint .(model, x, MOI. GreaterThan (0.0 ))
216+ MOI. add_constraint (model, x[2 ], MOI. LessThan (3.0 ))
217+ MOI. add_constraint (model, 3.0 * x[1 ] - 1.0 * x[2 ], MOI. LessThan (6.0 ))
218+ MOI. set (model, MOI. ObjectiveSense (), MOI. MIN_SENSE)
219+ f = MOI. Utilities. vectorize ([
220+ 3.0 * x[1 ] + x[2 ],
221+ - 1.0 * x[1 ] - 2.0 * x[2 ],
222+ ])
223+ MOI. set (model, MOI. ObjectiveFunction {typeof(f)} (), f)
224+ MOI. optimize! (model)
225+ @test MOI. get (model, MOA. SubproblemCount ()) > 0
226+ MOI. empty! (model)
227+ @test MOI. get (model, MOA. SubproblemCount ()) == 0
228+ return
229+ end
230+
209231end # module
210232
211233TestModel. run_tests ()
You can’t perform that action at this time.
0 commit comments