From 86a2092a343007a7981380c1166d366eacef63c3 Mon Sep 17 00:00:00 2001 From: Guillaume Marques Date: Thu, 9 Nov 2023 14:34:07 +0100 Subject: [PATCH] test ok but do not pass --- src/Algorithm/presolve/interface.jl | 5 ++-- src/Algorithm/presolve/propagation.jl | 38 ++++++++++++++++----------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/Algorithm/presolve/interface.jl b/src/Algorithm/presolve/interface.jl index e16177455..749c8cc7b 100644 --- a/src/Algorithm/presolve/interface.jl +++ b/src/Algorithm/presolve/interface.jl @@ -443,6 +443,9 @@ function propagate_partial_sol_to_global_bounds!(presolve_repr_master, local_rep new_ubs[col] = min(ub - val, def_glob_ub) end + @show new_lbs + @show new_ubs + presolve_repr_master.form.lbs = new_lbs presolve_repr_master.form.ubs = new_ubs return @@ -481,8 +484,6 @@ function compute_default_global_bounds(presolve_repr_master, presolve_dw_pricing end """ - - Returns the local restricted partial solution. """ function propagate_partial_sol_into_master!(presolve_reform, master, dw_pricing_sps) diff --git a/src/Algorithm/presolve/propagation.jl b/src/Algorithm/presolve/propagation.jl index 2cd5debb7..286ef928e 100644 --- a/src/Algorithm/presolve/propagation.jl +++ b/src/Algorithm/presolve/propagation.jl @@ -114,13 +114,17 @@ function propagate_local_bounds!(presolve_repr_master::PresolveFormulation, mast local_lb = presolve_sp.form.lbs[i] local_ub = presolve_sp.form.ubs[i] + println("------ $i ------") + if !isinf(global_lb) && !isinf(local_ub) new_local_lb = global_lb - local_ub * (local_ub > 0 ? um : lm) + @show new_local_lb presolve_sp.form.lbs[i] = max(new_local_lb, local_lb) end if !isinf(global_ub) && !isinf(local_lb) new_local_ub = global_ub - local_lb * (local_lb > 0 ? lm : um) + @show new_local_ub presolve_sp.form.ubs[i] = min(new_local_ub, local_ub) end end @@ -172,25 +176,29 @@ function partial_sol_on_repr( if abs(partial_sol_value) > Coluna.TOL var = presolve_master_restr.col_to_var[col] varid = getid(var) - if !(getduty(varid) <= MasterCol) - continue - end - spid = getoriginformuid(varid) - spform = get(dw_pricing_sps, spid, nothing) - @assert !isnothing(spform) - column = @view get_primal_sol_pool(spform).solutions[varid,:] - for (varid, val) in column - getduty(varid) <= DwSpPricingVar || continue + if getduty(varid) <= MasterCol + spid = getoriginformuid(varid) + spform = get(dw_pricing_sps, spid, nothing) + @assert !isnothing(spform) + column = @view get_primal_sol_pool(spform).solutions[varid,:] + for (varid, val) in column + getduty(varid) <= DwSpPricingVar || continue + master_repr_var_col = get(presolve_master_repr.var_to_col, varid, nothing) + if !isnothing(master_repr_var_col) + partial_solution[master_repr_var_col] += val * partial_sol_value + end + if !new_column_explored + nb_fixed_columns[spid] += partial_sol_value + new_column_explored = true + end + end + new_column_explored = false + elseif getduty(varid) <= MasterPureVar master_repr_var_col = get(presolve_master_repr.var_to_col, varid, nothing) if !isnothing(master_repr_var_col) - partial_solution[master_repr_var_col] += val * partial_sol_value - end - if !new_column_explored - nb_fixed_columns[spid] += partial_sol_value - new_column_explored = true + partial_solution[master_repr_var_col] += partial_sol_value end end - new_column_explored = false end end return partial_solution, nb_fixed_columns