Allow slightly asymmetric square Hessians, and revert to using HighsHashTable (mainly) In assessMatrix#2984
Conversation
…sian asymmetry; modified HighsHessianUtils.cpp to permit it
…ent to std::vector<HighsInt> el_in_vec;
… unordered_map similar for neos; vector 3x slower
…es, when unordered_map is used; silenced unit tests; formatted
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## latest #2984 +/- ##
=======================================
Coverage 81.30% 81.31%
=======================================
Files 359 359
Lines 88792 88852 +60
=======================================
+ Hits 72196 72253 +57
- Misses 16596 16599 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| HighsInt num_summation = 0; | ||
| HighsInt num_upper_triangle = 0; | ||
| HighsInt num_hessian_el = 0; | ||
| const double kSquareHessianAsymmetryTolerance = 1e-10; |
There was a problem hiding this comment.
Open question whether to hard-code this or make it an option.
The argument in favour of this hard-coding is that anyone wanting to change it needs a really good reason, and they should almost certainly just use the triangular input.
There was a problem hiding this comment.
I'd rather hard code it, as you do in JuMP.
If the difference is larger than 1e-10 due to inexact arithmetic, then users should be aware and handling it themselves
| } | ||
| if (dev_run) { | ||
| tt += getWallTime(); | ||
| printf("Added %d rows individually in %.2gs\n", int(lp.num_row_), tt); |
There was a problem hiding this comment.
Did you benchmark the before/after or should I do it with the Julia example?
There was a problem hiding this comment.
When loading the LP neos row-by-row, It's about 3x faster with the two current ways of tracking duplicates than with 1.14. Using HighsHashTable (as before 1.14) is slightly faster than unordered_map (unsurprisingly) so I left that as the default - unless duplicates need to be summed
Added a test on the difference between corresponding off-diagonal entries in a square Hessian, allowing them to differ by 1e-10. This should close #2979
Reverted to using
HighsHashTable(mainly) InassessMatrixto identify duplicate entries in a matrix column/row, unless a Hessian is being assessed (so duplicate entries are summed) when anunordered_mapis used. This closes #2977