@@ -62,6 +62,7 @@ function run_jump_tests(
6262 _psd2,
6363 _expdesign,
6464 _specialorderedset,
65+ _soc1_ncuts,
6566 ]
6667 @testset " $inst " for inst in insts
6768 println (inst)
@@ -481,4 +482,56 @@ function _specialorderedset(opt)
481482 return
482483end
483484
485+ function _soc1_ncuts (opt)
486+ TOL = 1e-4
487+ m = JuMP. Model (opt)
488+
489+ JuMP. @variable (m, x)
490+ JuMP. @objective (m, Min, - x)
491+ xlb1 = JuMP. @constraint (m, x >= 4 )
492+ soc1 = JuMP. @constraint (m, [3.5 , x] in JuMP. SecondOrderCone ())
493+ JuMP. optimize! (m)
494+ @test JuMP. termination_status (m) == MOI. INFEASIBLE
495+ @test JuMP. primal_status (m) == MOI. NO_SOLUTION
496+
497+ JuMP. delete (m, xlb1)
498+ JuMP. optimize! (m)
499+ @test JuMP. termination_status (m) == MOI. OPTIMAL
500+ @test JuMP. primal_status (m) == MOI. FEASIBLE_POINT
501+ @test isapprox (JuMP. objective_value (m), - 3.5 , atol = TOL)
502+ @test isapprox (JuMP. objective_bound (m), - 3.5 , atol = TOL)
503+ @test isapprox (JuMP. value (x), 3.5 , atol = TOL)
504+
505+ xlb2 = JuMP. @constraint (m, x >= 3.1 )
506+ JuMP. set_integer (x)
507+ JuMP. optimize! (m)
508+ @test JuMP. termination_status (m) == MOI. INFEASIBLE
509+
510+ JuMP. delete (m, xlb2)
511+ JuMP. @constraint (m, x >= 0.5 )
512+ JuMP. optimize! (m)
513+ @test JuMP. termination_status (m) == MOI. OPTIMAL
514+ @test MOI. get (m, Pajarito. NumberOfCuts ()) > 0
515+ @test isapprox (JuMP. objective_value (m), - 3 , atol = TOL)
516+ @test isapprox (JuMP. objective_bound (m), - 3 , atol = TOL)
517+ @test isapprox (JuMP. value (x), 3 , atol = TOL)
518+
519+ JuMP. @objective (m, Max, - 3 x)
520+ JuMP. optimize! (m)
521+ @test MOI. get (m, Pajarito. NumberOfCuts ()) > 0
522+ @test JuMP. termination_status (m) == MOI. OPTIMAL
523+ @test isapprox (JuMP. objective_value (m), - 3 , atol = TOL)
524+ @test isapprox (JuMP. objective_bound (m), - 3 , atol = TOL)
525+ @test isapprox (JuMP. value (x), 1 , atol = TOL)
526+
527+ JuMP. set_start_value (x, 1 )
528+ JuMP. optimize! (m)
529+ @test JuMP. termination_status (m) == MOI. OPTIMAL
530+ @test MOI. get (m, Pajarito. NumberOfCuts ()) > 0
531+ @test isapprox (JuMP. objective_value (m), - 3 , atol = TOL)
532+ @test isapprox (JuMP. objective_bound (m), - 3 , atol = TOL)
533+ @test isapprox (JuMP. value (x), 1 , atol = TOL)
534+ return
535+ end
536+
484537end
0 commit comments