12 auto penult = std::prev(tbl.end());
13 auto quote_concat = [](std::string &&a,
auto b) {
14 return a +
"'" + b.first +
"', ";
16 return std::accumulate(tbl.begin(), penult, std::string{}, quote_concat) +
17 "'" + std::string(penult->first) +
"'";
21void IPOPT_ADAPTER_EXPORT
set_param(Ipopt::IpoptApplication &app,
33 const auto &ipopt_opts = app.RegOptions()->RegisteredOptionsList();
34 const auto regops_it = ipopt_opts.find(std::string(opt_name));
35 if (regops_it == ipopt_opts.end())
37 "Invalid key '" + std::string(opt_name) +
"' for type '" +
38 "IpoptApplication" +
"' in '" + std::string(s.
full_key) +
43 const auto type = regops_it->second->Type();
45 case Ipopt::OT_Number: {
48 success = app.Options()->SetNumericValue(std::string(opt_name),
51 case Ipopt::OT_Integer: {
54 success = app.Options()->SetIntegerValue(std::string(opt_name),
57 case Ipopt::OT_String: {
58 success = app.Options()->SetStringValue(
59 std::string(opt_name), std::string(val_param.
value),
false);
61 case Ipopt::OT_Unknown: