pub struct PreparedRationer<'r> { /* private fields */ }Expand description
Reusable corpus + SAMs built by Rationer::prepare. Hold this across many
ratio_many_idx calls to amortize SAM building and the GPU upload over the lifetime of the
string set. Borrowing the Rationer keeps the Metal device and thread pool wiring alive.
Implementations§
Source§impl PreparedRationer<'_>
impl PreparedRationer<'_>
Sourcepub fn ratio_many_idx(&self, pairs: &[(u32, u32)]) -> Vec<f64>
pub fn ratio_many_idx(&self, pairs: &[(u32, u32)]) -> Vec<f64>
Batched Ratcliff-Obershelp ratio over a pair list referencing the prepared strings by
index ((i, j) ⇒ ratio(strings[i], strings[j])). All SAM / GPU-corpus state is reused
from prepare(), so a long-lived PreparedRationer paying its build cost once can serve
many queries at the kernel-pure GPU throughput.
§Panics
Panics if any pair index is out of bounds.
Auto Trait Implementations§
impl<'r> Freeze for PreparedRationer<'r>
impl<'r> !RefUnwindSafe for PreparedRationer<'r>
impl<'r> Send for PreparedRationer<'r>
impl<'r> Sync for PreparedRationer<'r>
impl<'r> Unpin for PreparedRationer<'r>
impl<'r> UnsafeUnpin for PreparedRationer<'r>
impl<'r> !UnwindSafe for PreparedRationer<'r>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more