fn find_scanner_mapping(&self, unique_beacons: &HashSet<Array1<i32>>, scanner_j: usize) -> Option<ScannersMapping> {
        let beacons_i = unique_beacons;
        let beacons_j = &self.scanners[scanner_j].beacons;

        for unique_beacon in beacons_i {
            for j in 0..beacons_j.len() {
                // Test each rotation of each couple
                for rotation_matrix_index in 0..self.rotation_matrixes.len() {
                    let offset = unique_beacon - self.rotation_matrixes[rotation_matrix_index].dot(&beacons_j[j]);
                    if self.overlaps(unique_beacons, scanner_j, rotation_matrix_index, &offset) {
                        return Some(ScannersMapping {
                            rotation_matrix_index,
                            offset
                        });
                    }
                }
            }
        }

        None
    }
/// Returns a pair with the rotation matrix index and the offset if any mapping exists
Returns a pair with the rotation matrix index and the offset if any mapping exists
Returns a pair with the rotation matrix index and the offset if any mapping exists
fn find_scanner_mapping(&self, unique_beacons: &HashSet<Array1<i32>>, scanner_j: usize) -> Option<ScannersMapping> {
        let beacons_i = unique_beacons;
        let beacons_j = &self.scanners[scanner_j].beacons;
        for unique_beacon in beacons_i {
            for j in 0..beacons_j.len() {
                // Test each rotation of each couple
                for rotation_matrix_index in 0..self.rotation_matrixes.len() {
                    let offset = unique_beacon - self.rotation_matrixes[rotation_matrix_index].dot(&beacons_j[j]);
                    if self.overlaps(unique_beacons, scanner_j, rotation_matrix_index, &offset) {
                        return Some(ScannersMapping {
                            rotation_matrix_index,
                            offset
                        });
                    }
                }
            }
        }
        None
    }
fn find_scanner_mapping ( & self , unique_beacons : & HashSet < Array1 < i32 > > , scanner_j : usize ) -> Option < ScannersMapping > { let beacons_i = unique_beacons ; let beacons_j = & self . scanners [ scanner_j ] . beacons ; for unique_beacon in beacons_i { for j in 0 .. beacons_j . len ( ) { // Test each rotation of each couple for rotation_matrix_index in 0 .. self . rotation_matrixes . len ( ) { let offset = unique_beacon - self . rotation_matrixes [ rotation_matrix_index ] . dot ( & beacons_j [ j ] ) ; if self . overlaps ( unique_beacons , scanner_j , rotation_matrix_index , & offset ) { return Some ( ScannersMapping { rotation_matrix_index , offset } ) ; } } } } None }
Returns a pair with the rotation matrix index and the offset if any mapping exists
Returns a pair with the rotation matrix index and the offset if any mapping exists
&self
unique_beacons
&HashSet<Array1<i32>>
scanner_j
usize
&self
unique_beacons
&HashSet<Array1<i32>>
scanner_j
usize