[][src]Struct probminhash::probminhasher::ProbMinHash2

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

implementation of the algorithm ProbMinHash2 as described in Ertl paper.

D must be convertible injectively into a usize for random generator initialization hence the requirement 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 replaced by the rank in the Vector, then no hash is need and you can use NoHasher

Implementations

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

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

Allocates a ProbMinHash2 structure with nbhash hash functions and initialize signature with initobj (typically 0 for numeric objects)

pub fn hash_item(&mut self, id: D, weight: f64)[src]

Incrementally adds an item in hash signature. It can be used in streaming.
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 hash_wset

pub fn hash_wset<T>(&mut self, data: &mut T) where
    T: WeightedSet<Object = D> + Iterator<Item = D>, 
[src]

hash data when given by an iterable WeightedSet

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

return final signature.

Auto Trait Implementations

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

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

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

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

impl<D, H> UnwindSafe for ProbMinHash2<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>,