added sparse matrix permute functions