pub fn copy_by_symmetry(&self, group: Group<vec::IntoIter<Matrix<f64>>>) -> (Self, Vec<Vec<usize>>) {
        let mut vertices = BTreeMap::<PointOrd<f64>, usize>::new();
        let mut vertices_vec = Vec::new();
        let mut c = 0;

        for vertex in self.0.clone() {
            if vertices.get(&PointOrd::new(vertex.clone())).is_none() {
                for isometry in group.clone() {
                    let new_vertex = PointOrd::<f64>::new(isometry.clone() * vertex.clone());
                    if vertices.get(&new_vertex).is_none() {
                        vertices.insert(new_vertex.clone(), c);
                        vertices_vec.push(new_vertex);
                        c += 1;
                    }
                }
            }
        }

        let mut vertex_map: Vec<Vec<usize>> = Vec::new();

        for isometry in group {
            let mut vertex_map_row = Vec::<usize>::new();
            for vertex in &vertices_vec {
                let new_vertex = PointOrd::new(isometry.clone() * vertex.matrix());
                match vertices.get(&new_vertex) {
                    Some(idx) => {
                        vertex_map_row.push(*idx);
                    }
                    None => {
                        unreachable!();
                    }
                }
            }
            vertex_map.push(vertex_map_row);
        }
        
        (
            Vertices(Vec::from_iter(vertices_vec.into_iter().map(|point| point.0))),
            vertex_map,
        )
    }
/// Uses the provided symmetry group on the vertices, also outputs the new vertex map.
Uses the provided symmetry group on the vertices, also outputs the new vertex map.
Uses the provided symmetry group on the vertices also outputs the new vertex map .
pub fn copy_by_symmetry(&self, group: Group<vec::IntoIter<Matrix<f64>>>) -> (Self, Vec<Vec<usize>>) {
        let mut vertices = BTreeMap::<PointOrd<f64>, usize>::new();
        let mut vertices_vec = Vec::new();
        let mut c = 0;
        for vertex in self.0.clone() {
            if vertices.get(&PointOrd::new(vertex.clone())).is_none() {
                for isometry in group.clone() {
                    let new_vertex = PointOrd::<f64>::new(isometry.clone() * vertex.clone());
                    if vertices.get(&new_vertex).is_none() {
                        vertices.insert(new_vertex.clone(), c);
                        vertices_vec.push(new_vertex);
                        c += 1;
                    }
                }
            }
        }
        let mut vertex_map: Vec<Vec<usize>> = Vec::new();
        for isometry in group {
            let mut vertex_map_row = Vec::<usize>::new();
            for vertex in &vertices_vec {
                let new_vertex = PointOrd::new(isometry.clone() * vertex.matrix());
                match vertices.get(&new_vertex) {
                    Some(idx) => {
                        vertex_map_row.push(*idx);
                    }
                    None => {
                        unreachable!();
                    }
                }
            }
            vertex_map.push(vertex_map_row);
        }
        (
            Vertices(Vec::from_iter(vertices_vec.into_iter().map(|point| point.0))),
            vertex_map,
        )
    }
pub fn copy_by_symmetry ( & self , group : Group < vec :: IntoIter < Matrix < f64 > > > ) -> ( Self , Vec < Vec < usize > > ) { let mut vertices = BTreeMap :: < PointOrd < f64 > , usize > :: new ( ) ; let mut vertices_vec = Vec :: new ( ) ; let mut c = 0 ; for vertex in self . 0 . clone ( ) { if vertices . get ( & PointOrd :: new ( vertex . clone ( ) ) ) . is_none ( ) { for isometry in group . clone ( ) { let new_vertex = PointOrd :: < f64 > :: new ( isometry . clone ( ) * vertex . clone ( ) ) ; if vertices . get ( & new_vertex ) . is_none ( ) { vertices . insert ( new_vertex . clone ( ) , c ) ; vertices_vec . push ( new_vertex ) ; c += 1 ; } } } } let mut vertex_map : Vec < Vec < usize > > = Vec :: new ( ) ; for isometry in group { let mut vertex_map_row = Vec :: < usize > :: new ( ) ; for vertex in & vertices_vec { let new_vertex = PointOrd :: new ( isometry . clone ( ) * vertex . matrix ( ) ) ; match vertices . get ( & new_vertex ) { Some ( idx ) => { vertex_map_row . push ( * idx ) ; } None => { unreachable ! ( ) ; } } } vertex_map . push ( vertex_map_row ) ; } ( Vertices ( Vec :: from_iter ( vertices_vec . into_iter ( ) . map ( | point | point . 0 ) ) ) , vertex_map , ) }
Uses the provided symmetry group on the vertices, also outputs the new vertex map.
Uses the provided symmetry group on the vertices also outputs the new vertex map .
&self
group
Group<vec::IntoIter<Matrix<f64>>>