[Mlir-commits] [mlir] [MLIR][Presburger] Implement Matrix::moveColumns (PR #68362)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jan 3 09:29:16 PST 2024
================
@@ -189,6 +189,22 @@ class Matrix {
/// invariants satisfied.
bool hasConsistentState() const;
+ /// Move the columns in the source range [srcPos, srcPos + num) to the
+ /// specified destination [dstPos, dstPos + num), while moving the columns
+ /// adjacent to the source range to the left/right of the shifted columns.
+ ///
+ /// When moving the source columns right (i.e. dstPos > srcPos), columns
+ /// that were at positions [0, srcPos) and [dstPos + num, nCols) will stay
+ /// where they are; columns that were at positions [srcPos, srcPos + num) will
+ /// be moved to [dstPos, dstPos + num); and columns that were at positions
+ /// [srcPos + num, dstPos + num) will be moved to [srcPos, dstPos).
+ /// For example, if m = |0 1 2 3 4 5| then
+ /// m.moveColumns(1, 3, 2) will result in m = |0 4 1 2 3 5|; or
+ /// m.moveColumns(1, 2, 4) will result in m = |0 3 4 5 1 2|.
+ ///
+ /// The left shift operation (i.e. dstPos < srcPos) works in a similar way.
----------------
Abhinav271828 wrote:
Would suggest inserting at line 201:
// Equivalently, the ranges [srcPos, srcPos + num) and [srcPos + num, dstPos + num) are swapped.
https://github.com/llvm/llvm-project/pull/68362
More information about the Mlir-commits
mailing list