pub fn element_sort_strong_with_local(&mut self, local: &Ranks) {
        for el in 0..self[2].len() {
            self[2][el].subs.sort_unstable();
        }

        for rank in 2..self.len()-1 {
            let mut all_subs = Vec::new();
            for el in &self[rank] {
                all_subs.push(el.subs.clone());
            }
            let mut sorted = all_subs.clone();
            sorted.sort_unstable();

            let mut perm = Vec::new();
            for i in &all_subs {
                perm.push(sorted.iter().position(|x| x == i).unwrap());
            }

            for i in 0..self[rank].len() {
                self[rank][i].subs = sorted[i].clone();
                self[rank][i].subs.sort_unstable();
            }

            let mut map_to_local = HashMap::new();

            for i in 0..self[rank+1].len() {
                for j in 0..self[rank+1][i].subs.len() {
                    map_to_local.insert(self[rank+1][i].subs[j], local[rank+1][i].subs[j]);
                }
            }

            let mut new_list = ElementList::new();
            for i in 0..self[rank+1].len() {
                let mut new = Element::new(Subelements::new(), Superelements::new());
                for sub in &self[rank+1][i].subs {
                    new.subs.push(perm[*map_to_local.get(sub).unwrap()]);
                }
                new.sort();
                new_list.push(new);
            }
            self[rank+1] = new_list;
        }
    }
/// Sorts some stuff in a way that's useful for the faceting algorithm.
Sorts some stuff in a way that's useful for the faceting algorithm.
Sorts some stuff in a way that ' s useful for the faceting algorithm .
pub fn element_sort_strong_with_local(&mut self, local: &Ranks) {
        for el in 0..self[2].len() {
            self[2][el].subs.sort_unstable();
        }
        for rank in 2..self.len()-1 {
            let mut all_subs = Vec::new();
            for el in &self[rank] {
                all_subs.push(el.subs.clone());
            }
            let mut sorted = all_subs.clone();
            sorted.sort_unstable();
            let mut perm = Vec::new();
            for i in &all_subs {
                perm.push(sorted.iter().position(|x| x == i).unwrap());
            }
            for i in 0..self[rank].len() {
                self[rank][i].subs = sorted[i].clone();
                self[rank][i].subs.sort_unstable();
            }
            let mut map_to_local = HashMap::new();
            for i in 0..self[rank+1].len() {
                for j in 0..self[rank+1][i].subs.len() {
                    map_to_local.insert(self[rank+1][i].subs[j], local[rank+1][i].subs[j]);
                }
            }
            let mut new_list = ElementList::new();
            for i in 0..self[rank+1].len() {
                let mut new = Element::new(Subelements::new(), Superelements::new());
                for sub in &self[rank+1][i].subs {
                    new.subs.push(perm[*map_to_local.get(sub).unwrap()]);
                }
                new.sort();
                new_list.push(new);
            }
            self[rank+1] = new_list;
        }
    }
pub fn element_sort_strong_with_local ( & mut self , local : & Ranks ) { for el in 0 .. self [ 2 ] . len ( ) { self [ 2 ] [ el ] . subs . sort_unstable ( ) ; } for rank in 2 .. self . len ( ) - 1 { let mut all_subs = Vec :: new ( ) ; for el in & self [ rank ] { all_subs . push ( el . subs . clone ( ) ) ; } let mut sorted = all_subs . clone ( ) ; sorted . sort_unstable ( ) ; let mut perm = Vec :: new ( ) ; for i in & all_subs { perm . push ( sorted . iter ( ) . position ( | x | x == i ) . unwrap ( ) ) ; } for i in 0 .. self [ rank ] . len ( ) { self [ rank ] [ i ] . subs = sorted [ i ] . clone ( ) ; self [ rank ] [ i ] . subs . sort_unstable ( ) ; } let mut map_to_local = HashMap :: new ( ) ; for i in 0 .. self [ rank + 1 ] . len ( ) { for j in 0 .. self [ rank + 1 ] [ i ] . subs . len ( ) { map_to_local . insert ( self [ rank + 1 ] [ i ] . subs [ j ] , local [ rank + 1 ] [ i ] . subs [ j ] ) ; } } let mut new_list = ElementList :: new ( ) ; for i in 0 .. self [ rank + 1 ] . len ( ) { let mut new = Element :: new ( Subelements :: new ( ) , Superelements :: new ( ) ) ; for sub in & self [ rank + 1 ] [ i ] . subs { new . subs . push ( perm [ * map_to_local . get ( sub ) . unwrap ( ) ] ) ; } new . sort ( ) ; new_list . push ( new ) ; } self [ rank + 1 ] = new_list ; } }
Sorts some stuff in a way that's useful for the faceting algorithm.
Sorts some stuff in a way that ' s useful for the faceting algorithm .
&mut self
local
&Ranks