pub struct TopKPool {
pub best_error: f64,
pub accept_error: f64,
pub stats: PoolStats,
/* private fields */
}Expand description
Bounded pool for collecting matches
Fields§
§best_error: f64Best error seen so far (for threshold tightening)
accept_error: f64Accept error threshold (tightens slowly for diversity)
stats: PoolStatsStatistics
Implementations§
Source§impl TopKPool
impl TopKPool
Sourcepub fn new(capacity: usize, initial_max_error: f64) -> Self
pub fn new(capacity: usize, initial_max_error: f64) -> Self
Create a new pool with given capacity
Sourcepub fn new_with_diagnostics(
capacity: usize,
initial_max_error: f64,
show_db_adds: bool,
ranking_mode: RankingMode,
) -> Self
pub fn new_with_diagnostics( capacity: usize, initial_max_error: f64, show_db_adds: bool, ranking_mode: RankingMode, ) -> Self
Create a new pool with diagnostic options
Sourcepub fn try_insert(&mut self, m: Match) -> bool
pub fn try_insert(&mut self, m: Match) -> bool
Try to insert a match into the pool Returns true if inserted, false if rejected
Sourcepub fn would_accept(&self, error: f64, is_exact: bool) -> bool
pub fn would_accept(&self, error: f64, is_exact: bool) -> bool
Check if a match would be accepted (for early pruning)
Sourcepub fn would_accept_strict(
&self,
coarse_error: f64,
is_potentially_exact: bool,
) -> bool
pub fn would_accept_strict( &self, coarse_error: f64, is_potentially_exact: bool, ) -> bool
Check if a match would be accepted, with stricter gate when pool is near capacity This is used as a pre-Newton filter to avoid expensive refinement calls
Sourcepub fn into_sorted(self) -> Vec<Match>
pub fn into_sorted(self) -> Vec<Match>
Get all matches, sorted by ranking mode.
Auto Trait Implementations§
impl Freeze for TopKPool
impl RefUnwindSafe for TopKPool
impl Send for TopKPool
impl Sync for TopKPool
impl Unpin for TopKPool
impl UnsafeUnpin for TopKPool
impl UnwindSafe for TopKPool
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