pub struct FieldComparator { /* private fields */ }Expand description
Pairwise field comparator that applies similarity functions to produce a field-major ComparisonBatch.
Implementations§
Source§impl FieldComparator
impl FieldComparator
pub fn from_schema(schema: &Schema) -> FieldComparator
Sourcepub fn from_mapping(
mappings: &[FieldMapping],
a_schema: &Schema,
) -> FieldComparator
pub fn from_mapping( mappings: &[FieldMapping], a_schema: &Schema, ) -> FieldComparator
Build a comparator for cross-schema linkage from an explicit field-mapping list.
Field kinds are inferred from a_schema by looking up each a_field.
Fields not found in a_schema default to FieldKind::Categorical.
Sourcepub fn compare_pair_mapped(
&self,
a: &Record,
b: &Record,
mappings: &[FieldMapping],
) -> ComparisonVector
pub fn compare_pair_mapped( &self, a: &Record, b: &Record, mappings: &[FieldMapping], ) -> ComparisonVector
Compare a cross-schema pair using an explicit field-mapping list.
For each mapping, looks up a_field in record a and b_field in
record b. When a field is missing the NullPolicy decides the level:
Skip gives Null (EM ignores it), PenaliseAbsence gives None (hard fail).
Sourcepub fn compare_batch_mapped(
&self,
records: &[Record],
indices: &[(usize, usize)],
mappings: &[FieldMapping],
) -> ComparisonBatch
pub fn compare_batch_mapped( &self, records: &[Record], indices: &[(usize, usize)], mappings: &[FieldMapping], ) -> ComparisonBatch
Batch comparison for cross-schema linkage using explicit field mappings.
Equivalent to calling compare_pair_mapped per pair then assembling the
field-major ComparisonBatch. n_fields = mappings.len().
pub fn with_thresholds( self, field_idx: usize, thresholds: LevelThresholds, ) -> FieldComparator
pub fn with_fns( self, field_idx: usize, fns: Vec<Box<dyn SimilarityFn>>, ) -> FieldComparator
Sourcepub fn compare_batch_from_pool(
&self,
pool: &RecordPool,
indices: &[(usize, usize)],
schema: &Schema,
) -> ComparisonBatch
pub fn compare_batch_from_pool( &self, pool: &RecordPool, indices: &[(usize, usize)], schema: &Schema, ) -> ComparisonBatch
Pool-native batch comparison, the primary hot path.
Reads RecordPool columns directly: zero HashMap lookups, no
Record::clone(). Uses Rayon for parallel per-pair comparison
into a flat pair-major buffer (zero per-pair heap allocations), then
transposes to the field-major ComparisonBatch layout required by
all GPU EM kernels (CUDA/Vulkan/AVX2): levels[f * n_pairs + p].
Trait Implementations§
Source§impl Comparator for FieldComparator
impl Comparator for FieldComparator
Source§fn compare(&self, a: &Record, b: &Record, schema: &Schema) -> ComparisonVector
fn compare(&self, a: &Record, b: &Record, schema: &Schema) -> ComparisonVector
Source§fn compare_batch_from_pool(
&self,
pool: &RecordPool,
indices: &[(usize, usize)],
schema: &Schema,
) -> ComparisonBatch
fn compare_batch_from_pool( &self, pool: &RecordPool, indices: &[(usize, usize)], schema: &Schema, ) -> ComparisonBatch
Auto Trait Implementations§
impl Freeze for FieldComparator
impl !RefUnwindSafe for FieldComparator
impl Send for FieldComparator
impl Sync for FieldComparator
impl Unpin for FieldComparator
impl UnsafeUnpin for FieldComparator
impl !UnwindSafe for FieldComparator
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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