Skip to content

Commit 4c9e856

Browse files
committed
Chaser
1 parent 7c94329 commit 4c9e856

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

highs/mip/HighsMipSolver.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -895,10 +895,13 @@ void HighsMipSolver::callbackGetCutPool() const {
895895
callback_->user_callback_data);
896896
}
897897

898-
bool HighsMipSolver::solutionFeasible(
899-
const HighsLp* lp, const std::vector<double>& col_value,
900-
const std::vector<double>* pass_row_value, double& bound_violation,
901-
double& row_violation, double& integrality_violation, HighsCDouble& obj) {
898+
bool HighsMipSolver::solutionFeasible(const HighsLp* lp,
899+
const std::vector<double>& col_value,
900+
const std::vector<double>* pass_row_value,
901+
double& bound_violation,
902+
double& row_violation,
903+
double& integrality_violation,
904+
HighsCDouble& obj) const {
902905
bound_violation = 0;
903906
row_violation = 0;
904907
integrality_violation = 0;

highs/mip/HighsMipSolver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class HighsMipSolver {
106106
bool solutionFeasible(const HighsLp* lp, const std::vector<double>& col_value,
107107
const std::vector<double>* pass_row_value,
108108
double& bound_violation, double& row_violation,
109-
double& integrality_violation, HighsCDouble& obj);
109+
double& integrality_violation, HighsCDouble& obj) const;
110110
};
111111

112112
#endif

highs/mip/HighsMipSolverData.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "util/HighsIntegers.h"
2121

2222
std::string HighsMipSolverData::solutionSourceToString(
23-
const int solution_source, const bool code) {
23+
const int solution_source, const bool code) const {
2424
if (solution_source == kSolutionSourceNone) {
2525
if (code) return " ";
2626
return "None";
@@ -1179,9 +1179,10 @@ double HighsMipSolverData::transformNewIntegerFeasibleSolution(
11791179
}
11801180

11811181
double HighsMipSolverData::percentageInactiveIntegers() const {
1182-
return 100.0 * (1.0 - double(integer_cols.size() -
1183-
cliquetable.getSubstitutions().size()) /
1184-
numintegercols);
1182+
return 100.0 *
1183+
(1.0 - static_cast<double>(integer_cols.size() -
1184+
cliquetable.getSubstitutions().size()) /
1185+
numintegercols);
11851186
}
11861187

11871188
void HighsMipSolverData::performRestart() {
@@ -1498,7 +1499,7 @@ static std::array<char, 22> convertToPrintString(double val,
14981499
return printString;
14991500
}
15001501

1501-
void HighsMipSolverData::printSolutionSourceKey() {
1502+
void HighsMipSolverData::printSolutionSourceKey() const {
15021503
std::stringstream ss;
15031504
// Last MipSolutionSource enum is kSolutionSourceCleanup - which is
15041505
// not a solution source, but used to force the last logging line to

highs/mip/HighsMipSolverData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ struct HighsMipSolverData {
277277
const std::vector<double>& getSolution() const;
278278

279279
std::string solutionSourceToString(const int solution_source,
280-
const bool code = true);
281-
void printSolutionSourceKey();
280+
const bool code = true) const;
281+
void printSolutionSourceKey() const;
282282
void printDisplayLine(const int solution_source = kSolutionSourceNone);
283283

284284
void getRow(HighsInt row, HighsInt& rowlen, const HighsInt*& rowinds,

0 commit comments

Comments
 (0)