// !!! This function affects the supercell convention !!! (SUPERCELL-CONV)
// When modifying it, you must modify all functions that have this label.
This function affects the supercell convention !!. (SUPERCELL-CONV)
When modifying it, you must modify all functions that have this label.
This function affects the supercell convention !! . ( SUPERCELL - CONV ) When modifying it you must modify all functions that have this label .
pub fn atom_from_cell_unchecked(&self, prim: usize, cell: [u32; 3]) -> usize {
        use rsp2_array_types::dot;
        let [len_a, len_b, len_c] = self.periods;
        let stride_c = 1;
        let stride_b = stride_c * len_c as usize;
        let stride_a = stride_b * len_b as usize;
        let stride_prim = stride_a * len_a as usize;
        let strides = V3([stride_a, stride_b, stride_c]);
        prim * stride_prim + dot(&strides, &V3(cell).map(|x| x as usize))
    }
pub fn atom_from_cell_unchecked ( & self , prim : usize , cell : [ u32 ; 3 ] ) -> usize { use rsp2_array_types :: dot ; let [ len_a , len_b , len_c ] = self . periods ; let stride_c = 1 ; let stride_b = stride_c * len_c as usize ; let stride_a = stride_b * len_b as usize ; let stride_prim = stride_a * len_a as usize ; let strides = V3 ( [ stride_a , stride_b , stride_c ] ) ; prim * stride_prim + dot ( & strides , & V3 ( cell ) . map ( | x | x as usize ) ) }
This function affects the supercell convention !
This function affects the supercell convention !
&self
prim
usize
cell
[u32; 3]