8inline constexpr const char *
kStrategy =
"mps_routing_strategy";
9inline constexpr const char *
kVirtualBonds =
"mps_routing_virtual_bonds";
10inline constexpr const char *
kLegacyCap =
"mps_routing_legacy_cap";
21 if (value ==
"combined")
23 if (value ==
"legacy")
25 throw std::invalid_argument(
"mps_routing_strategy must be combined or legacy");
35 if (value ==
"true" || value ==
"1")
37 if (value ==
"false" || value ==
"0")
39 throw std::invalid_argument(
"Routing flags must be true, false, 1 or 0");
45 const double weight = std::stod(value, &consumed);
46 if (consumed != value.size() || !std::isfinite(weight) || weight < 0.)
47 throw std::invalid_argument(
"mps_routing_truncation_weight must be finite and nonnegative");
constexpr const char * kLegacyCap
constexpr const char * kTruncationWeight
constexpr const char * kVirtualBonds
bool VirtualBondsEnabled(const Config &config)
double ParseWeight(const std::string &value)
bool ParseFlag(const std::string &value)
Strategy GetStrategy(const Config &config)
constexpr const char * kStrategy
Strategy ParseStrategy(const std::string &value)
double TruncationWeight(const Config &config)