mirror of
https://github.com/ANL-CEEESA/MIPLearn.jl.git
synced 2025-12-06 08:28:52 -06:00
FisSal2011: Improve estimated tableau density
This commit is contained in:
@@ -327,6 +327,7 @@ function collect_gmi_FisSal2011(
|
|||||||
pool_cut_age = nothing
|
pool_cut_age = nothing
|
||||||
pool_cut_hashes = Set{UInt64}()
|
pool_cut_hashes = Set{UInt64}()
|
||||||
pool_size_mb = 0
|
pool_size_mb = 0
|
||||||
|
tableau_density::Float32 = 0.05
|
||||||
λ, Δ = 0, 0
|
λ, Δ = 0, 0
|
||||||
μ = 10
|
μ = 10
|
||||||
end
|
end
|
||||||
@@ -470,7 +471,8 @@ function collect_gmi_FisSal2011(
|
|||||||
end
|
end
|
||||||
|
|
||||||
@timeit "Compute tableau rows" begin
|
@timeit "Compute tableau rows" begin
|
||||||
tableau = compute_tableau(data_s, basis, x = sol_frac, rows = selected_rows)
|
tableau = compute_tableau(data_s, basis, x = sol_frac, rows = selected_rows, estimated_density=tableau_density * 1.05)
|
||||||
|
tableau_density = nnz(tableau.lhs) / length(tableau.lhs)
|
||||||
assert_eq(tableau.lhs * sol_frac, tableau.rhs, atol=1e-3)
|
assert_eq(tableau.lhs * sol_frac, tableau.rhs, atol=1e-3)
|
||||||
assert_eq(tableau.lhs * sol_opt_s, tableau.rhs, atol=1e-3)
|
assert_eq(tableau.lhs * sol_opt_s, tableau.rhs, atol=1e-3)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ function compute_tableau(
|
|||||||
x::Union{Nothing,Vector{Float64}} = nothing,
|
x::Union{Nothing,Vector{Float64}} = nothing,
|
||||||
rows::Union{Vector{Int},Nothing} = nothing,
|
rows::Union{Vector{Int},Nothing} = nothing,
|
||||||
tol = 1e-8,
|
tol = 1e-8,
|
||||||
|
estimated_density = 0.10,
|
||||||
)::Tableau
|
)::Tableau
|
||||||
@timeit "Split data" begin
|
@timeit "Split data" begin
|
||||||
nrows, ncols = size(data.constr_lhs)
|
nrows, ncols = size(data.constr_lhs)
|
||||||
@@ -78,7 +79,7 @@ function compute_tableau(
|
|||||||
tableau_lhs_I::Array{Int} = Int[]
|
tableau_lhs_I::Array{Int} = Int[]
|
||||||
tableau_lhs_J::Array{Int} = Int[]
|
tableau_lhs_J::Array{Int} = Int[]
|
||||||
tableau_lhs_V::Array{Float64} = Float64[]
|
tableau_lhs_V::Array{Float64} = Float64[]
|
||||||
estimated_nnz::Int = length(rows) * ncols ÷ 20
|
estimated_nnz::Int = round(length(rows) * ncols * estimated_density)
|
||||||
sizehint!(tableau_lhs_I, estimated_nnz)
|
sizehint!(tableau_lhs_I, estimated_nnz)
|
||||||
sizehint!(tableau_lhs_J, estimated_nnz)
|
sizehint!(tableau_lhs_J, estimated_nnz)
|
||||||
sizehint!(tableau_lhs_V, estimated_nnz)
|
sizehint!(tableau_lhs_V, estimated_nnz)
|
||||||
|
|||||||
Reference in New Issue
Block a user