[−][src]Struct probminhash::probminhasher::ProbMinHash2
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]
D: Copy + Eq + Hash + Debug,
H: Hasher + Default,
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]
T: WeightedSet<Object = D> + Iterator<Item = D>,
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,
D: RefUnwindSafe,
H: RefUnwindSafe,
impl<D, H> Send for ProbMinHash2<D, H> where
D: Send,
H: Send,
D: Send,
H: Send,
impl<D, H> Sync for ProbMinHash2<D, H> where
D: Sync,
H: Sync,
D: Sync,
H: Sync,
impl<D, H> Unpin for ProbMinHash2<D, H> where
D: Unpin,
H: Unpin,
D: Unpin,
H: Unpin,
impl<D, H> UnwindSafe for ProbMinHash2<D, H> where
D: UnwindSafe,
H: UnwindSafe,
D: UnwindSafe,
H: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,