Added "matrix" function.

The new function converts a permutation into an n-by-n 0,1-matrix.