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

Function checkOption

highs/lp_data/HighsOptions.cpp:359–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359OptionStatus checkOption(const HighsLogOptions& report_log_options,
360 const OptionRecordInt& option) {
361 if (option.lower_bound > option.upper_bound) {
362 highsLogUser(report_log_options, HighsLogType::kError,
363 "checkOption: Option \"%s\" has inconsistent bounds "
364 "[%" HIGHSINT_FORMAT ", %" HIGHSINT_FORMAT "]\n",
365 option.name.c_str(), option.lower_bound, option.upper_bound);
366 return OptionStatus::kIllegalValue;
367 }
368 if (option.default_value < option.lower_bound ||
369 option.default_value > option.upper_bound) {
370 highsLogUser(
371 report_log_options, HighsLogType::kError,
372 "checkOption: Option \"%s\" has default value %" HIGHSINT_FORMAT
373 " "
374 "inconsistent with bounds [%" HIGHSINT_FORMAT ", %" HIGHSINT_FORMAT
375 "]\n",
376 option.name.c_str(), option.default_value, option.lower_bound,
377 option.upper_bound);
378 return OptionStatus::kIllegalValue;
379 }
380 HighsInt value = *option.value;
381 if (value < option.lower_bound || value > option.upper_bound) {
382 highsLogUser(report_log_options, HighsLogType::kError,
383 "checkOption: Option \"%s\" has value %" HIGHSINT_FORMAT
384 " inconsistent with "
385 "bounds [%" HIGHSINT_FORMAT ", %" HIGHSINT_FORMAT "]\n",
386 option.name.c_str(), value, option.lower_bound,
387 option.upper_bound);
388 return OptionStatus::kIllegalValue;
389 }
390 return OptionStatus::kOk;
391}
392
393OptionStatus checkOption(const HighsLogOptions& report_log_options,
394 const OptionRecordDouble& option) {

Callers 1

checkOptionsFunction · 0.85

Calls 2

highsLogUserFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected