Constructing a permutation matrix

Sure. StaticPermutations.jl is relevant, however it’s in the type domain (compile-time computation), which might or might not be what you want. In Base there is already PermutedDimsArray, which I guess can be thought of as a lazy multiplication with a permutation matrix. There’s also Permutations.jl.

1 Like