Skip to content

Fix warnings - #2483

Merged
galabovaa merged 4 commits into
ERGO-Code:latestfrom
fwesselm:warningsAgainAaah
Aug 5, 2025
Merged

Fix warnings#2483
galabovaa merged 4 commits into
ERGO-Code:latestfrom
fwesselm:warningsAgainAaah

Conversation

@fwesselm

@fwesselm fwesselm commented Aug 1, 2025

Copy link
Copy Markdown
Collaborator

Fix some warnings concerned with type conversions / loss of precision reported here.

@codecov

codecov Bot commented Aug 1, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.64516% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.55%. Comparing base (ebd83e1) to head (33bbdec).
⚠️ Report is 14 commits behind head on latest.

Files with missing lines Patch % Lines
highs/simplex/HEkkDualRHS.cpp 0.00% 3 Missing ⚠️
highs/io/HMpsFF.cpp 50.00% 2 Missing ⚠️
highs/util/HFactor.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #2483      +/-   ##
==========================================
- Coverage   79.55%   79.55%   -0.01%     
==========================================
  Files         346      346              
  Lines       85401    85403       +2     
==========================================
+ Hits        67942    67943       +1     
- Misses      17459    17460       +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.

@Opt-Mucca
Opt-Mucca self-requested a review August 1, 2025 13:22

@Opt-Mucca Opt-Mucca left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Support for this change! Will make my IDE happier.

Comment thread highs/lp_data/HighsLp.cpp
has_duplicate = !this->name2index.emplace(name[index], index).second;
for (size_t index = 0; index < name.size(); index++) {
has_duplicate =
!this->name2index.emplace(name[index], static_cast<int>(index)).second;

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.

I see why this has to be name2index.emplace(name[index], static_cast<int>(index)) - since HighsNameHash::name2index is std::unordered_map<std::string, int>, but it seems odd to have the loop parameter index to be size_t. Yes, it fits with index < name.size(), but it looks confusing

I should have created HighsNameHash::name2index as std::unordered_map<std::string, HighsInt>, and then all "ints" would be HighsInt

Not a big issue

@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.

Changes have been made to some long-established code, and I can't check whether some are correct. I have to trust that any errors would soon yield failure in unit/instance tests.

@galabovaa
galabovaa merged commit 02662c3 into ERGO-Code:latest Aug 5, 2025
195 checks passed
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.

4 participants