lp_data: use absl::Span

This commit is contained in:
Corentin Le Molgat
2024-02-15 18:01:48 +01:00
parent 427bd719bf
commit ecc34eaa85
2 changed files with 4 additions and 2 deletions

View File

@@ -18,6 +18,7 @@
#include "absl/log/check.h"
#include "absl/synchronization/mutex.h"
#include "absl/types/span.h"
#include "ortools/algorithms/dynamic_partition.h"
#include "ortools/lp_data/lp_data.h"
#include "ortools/lp_data/lp_types.h"
@@ -139,7 +140,7 @@ void LPDecomposer::ExtractLocalProblem(int problem_index, LinearProgram* lp) {
}
DenseRow LPDecomposer::AggregateAssignments(
const std::vector<DenseRow>& assignments) const {
absl::Span<const DenseRow> assignments) const {
CHECK_EQ(assignments.size(), clusters_.size());
absl::MutexLock mutex_lock(&mutex_);

View File

@@ -19,6 +19,7 @@
#include "absl/base/thread_annotations.h"
#include "absl/synchronization/mutex.h"
#include "absl/types/span.h"
#include "ortools/lp_data/lp_data.h"
#include "ortools/lp_data/lp_types.h"
@@ -76,7 +77,7 @@ class LPDecomposer {
// Returns an assignment to the original problem based on the assignments
// to the independent problems. Requires Decompose() to have been called.
DenseRow AggregateAssignments(const std::vector<DenseRow>& assignments) const
DenseRow AggregateAssignments(absl::Span<const DenseRow> assignments) const
ABSL_LOCKS_EXCLUDED(mutex_);
// Returns an assignment to the given subproblem based on the assignment to