forked from OSchip/llvm-project
[MLIR][Presburger] add a non-const Matrix::getRow() returning a MutableArrayRef
Reviewed By: Groverkss Differential Revision: https://reviews.llvm.org/D122136
This commit is contained in:
parent
b9959590d4
commit
d98dfdea17
|
@ -72,7 +72,8 @@ public:
|
|||
/// reallocations.
|
||||
void reserveRows(unsigned rows);
|
||||
|
||||
/// Get an ArrayRef corresponding to the specified row.
|
||||
/// Get a [Mutable]ArrayRef corresponding to the specified row.
|
||||
MutableArrayRef<int64_t> getRow(unsigned row);
|
||||
ArrayRef<int64_t> getRow(unsigned row) const;
|
||||
|
||||
/// Insert columns having positions pos, pos + 1, ... pos + count - 1.
|
||||
|
|
|
@ -101,6 +101,10 @@ void Matrix::swapColumns(unsigned column, unsigned otherColumn) {
|
|||
std::swap(at(row, column), at(row, otherColumn));
|
||||
}
|
||||
|
||||
MutableArrayRef<int64_t> Matrix::getRow(unsigned row) {
|
||||
return {&data[row * nReservedColumns], nColumns};
|
||||
}
|
||||
|
||||
ArrayRef<int64_t> Matrix::getRow(unsigned row) const {
|
||||
return {&data[row * nReservedColumns], nColumns};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue