Previous Up Next

2.10.5  Transform a permutation into a matrix : permu2mat

permu2mat takes as argument a permutation p of size n.
permu2mat returns the matrix of the permutation, that is the matrix obtained by permuting the rows of the identity matrix of size n with the permutation p.
Input :

permu2mat([2,0,1])

Output :

[[0,0,1],[1,0,0],[0,1,0]]

Previous Up Next