28 const absl::ParsedFormat<
's',
's',
's'> kExtendedFormat(
29 " Parameter: '%s' value: %s default: %s");
30 const absl::ParsedFormat<
's',
's',
's'> kOneLinerFormat(
"'%s':%s (%s)");
31 const absl::ParsedFormat<
's',
's',
's'>& format =
32 one_liner_output ? kOneLinerFormat : kExtendedFormat;
33 std::vector<std::string> changed_parameters;
35 for (
int i = 0; i < num_parameters; ++i) {
36 char* param_name =
nullptr;
47 &max_value, &default_value);
48 if (current_value != default_value) {
49 changed_parameters.push_back(
50 absl::StrFormat(format, param_name, absl::StrCat(current_value),
51 absl::StrCat(default_value)));
62 &max_value, &default_value);
63 if (current_value != default_value) {
64 changed_parameters.push_back(
65 absl::StrFormat(format, param_name, absl::StrCat(current_value),
66 absl::StrCat(default_value)));
79 if (std::strcmp(current_value, default_value) != 0) {
80 changed_parameters.push_back(absl::StrFormat(
81 format, param_name, current_value, default_value));
86 changed_parameters.push_back(absl::StrFormat(
87 "Parameter '%s' of unknown type %d", param_name, param_type));
90 if (changed_parameters.empty())
return "";
91 if (one_liner_output) {
92 return absl::StrCat(
"GurobiParams{",
93 absl::StrJoin(changed_parameters,
", "),
"}");
95 return absl::StrJoin(changed_parameters,
"\n");