2#include <alpaqa/ipopt-adapter-export.h>
4#include <IpIpoptApplication.hpp>
16 return a +
"'" + b.first +
"', ";
19 "'" + std::string(
penult->first) +
"'";
35 const auto &
ipopt_opts =
app.RegOptions()->RegisteredOptionsList();
38 throw std::invalid_argument(
39 "Invalid key '" + std::string(
opt_name) +
"' for type '" +
40 "IpoptApplication" +
"' in '" + std::string(s.
full_key) +
45 const auto type =
regops_it->second->Type();
47 case Ipopt::OT_Number: {
50 success =
app.Options()->SetNumericValue(std::string(
opt_name),
53 case Ipopt::OT_Integer: {
56 success =
app.Options()->SetIntegerValue(std::string(
opt_name),
59 case Ipopt::OT_String: {
60 success =
app.Options()->SetStringValue(
63 case Ipopt::OT_Unknown:
65 throw std::invalid_argument(
"Unknown type in '" +
70 throw std::invalid_argument(
"Invalid option in '" +
void set_param(bool &b, ParamString s)
std::string_view key
The subkey to resolve next.
std::string_view full_key
Full key string, used for diagnostics.
auto split_key(std::string_view full, char tok='.')
Split the string full on the first occurrence of tok.
std::string_view value
The value of the parameter to store.
auto possible_keys()
Return a string enumerating the possible attribute names for the struct type T.
Represents a parameter value encoded as a string in the format abc.def.key=value.