Remove copies of LP in HiPO wrapper - #2768
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## latest #2768 +/- ##
==========================================
- Coverage 80.32% 80.32% -0.01%
==========================================
Files 348 348
Lines 86073 86075 +2
==========================================
+ Hits 69141 69142 +1
- Misses 16932 16933 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
filikat
marked this pull request as ready for review
January 24, 2026 14:39
Collaborator
Author
|
@jajhall I can do the same for IPX if we want. There is no real performance gain though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, when calling HiPO, in IpxWrapper.cpp, a copy of the LP is made using fillInIpxData. This copy is then passed to hipo::Solver::load, which makes another copy to store internally. The copy made in IpxWrapper.cpp is unused, but remains in scope for the whole time that the solver runs.
This PR changes the interface of hipo::Solver::load to accept a HighsLp instance. Then, fillInIpxData is called from hipo::Model::init and a copy of the LP is made directly in the HiPO internal storage, eliminating the need for an intermediate copy. A pointer to the original HighsLp is stored, in case it needs to be loaded into IPX later.
To achieve this, I had to separate the construction of rhs and constraints into a separate function fillInRhsAndConstraints, because a copy of these is needed in IpxWrapper.
While doing this, I noticed that at the end of fillInIpxData, the objective vector is augmented with some slacks, but num_var is not changed. These slacks are useless, since both HiPO and IPX copy only the first num_var entries of the objective vector.
I also fixed the way that option timeless_log is passed to IPX from HiPO and suppressed the printing of some times in the HiPO summary if timeless_log is true.