pub fn generate_all_permutations(
    orbits: &Vec<core::orbit_ops::Orbit>,
    length: usize
) -> Vec<Permuation> {
    let factorials: Vec<Vec<Vec<usize>>> = orbits.iter().map(|rp| combinatorial::factorial_vec(rp)).collect();
    let counts: Vec<usize> = factorials.iter().map(|r| r.len()).collect();
    let combos: Vec<Vec<usize>> = permutation_groups_of_orbit_indexes(&counts);

    let mut results: Vec<Permuation> = vec![];
    for combo in combos.iter() {
        let mut mapping = Mapping::new();
        for i in 0..combo.len() {
            update_mapping(
                &orbits[i],
                &factorials[i][combo[i]],
                &mut mapping
            );
        }

        results.push(permutation_from_mapping(&mapping, length));
    }

    results
}
/// Generate all possible permutations from the given orbits
Generate all possible permutations from the given orbits
Generate all possible permutations from the given orbits
pub fn generate_all_permutations(
    orbits: &Vec<core::orbit_ops::Orbit>,
    length: usize
) -> Vec<Permuation> {
    let factorials: Vec<Vec<Vec<usize>>> = orbits.iter().map(|rp| combinatorial::factorial_vec(rp)).collect();
    let counts: Vec<usize> = factorials.iter().map(|r| r.len()).collect();
    let combos: Vec<Vec<usize>> = permutation_groups_of_orbit_indexes(&counts);
    let mut results: Vec<Permuation> = vec![];
    for combo in combos.iter() {
        let mut mapping = Mapping::new();
        for i in 0..combo.len() {
            update_mapping(
                &orbits[i],
                &factorials[i][combo[i]],
                &mut mapping
            );
        }
        results.push(permutation_from_mapping(&mapping, length));
    }
    results
}
pub fn generate_all_permutations ( orbits : & Vec < core :: orbit_ops :: Orbit > , length : usize ) -> Vec < Permuation > { let factorials : Vec < Vec < Vec < usize > > > = orbits . iter ( ) . map ( | rp | combinatorial :: factorial_vec ( rp ) ) . collect ( ) ; let counts : Vec < usize > = factorials . iter ( ) . map ( | r | r . len ( ) ) . collect ( ) ; let combos : Vec < Vec < usize > > = permutation_groups_of_orbit_indexes ( & counts ) ; let mut results : Vec < Permuation > = vec ! [ ] ; for combo in combos . iter ( ) { let mut mapping = Mapping :: new ( ) ; for i in 0 .. combo . len ( ) { update_mapping ( & orbits [ i ] , & factorials [ i ] [ combo [ i ] ] , & mut mapping ) ; } results . push ( permutation_from_mapping ( & mapping , length ) ) ; } results }
Generate all possible permutations from the given orbits
Generate all possible permutations from the given orbits
orbits
&Vec<core::orbit_ops::Orbit>
length
usize
orbits
&Vec<core::orbit_ops::Orbit>
length
usize