Permuting the rows of a matrix based on given a given permutation

2 posts were split to a new topic: Constructing a permutation matrix