Simple crate that will reorder a slice based on a slice of indices without an auxiliary array.
Check it out on crates.io and github and docs.rs.
Example
Simple crate that will reorder a slice based on a slice of indices without an auxiliary array.
Check it out on crates.io and github and docs.rs.
fn main() {
let (mut arr, mut ind, res) = (
[50, 40, 70, 60, 90, 10],
[3, 0, 4, 1, 2, 5],
[40, 60, 90, 50, 70, 10],
);
reorder_index(&mut arr, &mut ind);
assert_eq!(arr, res);
}