FastSimHash

Struct FastSimHash 

Source
pub struct FastSimHash<H, S, const L: usize, const BULK: usize = 3>
where H: SimHasher<T = u64>, S: SimHashBits,
{ /* private fields */ }

Implementations§

Source§

impl<H, S, const L: usize, const BULK: usize> FastSimHash<H, S, L, BULK>
where H: SimHasher<T = u64>, S: SimHashBits,

Source

pub fn new(hasher: H) -> Self

Source

pub fn create_signature<T, U>(&self, iter: T) -> S
where T: IntoIterator<Item = U>, U: Hash,

Source

pub fn create_signature_weighted<T, U, W>(&self, iter: T) -> S
where T: IntoIterator<Item = (U, W)>, U: Hash, W: Into<f32> + Copy,

Weighted variant (simple path): uses signed float counters. This keeps per-feature random bits from Xoroshiro but does not use the packed-counter bit-hack. Still quite fast; O(#features * L/64).

Auto Trait Implementations§

§

impl<H, S, const L: usize, const BULK: usize> Freeze for FastSimHash<H, S, L, BULK>
where H: Freeze,

§

impl<H, S, const L: usize, const BULK: usize> RefUnwindSafe for FastSimHash<H, S, L, BULK>

§

impl<H, S, const L: usize, const BULK: usize> Send for FastSimHash<H, S, L, BULK>
where H: Send, S: Send,

§

impl<H, S, const L: usize, const BULK: usize> Sync for FastSimHash<H, S, L, BULK>
where H: Sync, S: Sync,

§

impl<H, S, const L: usize, const BULK: usize> Unpin for FastSimHash<H, S, L, BULK>
where H: Unpin, S: Unpin,

§

impl<H, S, const L: usize, const BULK: usize> UnwindSafe for FastSimHash<H, S, L, BULK>
where H: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.