/// Conversion from Mapping to a vector of vertex orbits, where each orbit contains two vertices 
Conversion from Mapping to a vector of vertex orbits, where each orbit contains two vertices
Conversion from Mapping to a vector of vertex orbits where each orbit contains two vertices
fn orbits_from_mapping(
    mapping: &Mapping,
    length: usize
) -> Vec<core::orbit_ops::Orbit> {
    let mut orbits: Vec<core::orbit_ops::Orbit> = vec![];
    let mut indexes_visited: Vec<usize> = vec![];
    for idx in 0..length {
        match mapping.get(&idx) {
            Some(target_idx) => {
                if !indexes_visited.contains(&idx) {
                    orbits.push(vec![idx, *target_idx]);
                    indexes_visited.push(idx);
                    indexes_visited.push(*target_idx);
                }
            },
            None => () 
        }
    }
    orbits
}
fn orbits_from_mapping ( mapping : & Mapping , length : usize ) -> Vec < core :: orbit_ops :: Orbit > { let mut orbits : Vec < core :: orbit_ops :: Orbit > = vec ! [ ] ; let mut indexes_visited : Vec < usize > = vec ! [ ] ; for idx in 0 .. length { match mapping . get ( & idx ) { Some ( target_idx ) => { if ! indexes_visited . contains ( & idx ) { orbits . push ( vec ! [ idx target_idx ] ) ; indexes_visited . push ( idx ) ; indexes_visited . push ( * target_idx ) ; } } , None => ( ) } } orbits }
Conversion from Mapping to a vector of vertex orbits, where each orbit contains two vertices
Conversion from Mapping to a vector of vertex orbits where each orbit contains two vertices
mapping
&Mapping
length
usize