Skip to content

Commit bd96e11

Browse files
authored
Merge pull request #2629 from fontanf/bugfix/windows-min-max
Fix min and max for compilation on Windows
2 parents 1580f3e + 98a7589 commit bd96e11

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

highs/lp_data/HConst.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
const std::string kHighsCopyrightStatement =
2121
"Copyright (c) 2025 HiGHS under MIT licence terms";
2222

23-
const size_t kHighsSize_tInf = std::numeric_limits<size_t>::max();
24-
const HighsInt kHighsIInf = std::numeric_limits<HighsInt>::max();
25-
const HighsInt kHighsIInf32 = std::numeric_limits<int>::max();
23+
const size_t kHighsSize_tInf = (std::numeric_limits<size_t>::max)();
24+
const HighsInt kHighsIInf = (std::numeric_limits<HighsInt>::max)();
25+
const HighsInt kHighsIInf32 = (std::numeric_limits<int>::max)();
2626
const double kHighsInf = std::numeric_limits<double>::infinity();
2727
const double kHighsUndefined = kHighsInf;
2828
const double kHighsTiny = 1e-14;

highs/lp_data/HighsOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ class HighsOptions : public HighsOptionsStruct {
11271127
"Maximal age of dynamic LP rows before "
11281128
"they are removed from the LP relaxation in the MIP solver",
11291129
advanced, &mip_lp_age_limit, 0, 10,
1130-
std::numeric_limits<int16_t>::max());
1130+
(std::numeric_limits<int16_t>::max)());
11311131
records.push_back(record_int);
11321132

11331133
record_int = new OptionRecordInt(

highs/util/HighsSparseVectorSum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class HighsSparseVectorSum {
3939
}
4040

4141
if (values[index] == 0.0)
42-
values[index] = std::numeric_limits<double>::min();
42+
values[index] = (std::numeric_limits<double>::min)();
4343
}
4444

4545
void add(HighsInt index, HighsCDouble value) {
@@ -51,7 +51,7 @@ class HighsSparseVectorSum {
5151
}
5252

5353
if (values[index] == 0.0)
54-
values[index] = std::numeric_limits<double>::min();
54+
values[index] = (std::numeric_limits<double>::min)();
5555
}
5656

5757
const std::vector<HighsInt>& getNonzeros() const { return nonzeroinds; }

highs/util/HighsTimer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ class HighsTimer {
294294
HighsInt iClock = clock_list[i];
295295
percent_sum_clock_times[i] = 100.0 * clock_time[iClock] / sum_clock_times;
296296
max_percent_sum_clock_times =
297-
std::max(percent_sum_clock_times[i], max_percent_sum_clock_times);
297+
(std::max)(percent_sum_clock_times[i], max_percent_sum_clock_times);
298298
}
299299
if (max_percent_sum_clock_times < tolerance_percent_report)
300300
return non_null_report;

0 commit comments

Comments
 (0)