pub fn new(lattice: &Lattice) -> Result<Self, Error> {
        // NOTE: not sure if this precise condition is necessary/sufficient
        ensure!(!lattice.is_large_skew(1e-4), "cell is too skewed for image finding");

        let mut vecs = Vec::with_capacity(27);
        for &fa in &[-1.0, 0.0, 1.0] {
            for &fb in &[-1.0, 0.0, 1.0] {
                for &fc in &[-1.0, 0.0, 1.0] {
                    vecs.push(V3([fa, fb, fc]) * lattice);
                }
            }
        }

        Ok(NearestImageFinder {
            lattice: lattice.clone(),
            lattice_vector_carts_around_origin: vecs,
        })
    }
/// Construct a `NearestImageFinder` for a lattice.
///
/// Requires that the lattice be of sufficiently small skew such that:
///
/// * for any point in the unit cell...
/// * ...the nearest image of any other point in the unit cell lies within the 27 cells
///   centered around the unit cell.
///
/// (the precise criteria for this is not yet known; for now, lattices are simply rejected if
///  they "look troublesome")
Construct a `NearestImageFinder` for a lattice.
Requires that the lattice be of sufficiently small skew such that.

for any point in the unit cell
the nearest image of any other point in the unit cell lies within the 27 cells
centered around the unit cell.

(the precise criteria for this is not yet known; for now, lattices are simply rejected if
they "look troublesome")
Construct a ` NearestImageFinder ` for a lattice . Requires that the lattice be of sufficiently small skew such that . for any point in the unit cell the nearest image of any other point in the unit cell lies within the 27 cells centered around the unit cell . ( the precise criteria for this is not yet known ; for now lattices are simply rejected if they " look troublesome " )
pub fn new(lattice: &Lattice) -> Result<Self, Error> {
        // NOTE: not sure if this precise condition is necessary/sufficient
        ensure!(!lattice.is_large_skew(1e-4), "cell is too skewed for image finding");
        let mut vecs = Vec::with_capacity(27);
        for &fa in &[-1.0, 0.0, 1.0] {
            for &fb in &[-1.0, 0.0, 1.0] {
                for &fc in &[-1.0, 0.0, 1.0] {
                    vecs.push(V3([fa, fb, fc]) * lattice);
                }
            }
        }
        Ok(NearestImageFinder {
            lattice: lattice.clone(),
            lattice_vector_carts_around_origin: vecs,
        })
    }
pub fn new ( lattice : & Lattice ) -> Result < Self , Error > { // NOTE: not sure if this precise condition is necessary/sufficient ensure ! ( lattice is_large_skew ( 1e-4 ) " " ) ; let mut vecs = Vec :: with_capacity ( 27 ) ; for & fa in & [ - 1.0 , 0.0 , 1.0 ] { for & fb in & [ - 1.0 , 0.0 , 1.0 ] { for & fc in & [ - 1.0 , 0.0 , 1.0 ] { vecs . push ( V3 ( [ fa , fb , fc ] ) * lattice ) ; } } } Ok ( NearestImageFinder { lattice : lattice . clone ( ) , lattice_vector_carts_around_origin : vecs , } ) }
Construct a `NearestImageFinder` for a lattice.
Construct a ` NearestImageFinder ` for a lattice .
lattice
&Lattice
lattice
&Lattice