FisSal2011: Accelerate creation of obj function

fs11_01
Alinson S. Xavier 2 months ago
parent 3ca5a4fec7
commit e2906a0a7e

@ -389,10 +389,15 @@ function collect_gmi_FisSal2011(
log_should_print = false
if round > 1
@timeit "Update objective function" begin
# Build Lagrangian term
v = sparse(pool.lhs * multipliers_curr)
@timeit "Build Lagrangian term" begin
@timeit "mul" begin
active_idx = findall(multipliers_curr .> 1e-6)
v = sparse(pool.lhs[:, active_idx] * multipliers_curr[active_idx])
end
@timeit "dot" begin
lagr_term = AffExpr(dot(multipliers_curr, pool.lb))
end
@timeit "add_to_expression!" begin
for offset in 1:nnz(v)
var_idx = v.nzind[offset]
add_to_expression!(
@ -401,8 +406,9 @@ function collect_gmi_FisSal2011(
- v.nzval[offset],
)
end
# Update objective
end
end
@timeit "Update objective" begin
set_objective_function(
model_s,
orig_obj_s + lagr_term,

Loading…
Cancel
Save