[][src]Struct probminhash::probminhasher::ProbMinHash3a

pub struct ProbMinHash3a<D, H> where
    D: Copy + Eq + Hash + Debug,
    H: Hasher + Default
{ /* fields omitted */ }

implementation of the algorithm ProbMinHash3a as described in Etrl.
This version of ProbMinHash3 is faster but needs some more memory as it stores some states between 2 passes on data.

Probminhash3a needs at least 2 hash values to run. D must be convertible (at least partially) injectively into a usize for random generator initialization hence the requirement D:Hash.
If all data are referred to by an unsigned integer, and weight association is given in a tuple for example if data comes in a Vec<(D,f64)> then D can be in fact replaced by the rank in the Vector, then no hash is need and you can use NoHasher

Implementations

impl<D, H> ProbMinHash3a<D, H> where
    D: Copy + Eq + Debug + Hash,
    H: Hasher + Default
[src]

pub fn new(nbhash: usize, initobj: D) -> Self[src]

Allocates a new ProbMinHash3a structure with nbhash >= 2 functions and initial object initobj to fill signature.
The precision on the final estimation depends on the number of hash functions.
The initial object can be any object , typically 0 for numerical objects.

pub fn hash_weigthed_idxmap<Hidx>(&mut self, data: &IndexMap<D, f64, Hidx>) where
    Hidx: BuildHasher
[src]

It is the building block of the computation, but this method does not check for unicity of id added in hash computation.
It is user responsability to enforce that. See method hashWSet

pub fn get_signature(&self) -> &Vec<D>[src]

return final signature.

Auto Trait Implementations

impl<D, H> RefUnwindSafe for ProbMinHash3a<D, H> where
    D: RefUnwindSafe,
    H: RefUnwindSafe

impl<D, H> Send for ProbMinHash3a<D, H> where
    D: Send,
    H: Send

impl<D, H> Sync for ProbMinHash3a<D, H> where
    D: Sync,
    H: Sync

impl<D, H> Unpin for ProbMinHash3a<D, H> where
    D: Unpin,
    H: Unpin

impl<D, H> UnwindSafe for ProbMinHash3a<D, H> where
    D: UnwindSafe,
    H: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,