From d8269a212d6e9f07c40507f5bb2df6be12b51a9b Mon Sep 17 00:00:00 2001 From: Ruslan Sadykov Date: Fri, 2 Feb 2024 17:13:11 +0100 Subject: [PATCH 1/2] Put back function `column_is_proper` --- src/Algorithm/presolve/interface.jl | 6 ++++++ src/MathProg/formulation.jl | 4 ++-- test/unit/Presolve/presolve.jl | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Algorithm/presolve/interface.jl b/src/Algorithm/presolve/interface.jl index 0b1f9f95d..411d84c11 100644 --- a/src/Algorithm/presolve/interface.jl +++ b/src/Algorithm/presolve/interface.jl @@ -550,3 +550,9 @@ function _column_is_proper(col_id, sp_form) end return true end + +function column_is_proper(col_id, reform) + sp_id = getoriginformuid(col_id) + sp_form = get_dw_pricing_sps(reform)[sp_id] + return _column_is_proper(col_id, sp_form) +end diff --git a/src/MathProg/formulation.jl b/src/MathProg/formulation.jl index 7da7e1d84..04447b813 100644 --- a/src/MathProg/formulation.jl +++ b/src/MathProg/formulation.jl @@ -356,8 +356,8 @@ function _addlocalartvar!(form::Formulation, constr::Constraint, abs_cost::Float constrname = getname(form, constr) constrsense = getperensense(form, constr) if constrsense == Equal - name1 = string("local_art_of_", constrname, "1") - name2 = string("local_art_of_", constrname, "2") + name1 = string("local_pos_art_of_", constrname) + name2 = string("local_neg_art_of_", constrname) var1 = setvar!( form, name1, art_var_duty; cost=cost, lb=0.0, ub=Inf, kind=Continuous ) diff --git a/test/unit/Presolve/presolve.jl b/test/unit/Presolve/presolve.jl index dbf7259c2..70735cb70 100644 --- a/test/unit/Presolve/presolve.jl +++ b/test/unit/Presolve/presolve.jl @@ -604,6 +604,8 @@ function test_presolve_full() └ value = 1.00 """ + @test Coluna.Algorithm.column_is_proper(master_vars["MC_1"], reform) == false + @test Coluna.Algorithm.column_is_proper(master_vars["MC_2"], reform) == true input = Coluna.Algorithm.PresolveInput(Dict(master_vars["MC_1"] => 0.0)) output = Coluna.Algorithm.run!(presolve_algorithm, env, reform, input) @@ -616,4 +618,4 @@ function test_presolve_full() return nothing end -register!(unit_tests, "presolve_reformulation", test_presolve_full) \ No newline at end of file +register!(unit_tests, "presolve_reformulation", test_presolve_full, f=true) \ No newline at end of file From 7364088297030bc3981e7ee0565f41b5c39f09a3 Mon Sep 17 00:00:00 2001 From: Ruslan Sadykov Date: Fri, 2 Feb 2024 17:30:07 +0100 Subject: [PATCH 2/2] Activate all tests --- test/unit/Presolve/presolve.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/Presolve/presolve.jl b/test/unit/Presolve/presolve.jl index 70735cb70..307021ecf 100644 --- a/test/unit/Presolve/presolve.jl +++ b/test/unit/Presolve/presolve.jl @@ -618,4 +618,4 @@ function test_presolve_full() return nothing end -register!(unit_tests, "presolve_reformulation", test_presolve_full, f=true) \ No newline at end of file +register!(unit_tests, "presolve_reformulation", test_presolve_full) \ No newline at end of file