fn reverse_permute_columns<'a, I, J>(columns: I, permutation: J)
where
    I: Iterator<Item = &'a mut usize>,
    J: Iterator<Item = &'a usize>,
{
    let reverse_col_map = permutation
        .enumerate()
        .map(|(idx, c)| (*c, idx))
        .collect::<HashMap<_, _>>();
    for c in columns {
        *c = reverse_col_map[c];
    }
}
/// Same as [reverse_permute], but takes column numbers as input
Same as [reverse_permute], but takes column numbers as input
Same as [ reverse_permute ] but takes column numbers as input
fn reverse_permute_columns<'a, I, J>(columns: I, permutation: J)
where
    I: Iterator<Item = &'a mut usize>,
    J: Iterator<Item = &'a usize>,
{
    let reverse_col_map = permutation
        .enumerate()
        .map(|(idx, c)| (*c, idx))
        .collect::<HashMap<_, _>>();
    for c in columns {
        *c = reverse_col_map[c];
    }
}
fn reverse_permute_columns < ' a , I , J > ( columns : I , permutation : J ) where I : Iterator < Item = & ' a mut usize > , J : Iterator < Item = & ' a usize > , { let reverse_col_map = permutation . enumerate ( ) . map ( | ( idx , c ) | ( * c , idx ) ) . collect :: < HashMap < _ , _ > > ( ) ; for c in columns { * c = reverse_col_map [ c ] ; } }
Same as [reverse_permute], but takes column numbers as input
Same as [ reverse_permute ] but takes column numbers as input
columns
I
permutation
J
columns
I
permutation
J