pub fn compute(
        &mut self,
        coords: &Coords,
        meta: impl IntoExactSizeCloneIterator<Item=M>,
    ) -> FailResult<&FracBonds> {
        let meta = meta.into_exact_size_clone_iterator();

        let replace_cache = {
            match (self.num_calls, self.check_frequency) {
                (0, _) => true, // first call
                (_, 0) => false, // infinite delay
                (a, b) if a % b == 0 => {
                    match self.cache_status(coords, meta.clone()) {
                        CacheStatus::Invalidated => true,
                        CacheStatus::Applicable => false,
                    }
                },
                (_, _) => false,
            }
        };
        self.num_calls += 1;

        if replace_cache {
            self.last = Some(Cache {
                input_lattice: coords.lattice().clone(),
                input_carts: coords.to_carts(),
                input_meta: meta.clone().collect(),
                output: self.force_compute(coords, meta)?,
            });
        }
        Ok(&self.last.as_ref().unwrap().output)
    }
/// Compute the `FracBonds` for a given structure, possibly reusing results cached from a
/// previous call to `compute` to elide an expensive search.
///
/// The output is guaranteed to include every bond within the `max_range` and `meta_range`
/// parameters provided on construction.  It may also incidentally include some bonds of longer
/// lengths (by up to about `2.0 * skin_depth`), but not necessarily all of them.
Compute the `FracBonds` for a given structure, possibly reusing results cached from a
previous call to `compute` to elide an expensive search.

The output is guaranteed to include every bond within the `max_range` and `meta_range`
parameters provided on construction.  It may also incidentally include some bonds of longer
lengths (by up to about `2.0 * skin_depth`), but not necessarily all of them.
Compute the ` FracBonds ` for a given structure possibly reusing results cached from a previous call to ` compute ` to elide an expensive search . The output is guaranteed to include every bond within the ` max_range ` and ` meta_range ` parameters provided on construction . It may also incidentally include some bonds of longer lengths ( by up to about ` 2 . 0 * skin_depth ` ) but not necessarily all of them .
pub fn compute(
        &mut self,
        coords: &Coords,
        meta: impl IntoExactSizeCloneIterator<Item=M>,
    ) -> FailResult<&FracBonds> {
        let meta = meta.into_exact_size_clone_iterator();
        let replace_cache = {
            match (self.num_calls, self.check_frequency) {
                (0, _) => true, // first call
                (_, 0) => false, // infinite delay
                (a, b) if a % b == 0 => {
                    match self.cache_status(coords, meta.clone()) {
                        CacheStatus::Invalidated => true,
                        CacheStatus::Applicable => false,
                    }
                },
                (_, _) => false,
            }
        };
        self.num_calls += 1;
        if replace_cache {
            self.last = Some(Cache {
                input_lattice: coords.lattice().clone(),
                input_carts: coords.to_carts(),
                input_meta: meta.clone().collect(),
                output: self.force_compute(coords, meta)?,
            });
        }
        Ok(&self.last.as_ref().unwrap().output)
    }
pub fn compute ( & mut self , coords : & Coords , meta : impl IntoExactSizeCloneIterator < Item = M > , ) -> FailResult < & FracBonds > { let meta = meta . into_exact_size_clone_iterator ( ) ; let replace_cache = { match ( self . num_calls , self . check_frequency ) { ( 0 , _ ) => true , // first call ( _ , 0 ) => false , // infinite delay ( a , b ) if a % b == 0 => { match self . cache_status ( coords , meta . clone ( ) ) { CacheStatus :: Invalidated => true , CacheStatus :: Applicable => false , } } , ( _ , _ ) => false , } } ; self . num_calls += 1 ; if replace_cache { self . last = Some ( Cache { input_lattice : coords . lattice ( ) . clone ( ) , input_carts : coords . to_carts ( ) , input_meta : meta . clone ( ) . collect ( ) , output : self . force_compute ( coords , meta ) ? , } ) ; } Ok ( & self . last . as_ref ( ) . unwrap ( ) . output ) }
Compute the `FracBonds` for a given structure, possibly reusing results cached from a
previous call to `compute` to elide an expensive search.
Compute the ` FracBonds ` for a given structure possibly reusing results cached from a previous call to ` compute ` to elide an expensive search .
&mut self
coords
&Coords
meta
impl IntoExactSizeCloneIterator<Item=M>
&mut self
coords
&Coords
meta
impl IntoExactSizeCloneIterator<Item=M>