14 #ifndef OR_TOOLS_UTIL_FLAT_MATRIX_H_
15 #define OR_TOOLS_UTIL_FLAT_MATRIX_H_
26 #include "absl/types/span.h"
38 array_(num_rows_ * num_cols_) {}
42 array_(num_rows_ * num_cols_, elem) {}
48 return absl::Span<T>(array_.data() +
row * num_cols_, num_cols_);
51 return {array_.data() +
row * num_cols_, num_cols_};
60 std::vector<T> array_;
absl::Span< const T > operator[](size_t row) const
FlatMatrix(size_t num_rows, size_t num_cols, const T &elem)
absl::Span< T > operator[](size_t row)
FlatMatrix(size_t num_rows, size_t num_cols)
Collection of objects used to extend the Constraint Solver library.