aboutsummaryrefslogtreecommitdiff
path: root/challenge-055/richard-park/apl/Pmat.aplf
blob: 12be0666b959af6b0318e34e2e5842ff80732f16 (plain)
1
2
3
4
5
6
 Pmat{⎕ML1             ⍝ dfns pmat: Permutation matrix of ⍳⍵.
     {                   ⍝ perms of ⍳⍵:
         1≥⍴⍵:↑,↓       ⍝ short vector: done.
         ↑⍪/,¨~¨   ⍝ items prefix sub-perms of remainder.
     }                 ⍝ permutations of identity perm.
 }