File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 136136function MOI. get (opt:: Optimizer , :: MOI.NodeCount )
137137 return MOI. get (opt. oa_model, MOI. NodeCount ())
138138end
139+
140+ """
141+ NumberOfCuts
142+
143+ Number of cuts added to the outer approximation model.
144+ """
145+ struct NumberOfCuts <: MOI.AbstractOptimizerAttribute
146+ end
147+
148+ function MOI. get (opt:: Optimizer , :: NumberOfCuts )
149+ return opt. num_cuts
150+ end
Original file line number Diff line number Diff line change @@ -69,9 +69,18 @@ function run_jump_tests(
6969 println (inst)
7070 inst (opt)
7171 end
72+ run_cut_test (_soc1, opt)
73+ run_cut_test (_expdesign, opt)
7274 return
7375end
7476
77+ function run_cut_test (test_function, opt)
78+ MOI. empty! (opt)
79+ @test MOI. get (opt, Pajarito. NumberOfCuts ()) == 0
80+ test_function (opt)
81+ @test MOI. get (opt, Pajarito. NumberOfCuts ()) > 0
82+ end
83+
7584function _soc1 (opt)
7685 TOL = 1e-4
7786 m = JuMP. Model (opt)
You can’t perform that action at this time.
0 commit comments