Remove copies of LP in HiPO wrapper #2768
Open
+127
−142
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.