| 549 | } |
| 550 | |
| 551 | void writeGlpsolCostRow(FILE* file, const HighsLogOptions& log_options, |
| 552 | const bool raw, const bool is_mip, |
| 553 | const HighsInt row_id, |
| 554 | const std::string& objective_name, |
| 555 | const double objective_function_value) { |
| 556 | std::stringstream ss; |
| 557 | ss.str(std::string()); |
| 558 | if (raw) { |
| 559 | double double_value = objective_function_value; |
| 560 | auto double_string = highsDoubleToString( |
| 561 | double_value, kGlpsolSolutionValueToStringTolerance); |
| 562 | // Last term of 0 for dual should (also) be blank when not MIP |
| 563 | ss << highsFormatToString("i %d %s%s%s\n", (int)row_id, is_mip ? "" : "b ", |
| 564 | double_string.data(), is_mip ? "" : " 0"); |
| 565 | } else { |
| 566 | ss << highsFormatToString("%6d ", (int)row_id); |
| 567 | if (objective_name.length() <= 12) { |
| 568 | ss << highsFormatToString("%-12s ", objective_name.c_str()); |
| 569 | } else { |
| 570 | ss << highsFormatToString("%s\n%20s", objective_name.c_str(), ""); |
| 571 | } |
| 572 | if (is_mip) { |
| 573 | ss << highsFormatToString(" "); |
| 574 | } else { |
| 575 | ss << highsFormatToString("B "); |
| 576 | } |
| 577 | ss << highsFormatToString("%13.6g %13s %13s \n", objective_function_value, |
| 578 | "", ""); |
| 579 | } |
| 580 | highsFprintfString(file, log_options, ss.str()); |
| 581 | } |
| 582 | |
| 583 | void writeGlpsolSolution(FILE* file, const HighsOptions& options, |
| 584 | const HighsModel& model, const HighsBasis& basis, |
no test coverage detected