/// Seperate vertices in an orbit according to their neighbours. Only applicable for endpoint atoms
Seperate vertices in an orbit according to their neighbours. Only applicable for endpoint atoms
Seperate vertices in an orbit according to their neighbours . Only applicable for endpoint atoms
fn group_by_neighbour(
    orbit: &core::orbit_ops::Orbit,
    vv: &core::graph::VertexVec<atom::Atom>,
) -> Vec<core::orbit_ops::Orbit> {
    let mut atom_groups: std::collections::HashMap<usize, core::orbit_ops::Orbit> = std::collections::HashMap::new();
    for &ai in orbit.iter() {
        let nb_idx: usize = vv[ai].neighbour_indexes()[0]; // endpoint atom has only one neighbour
        atom_groups.entry(nb_idx).or_insert(vec![]).push(ai);
    }
    atom_groups.into_values().collect()
}
fn group_by_neighbour ( orbit : & core :: orbit_ops :: Orbit , vv : & core :: graph :: VertexVec < atom :: Atom > , ) -> Vec < core :: orbit_ops :: Orbit > { let mut atom_groups : std :: collections :: HashMap < usize , core :: orbit_ops :: Orbit > = std :: collections :: HashMap :: new ( ) ; for & ai in orbit . iter ( ) { let nb_idx : usize = vv [ ai ] . neighbour_indexes ( ) [ 0 ] ; // endpoint atom has only one neighbour atom_groups . entry ( nb_idx ) . or_insert ( vec ! [ ] ) . push ( ai ) ; } atom_groups . into_values ( ) . collect ( ) }
Seperate vertices in an orbit according to their neighbours.
Seperate vertices in an orbit according to their neighbours .
orbit
&core::orbit_ops::Orbit
vv
&core::graph::VertexVec<atom::Atom>