Math_Opt x Highs enum update
- Dominant language
- C++
- Stars
- 14.1k
- Forks
- 2.5k
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 72
Description
Seems we forget the management of the new enum: `kInterrupt`, `kMemoryLimit`,`kMax`
```sh
%bazel build -c opt //ortools/math_opt/...
INFO: Analyzed 262 targets (2 packages loaded, 171 targets configured).
INFO: From Compiling ortools/math_opt/solvers/highs_solver.cc:
ortools/math_opt/solvers/highs_solver.cc: In static member function 'static absl::lts_20240722::StatusOr operations_research::math_opt::HighsSolver::MakeTermination(HighsModelStatus, const HighsInfo&, bool, bool, bool, bool, SolutionClaims)':
ortools/math_opt/solvers/highs_solver.cc:491:10: warning: enumeration value 'kSolutionLimit' not handled in switch [-Wswitch]
491 | switch (highs_model_status) {
| ^
ortools/math_opt/solvers/highs_solver.cc:491:10: warning: enumeration value 'kInterrupt' not handled in switch [-Wswitch]
ortools/math_opt/solvers/highs_solver.cc:491:10: warning: enumeration value 'kMemoryLimit' not handled in switch [-Wswitch]
ortools/math_opt/solvers/highs_solver.cc:491:10: warning: enumeration value 'kMax' not handled in switch [-Wswitch]
INFO: From Compiling ortools/math_opt/solvers/highs_solver.cc:
ortools/math_opt/solvers/highs_solver.cc: In static member function 'static absl::lts_20240722::StatusOr operations_research::math_opt::HighsSolver::MakeTermination(HighsModelStatus, const HighsInfo&, bool, bool, bool, bool, SolutionClaims)':
ortools/math_opt/solvers/highs_solver.cc:491:10: warning: enumeration value 'kSolutionLimit' not handled in switch [-Wswitch]
491 | switch (highs_model_status) {
| ^
ortools/math_opt/solvers/highs_solver.cc:491:10: warning: enumeration value 'kInterrupt' not handled in switch [-Wswitch]
ortools/math_opt/solvers/highs_solver.cc:491:10: warning: enumeration value 'kMemoryLimit' not handled in switch [-Wswitch]
ortools/math_opt/solvers/highs_solver.cc:491:10: warning: enumeration value 'kMax' not handled in switch [-Wswitch]
INFO: From Compiling ortools/math_opt/cpp/variable_and_expressions.cc:
ortools/math_opt/cpp/variable_and_expressions.cc: In function 'std::ostream& operations_research::math_opt::operator<<(std::ostream&, const QuadraticExpression&)':
ortools/math_opt/cpp/variable_and_expressions.cc:160:19: warning: loop variable 'vs' creates a copy from type 'const operations_research::math_opt::QuadraticTermKey' [-Wrange-loop-construct]
160 | for (const auto vs : SortedKeys(expr.quadratic_terms())) {
| ^~
ortools/math_opt/cpp/variable_and_expressions.cc:160:19: note: use reference type to prevent copying
160 | for (const auto vs : SortedKeys(expr.quadratic_terms())) {
| ^~
| &
INFO: From Compiling ortools/math_opt/cpp/variable_and_expressions.cc:
ortools/math_opt/cpp/variable_and_expressions.cc: In function 'std::ostream& operations_research::math_opt::operator<<(std::ostream&, const QuadraticExpression&)':
ortools/math_opt/cpp/variable_and_expressions.cc:160:19: warning: loop variable 'vs' creates a copy from type 'const operations_research::math_opt::QuadraticTermKey' [-Wrange-loop-construct]
160 | for (const auto vs : SortedKeys(expr.quadratic_terms())) {
| ^~
```
source:
https://github.com/google/or-tools/blob/b924e12220d97f178432ee502569244a44ddda08/ortools/math_opt/solvers/highs_solver.cc#L490-L545
Contributor guide
Assessment
This issue has not been assessed yet.