@@ -27,6 +27,8 @@ function test_knapsack()
2727 P = Float64[1 0 0 0 ; 0 1 0 0 ; 0 0 0 1 ; 0 0 1 0 ]
2828 model = MOA. Optimizer (HiGHS. Optimizer)
2929 MOI. set (model, MOA. Algorithm (), MOA. Lexicographic ())
30+ @test MOI. supports (model, MOA. LexicographicAllPermutations ())
31+ MOI. set (model, MOA. LexicographicAllPermutations (), false )
3032 MOI. set (model, MOA. ObjectiveRelativeTolerance (1 ), 0.1 )
3133 MOI. set (model, MOI. Silent (), true )
3234 x = MOI. add_variables (model, 4 )
@@ -42,14 +44,10 @@ function test_knapsack()
4244 return
4345end
4446
45- function test_knapsack_all_permutations ()
47+ function test_knapsack_default ()
4648 P = Float64[1 0 0 0 ; 0 1 0 0 ; 0 0 0 1 ]
4749 model = MOA. Optimizer (HiGHS. Optimizer)
48- MOI. set (
49- model,
50- MOA. Algorithm (),
51- MOA. Lexicographic (; all_permutations = true ),
52- )
50+ MOI. set (model, MOA. Algorithm (), MOA. Lexicographic ())
5351 MOI. set (model, MOI. Silent (), true )
5452 x = MOI. add_variables (model, 4 )
5553 MOI. add_constraint .(model, x, MOI. GreaterThan (0.0 ))
@@ -77,6 +75,7 @@ function test_knapsack_min()
7775 P = Float64[1 0 0 0 ; 0 1 0 0 ; 0 0 0 1 ; 0 0 1 0 ]
7876 model = MOA. Optimizer (HiGHS. Optimizer)
7977 MOI. set (model, MOA. Algorithm (), MOA. Lexicographic ())
78+ MOI. set (model, MOA. LexicographicAllPermutations (), false )
8079 MOI. set (model, MOA. ObjectiveRelativeTolerance (1 ), 0.1 )
8180 MOI. set (model, MOI. Silent (), true )
8281 x = MOI. add_variables (model, 4 )
@@ -92,9 +91,11 @@ function test_knapsack_min()
9291 return
9392end
9493
95- function test_knapsack_default ()
94+ function test_knapsack_one_solution ()
9695 P = Float64[1 0 0 0 ; 0 1 0 0 ; 0 0 0 1 ; 0 0 1 0 ]
9796 model = MOA. Optimizer (HiGHS. Optimizer)
97+ MOI. set (model, MOA. Algorithm (), MOA. Lexicographic ())
98+ MOI. set (model, MOA. LexicographicAllPermutations (), false )
9899 MOI. set (model, MOI. Silent (), true )
99100 x = MOI. add_variables (model, 4 )
100101 MOI. add_constraint .(model, x, MOI. GreaterThan (0.0 ))
114115function test_infeasible ()
115116 for flag in (true , false )
116117 model = MOA. Optimizer (HiGHS. Optimizer)
117- MOI. set (
118- model,
119- MOA. Algorithm (),
120- MOA. Lexicographic (; all_permutations = flag),
121- )
118+ MOI. set (model, MOA. Algorithm (), MOA. Lexicographic ())
119+ MOI. set (model, MOA. LexicographicAllPermutations (), flag)
122120 MOI. set (model, MOI. Silent (), true )
123121 x = MOI. add_variables (model, 2 )
124122 MOI. add_constraint .(model, x, MOI. GreaterThan (0.0 ))
136134function test_unbounded ()
137135 for flag in (true , false )
138136 model = MOA. Optimizer (HiGHS. Optimizer)
139- MOI. set (
140- model,
141- MOA. Algorithm (),
142- MOA. Lexicographic (; all_permutations = flag),
143- )
137+ MOI. set (model, MOA. Algorithm (), MOA. Lexicographic ())
138+ MOI. set (model, MOA. LexicographicAllPermutations (), flag)
144139 MOI. set (model, MOI. Silent (), true )
145140 x = MOI. add_variables (model, 2 )
146141 MOI. add_constraint .(model, x, MOI. GreaterThan (0.0 ))
0 commit comments