UPDATED: Sparse permute functions now work for CSC matrices and rectangular matrices.