[Mlir-commits] [mlir] [MLIR][Presburger] Implement Matrix::moveColumns (PR #68362)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jan 3 09:53:32 PST 2024
================
@@ -230,6 +230,47 @@ void Matrix<T>::fillRow(unsigned row, const T &value) {
at(row, col) = value;
}
+// moveColumns is implemented by moving the columns adjacent to the source range
+// [srcPos, srcPos + num) to their final position. When moving right (i.e.
+// dstPos > srcPos), the range of the adjacent columns is [srcPos + num,
+// dstPos + num). When moving left (i.e. dstPos < srcPos) the range of the
+// adjacent columns is [dstPos, srcPos). First, zeroed out columns are inserted
+// in the final positions of the adjacent columns. Then, the zeroed out columns
+// are swapped with the adjacent columns. Finally, the now redundant adjacent
+// columns are deleted.
----------------
Abhinav271828 wrote:
ah, I meant delete the `[srcPos, srcPos + num)`. Because when you say "the columns adjacent to the source range [srcPos, srcPos + num)", imo, it's not clear whether `[srcPos, srcPos + num)` refers to "the source range" or "the columns adjacent to the source range"
https://github.com/llvm/llvm-project/pull/68362
More information about the Mlir-commits
mailing list