Transforms the slice in the inverse permutation.
This function panics if any value in self
is not in 0..self.len()
.
let mut p = [1, 3, 2, 0];
p.invert_permutation();
assert_eq!(p, [3, 0, 2, 1]);
Loading content...
Loading content...
Loading content...