lp_data: use absl::Span
This commit is contained in:
@@ -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_);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user