Generates a permutation matrix based upon a sequence.