Get a permutation to diagonalize and scale a matrix
A matrix close from a permutation and scale matrix.
If True, scales the matrix A wrt its diagonal
A permuted matrix.