Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More efficient inplace transpose #4

Open
preiter93 opened this issue Jul 19, 2022 · 1 comment
Open

More efficient inplace transpose #4

preiter93 opened this issue Jul 19, 2022 · 1 comment

Comments

@preiter93
Copy link

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:
perf_oop

("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:
perf_ip

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

@ejmahler
Copy link
Owner

That's great! I'd be thrilled to have a faster in-place transpose. I'll take look in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants