|
|
@ -486,8 +486,7 @@ function collect_gmi_FisSal2011(
|
|
|
|
@timeit "Compute cut hashses" begin
|
|
|
|
@timeit "Compute cut hashses" begin
|
|
|
|
unique_indices = Int[]
|
|
|
|
unique_indices = Int[]
|
|
|
|
for i in 1:ncuts
|
|
|
|
for i in 1:ncuts
|
|
|
|
cut_data = (cuts_s.lhs[i, :], cuts_s.lb[i], cuts_s.ub[i])
|
|
|
|
cut_hash = cuts_s.hash[i]
|
|
|
|
cut_hash = hash(cut_data)
|
|
|
|
|
|
|
|
if !(cut_hash in pool_cut_hashes)
|
|
|
|
if !(cut_hash in pool_cut_hashes)
|
|
|
|
push!(pool_cut_hashes, cut_hash)
|
|
|
|
push!(pool_cut_hashes, cut_hash)
|
|
|
|
push!(unique_indices, i)
|
|
|
|
push!(unique_indices, i)
|
|
|
@ -499,7 +498,8 @@ function collect_gmi_FisSal2011(
|
|
|
|
pool = ConstraintSet(
|
|
|
|
pool = ConstraintSet(
|
|
|
|
lhs = sparse(cuts_s.lhs[unique_indices, :]'),
|
|
|
|
lhs = sparse(cuts_s.lhs[unique_indices, :]'),
|
|
|
|
lb = cuts_s.lb[unique_indices],
|
|
|
|
lb = cuts_s.lb[unique_indices],
|
|
|
|
ub = cuts_s.ub[unique_indices]
|
|
|
|
ub = cuts_s.ub[unique_indices],
|
|
|
|
|
|
|
|
hash = cuts_s.hash[unique_indices],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
ncuts_unique = length(unique_indices)
|
|
|
|
ncuts_unique = length(unique_indices)
|
|
|
|
multipliers_curr = zeros(ncuts_unique)
|
|
|
|
multipliers_curr = zeros(ncuts_unique)
|
|
|
@ -511,6 +511,7 @@ function collect_gmi_FisSal2011(
|
|
|
|
pool.lhs = [pool.lhs sparse(cuts_s.lhs[unique_indices, :]')]
|
|
|
|
pool.lhs = [pool.lhs sparse(cuts_s.lhs[unique_indices, :]')]
|
|
|
|
pool.lb = [pool.lb; cuts_s.lb[unique_indices]]
|
|
|
|
pool.lb = [pool.lb; cuts_s.lb[unique_indices]]
|
|
|
|
pool.ub = [pool.ub; cuts_s.ub[unique_indices]]
|
|
|
|
pool.ub = [pool.ub; cuts_s.ub[unique_indices]]
|
|
|
|
|
|
|
|
pool.hash = [pool.hash; cuts_s.hash[unique_indices]]
|
|
|
|
multipliers_curr = [multipliers_curr; zeros(ncuts_unique)]
|
|
|
|
multipliers_curr = [multipliers_curr; zeros(ncuts_unique)]
|
|
|
|
multipliers_best = [multipliers_best; zeros(ncuts_unique)]
|
|
|
|
multipliers_best = [multipliers_best; zeros(ncuts_unique)]
|
|
|
|
pool_cut_age = [pool_cut_age; zeros(ncuts_unique)]
|
|
|
|
pool_cut_age = [pool_cut_age; zeros(ncuts_unique)]
|
|
|
@ -531,14 +532,15 @@ function collect_gmi_FisSal2011(
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@timeit "Update cut hashes" begin
|
|
|
|
@timeit "Update cut hashes" begin
|
|
|
|
for idx in idx_remove
|
|
|
|
for idx in idx_remove
|
|
|
|
cut_data = (pool.lhs[:, idx], pool.lb[idx], pool.ub[idx])
|
|
|
|
cut_hash = pool.hash[idx]
|
|
|
|
delete!(pool_cut_hashes, hash(cut_data))
|
|
|
|
delete!(pool_cut_hashes, cut_hash)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@timeit "Update cut pool" begin
|
|
|
|
@timeit "Update cut pool" begin
|
|
|
|
pool.lhs = pool.lhs[:, idx_keep]
|
|
|
|
pool.lhs = pool.lhs[:, idx_keep]
|
|
|
|
pool.ub = pool.ub[idx_keep]
|
|
|
|
pool.ub = pool.ub[idx_keep]
|
|
|
|
pool.lb = pool.lb[idx_keep]
|
|
|
|
pool.lb = pool.lb[idx_keep]
|
|
|
|
|
|
|
|
pool.hash = pool.hash[idx_keep]
|
|
|
|
multipliers_curr = multipliers_curr[idx_keep]
|
|
|
|
multipliers_curr = multipliers_curr[idx_keep]
|
|
|
|
multipliers_best = multipliers_best[idx_keep]
|
|
|
|
multipliers_best = multipliers_best[idx_keep]
|
|
|
|
pool_cut_age = pool_cut_age[idx_keep]
|
|
|
|
pool_cut_age = pool_cut_age[idx_keep]
|
|
|
|