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

Function boolFromString

highs/lp_data/HighsOptions.cpp:210–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210bool boolFromString(std::string value, bool& bool_value) {
211 std::transform(value.begin(), value.end(), value.begin(),
212 [](unsigned char c) { return std::tolower(c); });
213 if (value == "t" || value == "true" || value == "1" ||
214 value == kHighsOnString) {
215 bool_value = true;
216 } else if (value == "f" || value == "false" || value == "0" ||
217 value == kHighsOffString) {
218 bool_value = false;
219 } else {
220 return false;
221 }
222 return true;
223}
224
225OptionStatus getOptionIndex(const HighsLogOptions& report_log_options,
226 const std::string& name,

Callers 1

setLocalOptionValueFunction · 0.85

Calls 3

tolowerFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected