@@ -37,6 +37,7 @@ function test_no_solution()
3737 @constraint (model, c, x^ 4 >= 0 ) # this will make the model non-linear
3838 @test_throws ErrorException ModelAnalyzer. Feasibility. dual_feasibility_report (
3939 model,
40+ point = Dict (), # to skip dual solutions error
4041 )
4142end
4243
@@ -176,6 +177,64 @@ function test_analyse_simple()
176177 return
177178end
178179
180+ function test_analyse_simple_direct ()
181+ model = direct_model (HiGHS. Optimizer ())
182+ set_silent (model)
183+ @variable (model, x)
184+ @constraint (model, c, x >= 0 )
185+ @objective (model, Min, 2 * x)
186+
187+ optimize! (model)
188+
189+ data = ModelAnalyzer. analyze (ModelAnalyzer. Feasibility. Analyzer (), model)
190+
191+ list = ModelAnalyzer. list_of_issue_types (data)
192+
193+ @test length (list) == 0
194+
195+ return
196+ end
197+
198+ function test_with_interval ()
199+ model = Model (HiGHS. Optimizer)
200+ set_silent (model)
201+ @variable (model, x >= 1 )
202+ @constraint (model, c, 2 * x in MOI. Interval (0.0 , 3.0 ))
203+ @objective (model, Min, x)
204+ optimize! (model)
205+ @test ! ModelAnalyzer. Feasibility. _can_dualize (model)
206+ # TODO this should eb a waning at least
207+ data = ModelAnalyzer. analyze (ModelAnalyzer. Feasibility. Analyzer (), model)
208+ return
209+ end
210+
211+ function test_analyse_many_constraint_types ()
212+ model = Model (HiGHS. Optimizer)
213+ set_silent (model)
214+ @variable (model, x >= 1 )
215+ @variable (model, y <= 0 )
216+ @variable (model, z == 0 )
217+ @variable (model, w)
218+ @variable (model, 0 <= v <= 1 )
219+ @constraint (model, c1, x >= 0 )
220+ @constraint (model, c2, x <= 10 )
221+ @constraint (model, c3, x == 5 )
222+ @constraint (model, c4, y >= - 1 )
223+ @constraint (model, c5, w == 3 )
224+ @constraint (model, c6, [2 v] in Nonpositives ()) # this should be redundant as z is fixed to 0
225+ @objective (model, Min, x)
226+
227+ optimize! (model)
228+
229+ data = ModelAnalyzer. analyze (ModelAnalyzer. Feasibility. Analyzer (), model)
230+
231+ list = ModelAnalyzer. list_of_issue_types (data)
232+
233+ @test length (list) == 0
234+
235+ return
236+ end
237+
179238function test_analyse_mip ()
180239 model = Model (HiGHS. Optimizer)
181240 set_silent (model)
0 commit comments