I was looking for multidimensional transpositions and implemented some myself.
The out-of place transposes are very similar to yours (I pretty much copy-pasted the recursive one),
and the performance is almost the same:
("this" is my implementation and "ej" is yours)
For the inplace transposition, however, I have implemented a method that is described in
F. Gustavson and D. Walker - Algorithms for in-place matrix transposition (2018)
which is about 10x faster than your current implementation, although still slower than the out-of-place variant:
My code is at https://github.com/preiter93/transpose. Let me know if you are interested, we could include the in-place variant in your library. I think an efficient inplace algorithm with variable scratch space can be quite useful for some people.
Hi,
I was looking for multidimensional transpositions and implemented some myself.
The out-of place transposes are very similar to yours (I pretty much copy-pasted the recursive one), and the performance is almost the same:
("this" is my implementation and "ej" is yours)
For the inplace transposition, however, I have implemented a method that is described in
F. Gustavson and D. Walker - Algorithms for in-place matrix transposition (2018)
which is about 10x faster than your current implementation, although still slower than the out-of-place variant:
My code is at https://github.com/preiter93/transpose. Let me know if you are interested, we could include the in-place variant in your library. I think an efficient inplace algorithm with variable scratch space can be quite useful for some people.
Best regards