Skip to content

Remove copies of LP in HiPO wrapper - #2768

Merged
filikat merged 7 commits into
latestfrom
hipo-no-copies
Jan 28, 2026
Merged

Remove copies of LP in HiPO wrapper#2768
filikat merged 7 commits into
latestfrom
hipo-no-copies

Conversation

@filikat

@filikat filikat commented Jan 23, 2026

Copy link
Copy Markdown
Collaborator

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.

@codecov

codecov Bot commented Jan 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.32%. Comparing base (a058a69) to head (d0db680).
⚠️ Report is 43 commits behind head on latest.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@filikat
filikat marked this pull request as ready for review January 24, 2026 14:39
@filikat
filikat requested a review from jajhall January 24, 2026 14:40
@filikat

filikat commented Jan 24, 2026

Copy link
Copy Markdown
Collaborator Author

@jajhall I can do the same for IPX if we want. There is no real performance gain though.

@jajhall jajhall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @filikat, this better all round

@filikat
filikat merged commit 659ca89 into latest Jan 28, 2026
369 of 375 checks passed
@filikat
filikat deleted the hipo-no-copies branch January 28, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants