Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
Update preprocess.jl to fix the slow diagonal scaling (#119)
Browse files Browse the repository at this point in the history
* Update preprocess.jl

* Update preprocess.jl

* Update preprocess.jl

Run auto-format
  • Loading branch information
haihaolu authored Nov 3, 2023
1 parent 205e0e7 commit 69dcc66
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/preprocess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -561,15 +561,13 @@ function scale_problem(
@assert all(t -> t > 0, variable_rescaling)
problem.objective_vector ./= variable_rescaling
problem.objective_matrix =
Diagonal(1 ./ variable_rescaling) *
problem.objective_matrix *
(Diagonal(1 ./ variable_rescaling) * problem.objective_matrix) *
Diagonal(1 ./ variable_rescaling)
problem.variable_upper_bound .*= variable_rescaling
problem.variable_lower_bound .*= variable_rescaling
problem.right_hand_side ./= constraint_rescaling
problem.constraint_matrix =
Diagonal(1 ./ constraint_rescaling) *
problem.constraint_matrix *
(Diagonal(1 ./ constraint_rescaling) * problem.constraint_matrix) *
Diagonal(1 ./ variable_rescaling)
return
end
Expand Down

0 comments on commit 69dcc66

Please sign in to comment.