ginkgo icon indicating copy to clipboard operation
ginkgo copied to clipboard

Improve reordering interface

Open upsj opened this issue 3 years ago • 1 comments

As observed in https://github.com/ginkgo-project/ginkgo/discussions/939, our reordering interface is easy to accidentally misuse.

Part of the issue is that Permutation violates the LinOp assumptions in some situations. A permutation matrix is square and, applied from the left (as LinOp::apply is intended), it permutes the rows of the input matrix. At the same time, Permutation allows column partitions and symmetric partitions with the same apply interface, even though they would be more correctly represented by a right_apply and conjugate_apply or however we want to call a Similarity Transformation, because with the plain LinOp interface, column permutations of non-square matrices are not possible at all, and symmetric permutations are not possible dimension-wise.

Related issue: #346

upsj avatar Dec 17 '21 15:12 upsj

This is somewhat relevant here: the operation S1-1 A S2-1 S2 x = S1-1 b is needed for "batched scaled" batch solvers. Usually, the left matrix would be applied to both the matrix and the RHS vector, and could be done together. Therefore, for now I introduced a free function two_sided_system_transform(exec, left_op, right_op, mat, vec) to do this operation. I guess there might be a better name for it.

Slaedr avatar Jan 10 '22 10:01 Slaedr

This was only partially closed by the aforementioned PR, the issues with the Permutation class and the overuse of apply for non-vector related operations remain (also related to #1169)

upsj avatar Mar 13 '23 12:03 upsj

Fixed by #1415

upsj avatar Nov 13 '23 17:11 upsj