28 std::ostringstream result;
40 for (std::string opt : tokens)
43 }
catch (std::exception& ex) {
44 std::ostringstream ostr;
45 ostr <<
"MinimizerOptions::setOptions() -> Error. Can't parse option string '" << options
46 <<
"'.\n, error message '" << ex.what() <<
"'";
47 throw std::runtime_error(ostr.str());
57 if (tokens.size() != 2)
58 throw std::runtime_error(
"MinimizerOptions::processOption() -> Can't parse option '"
61 std::string name = tokens[0];
62 std::string value = tokens[1];
65 opt->setFromString(value);
Declares class MinimizerOptions.
Defines a few helper functions.
void setOptionString(const std::string &options)
Set options from their string representation.
std::string toOptionString() const
Returns string with all options (i.e. "Strategy=1;Tolerance=0.01;")
void processCommand(const std::string &command)
Process single option string 'Tolerance=0.01' and sets the value to corresponding MultiOption.
std::shared_ptr< MultiOption > option_t
option_t option(const std::string &optionName)
std::vector< std::string > split(const std::string &text, const std::string &delimeter)
Split string into vector of string using delimeter.
const std::string delimeter