MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / increasingSetOk

Function increasingSetOk

highs/util/HighsSort.cpp:261–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261bool increasingSetOk(const vector<HighsInt>& set,
262 const HighsInt set_entry_lower,
263 const HighsInt set_entry_upper, bool strict) {
264 HighsInt set_num_entries = set.size();
265 bool check_bounds = set_entry_lower <= set_entry_upper;
266 HighsInt previous_entry;
267 if (check_bounds) {
268 if (strict) {
269 previous_entry = set_entry_lower - 1;
270 } else {
271 previous_entry = set_entry_lower;
272 }
273 } else {
274 previous_entry = -kHighsIInf;
275 }
276 for (HighsInt k = 0; k < set_num_entries; k++) {
277 HighsInt entry = set[k];
278 if (strict) {
279 if (entry <= previous_entry) return false;
280 } else {
281 if (entry < previous_entry) return false;
282 }
283 if (check_bounds && entry > set_entry_upper) return false;
284 previous_entry = entry;
285 }
286 return true;
287}
288
289bool increasingSetOk(const vector<double>& set, const double set_entry_lower,
290 const double set_entry_upper, bool strict) {

Callers 4

createFunction · 0.85
okFunction · 0.85
TestSort.cppFile · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected