pub fn update<T: Hash>(&mut self, value_to_be_hashed: &T) {
        let mut hasher = DefaultHasher::new();
        value_to_be_hashed.hash(&mut hasher);
        let hash_value = hasher.finish() as u32 as u64;
        // TODO: Is there a better way to get u32 hashes?
        let hash_value_permutations = self
            .permutations
            .iter()
            .map(|(a, b)| (((a * hash_value) + b) % _MERSENNE_PRIME) & _MAX_HASH);
        // np.min
        self.hash_values
            .0
            .iter_mut()
            .zip_eq(hash_value_permutations)
            .for_each(|(old, new)| *old = min(*old, new));
    }
/// Add a new value to the set
Add a new value to the set
Add a new value to the set
pub fn update<T: Hash>(&mut self, value_to_be_hashed: &T) {
        let mut hasher = DefaultHasher::new();
        value_to_be_hashed.hash(&mut hasher);
        let hash_value = hasher.finish() as u32 as u64;
        // TODO: Is there a better way to get u32 hashes?
        let hash_value_permutations = self
            .permutations
            .iter()
            .map(|(a, b)| (((a * hash_value) + b) % _MERSENNE_PRIME) & _MAX_HASH);
        // np.min
        self.hash_values
            .0
            .iter_mut()
            .zip_eq(hash_value_permutations)
            .for_each(|(old, new)| *old = min(*old, new));
    }
pub fn update < T : Hash > ( & mut self , value_to_be_hashed : & T ) { let mut hasher = DefaultHasher :: new ( ) ; value_to_be_hashed . hash ( & mut hasher ) ; let hash_value = hasher . finish ( ) as u32 as u64 ; // TODO: Is there a better way to get u32 hashes? let hash_value_permutations = self . permutations . iter ( ) . map ( | ( a , b ) | ( ( ( a * hash_value ) + b ) % _MERSENNE_PRIME ) & _MAX_HASH ) ; // np.min self . hash_values . 0 . iter_mut ( ) . zip_eq ( hash_value_permutations ) . for_each ( | ( old , new ) | * old = min ( * old , new ) ) ; }
Add a new value to the set
Add a new value to the set
&mut self
value_to_be_hashed
&T
&mut self
value_to_be_hashed
&T