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

Function getLocalInfoValue

highs/lp_data/HighsInfo.cpp:269–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267
268#ifndef HIGHSINT64
269InfoStatus getLocalInfoValue(const HighsLogOptions& report_log_options,
270 const std::string& name, const bool valid,
271 const std::vector<InfoRecord*>& info_records,
272 int64_t& value) {
273 HighsInt index;
274 InfoStatus status =
275 getInfoIndex(report_log_options, name, info_records, index);
276 if (status != InfoStatus::kOk) return status;
277 if (!valid) return InfoStatus::kUnavailable;
278 HighsInfoType type = info_records[index]->type;
279 if (type != HighsInfoType::kInt64) {
280 highsLogUser(
281 report_log_options, HighsLogType::kError,
282 "getInfoValue: Info \"%s\" requires value of type %s, not int64_t\n",
283 name.c_str(), infoEntryTypeToString(type).c_str());
284 return InfoStatus::kIllegalValue;
285 }
286 InfoRecordInt64 info = ((InfoRecordInt64*)info_records[index])[0];
287 value = *info.value;
288 return InfoStatus::kOk;
289}
290#endif
291
292InfoStatus getLocalInfoValue(const HighsLogOptions& report_log_options,

Callers 1

getInfoValueMethod · 0.85

Calls 4

getInfoIndexFunction · 0.85
highsLogUserFunction · 0.85
infoEntryTypeToStringFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected