pub fn jaccard(&mut self, other_minhash: &MinHash) -> Result<f32> {
        if other_minhash.seed != self.seed {
            return Err(MinHashingError::DifferentSeeds);
        }
        if other_minhash.num_perm != self.num_perm {
            return Err(MinHashingError::DifferentNumPermFuncs);
        }
        let matches = self
            .hash_values
            .0
            .iter_mut()
            .zip_eq(&other_minhash.hash_values.0)
            .filter(|(left, right)| left == right)
            .count();
        let result = matches as f32 / self.num_perm as f32;
        Ok(result)
    }
/// Compute the jaccard distance between to MinHash sets that use the same seed and number of
/// permutation functions
Compute the jaccard distance between to MinHash sets that use the same seed and number of
permutation functions
Compute the jaccard distance between to MinHash sets that use the same seed and number of permutation functions
pub fn jaccard(&mut self, other_minhash: &MinHash) -> Result<f32> {
        if other_minhash.seed != self.seed {
            return Err(MinHashingError::DifferentSeeds);
        }
        if other_minhash.num_perm != self.num_perm {
            return Err(MinHashingError::DifferentNumPermFuncs);
        }
        let matches = self
            .hash_values
            .0
            .iter_mut()
            .zip_eq(&other_minhash.hash_values.0)
            .filter(|(left, right)| left == right)
            .count();
        let result = matches as f32 / self.num_perm as f32;
        Ok(result)
    }
pub fn jaccard ( & mut self , other_minhash : & MinHash ) -> Result < f32 > { if other_minhash . seed != self . seed { return Err ( MinHashingError :: DifferentSeeds ) ; } if other_minhash . num_perm != self . num_perm { return Err ( MinHashingError :: DifferentNumPermFuncs ) ; } let matches = self . hash_values . 0 . iter_mut ( ) . zip_eq ( & other_minhash . hash_values . 0 ) . filter ( | ( left , right ) | left == right ) . count ( ) ; let result = matches as f32 / self . num_perm as f32 ; Ok ( result ) }
Compute the jaccard distance between to MinHash sets that use the same seed and number of
permutation functions
Compute the jaccard distance between to MinHash sets that use the same seed and number of permutation functions
&mut self
other_minhash
&MinHash
&mut self
other_minhash
&MinHash