update code

This commit is contained in:
Laurent Perron
2024-12-19 15:39:10 +01:00
parent 925af8aa71
commit fc422b468f
26 changed files with 683 additions and 110 deletions

View File

@@ -167,8 +167,8 @@ class MPModelProtoExporter {
// a name, and a value. If the line is not empty, then only the pair
// (name, value) is appended. The number of columns, limited to 2 by the MPS
// format is also taken care of.
void AppendMpsTermWithContext(const std::string& head_name,
const std::string& name, double value,
void AppendMpsTermWithContext(absl::string_view head_name,
absl::string_view name, double value,
std::string* output);
// Appends a new-line if two columns are already present on the MPS line.
@@ -693,9 +693,10 @@ void MPModelProtoExporter::AppendMpsLineHeaderWithNewLine(
absl::StrAppend(output, "\n");
}
void MPModelProtoExporter::AppendMpsTermWithContext(
const std::string& head_name, const std::string& name, double value,
std::string* output) {
void MPModelProtoExporter::AppendMpsTermWithContext(absl::string_view head_name,
absl::string_view name,
double value,
std::string* output) {
if (current_mps_column_ == 0) {
AppendMpsLineHeader("", head_name, output);
}

View File

@@ -15,6 +15,7 @@
// The Stigler diet problem.
// [START import]
#include <array>
#include <cstddef>
#include <memory>
#include <string>
#include <utility> // std::pair