Skip to content

Commit 98a7589

Browse files
authored
Fix min and max for compilation on Windows
1 parent 869cbd4 commit 98a7589

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
@@ -1125,7 +1125,7 @@ class HighsOptions : public HighsOptionsStruct {
11251125
"Maximal age of dynamic LP rows before "
11261126
"they are removed from the LP relaxation in the MIP solver",
11271127
advanced, &mip_lp_age_limit, 0, 10,
1128-
std::numeric_limits<int16_t>::max());
1128+
(std::numeric_limits<int16_t>::max)());
11291129
records.push_back(record_int);
11301130

11311131
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)