cleanup and formatting

This commit is contained in:
Corentin Le Molgat
2025-06-16 17:55:44 +02:00
parent 79b86cc581
commit 7b67f855e6
6 changed files with 10 additions and 7 deletions

View File

@@ -57,7 +57,7 @@ class LineBreaker {
// Returns true if string s will fit on the current line without adding a
// carriage return.
bool WillFit(const std::string& s) {
bool WillFit(absl::string_view s) {
return line_size_ + static_cast<int>(s.size()) < max_line_size_;
}

View File

@@ -20,8 +20,8 @@
#include <limits>
#include <memory>
#include <mutex>
#include <string>
#include <numeric>
#include <string>
#include "absl/strings/numbers.h"
#include "absl/strings/str_format.h"
@@ -1094,7 +1094,8 @@ void XpressInterface::SetCoefficient(MPConstraint* const constraint,
double new_value, double) {
InvalidateSolutionSynchronization();
fixedOrderCoefficientsPerConstraint[constraint->index()][variable->index()] = new_value;
fixedOrderCoefficientsPerConstraint[constraint->index()][variable->index()] =
new_value;
// Changing a single coefficient in the matrix is potentially pretty
// slow since that coefficient has to be found in the sparse matrix

View File

@@ -159,7 +159,7 @@ class XPRSGetter {
std::string value(280, '\0');
int valueSize;
EXPECT_STATUS(XPRSgetstringattrib(prob(), attrib, &value[0], value.size(),
&valueSize));
&valueSize));
value.resize(valueSize - 1);
return value;
}