Skip to content

More efficient inplace transpose #4

@preiter93

Description

@preiter93

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions