Add docstring and tests for DistanceMatrix.permute