pub struct CompensatedSquaredL2 { /* private fields */ }Expand description
A DistanceFunction containing scaling parameters to enable distance the SquaredL2
distance function over CompensatedVectors belonging to the same quantization space.
Implementations§
Trait Implementations§
Source§impl AsFunctor<CompensatedSquaredL2> for ScalarQuantizer
impl AsFunctor<CompensatedSquaredL2> for ScalarQuantizer
fn as_functor(&self) -> CompensatedSquaredL2
Source§impl Clone for CompensatedSquaredL2
impl Clone for CompensatedSquaredL2
Source§fn clone(&self) -> CompensatedSquaredL2
fn clone(&self) -> CompensatedSquaredL2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompensatedSquaredL2
impl Debug for CompensatedSquaredL2
Source§impl<const NBITS: usize> DistanceFunction<VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, Compensation>>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, Compensation>>, Result<MathematicalValue<f32>, UnequalLengths>> for CompensatedSquaredL2where
Unsigned: Representation<NBITS>,
SquaredL2: for<'a, 'b> PureDistanceFunction<BitSlice<'a, NBITS, Unsigned>, BitSlice<'b, NBITS, Unsigned>, MathematicalResult<u32>>,
Compute the squared euclidean distance between the two compensated vectors.
impl<const NBITS: usize> DistanceFunction<VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, Compensation>>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, Compensation>>, Result<MathematicalValue<f32>, UnequalLengths>> for CompensatedSquaredL2where
Unsigned: Representation<NBITS>,
SquaredL2: for<'a, 'b> PureDistanceFunction<BitSlice<'a, NBITS, Unsigned>, BitSlice<'b, NBITS, Unsigned>, MathematicalResult<u32>>,
Compute the squared euclidean distance between the two compensated vectors.
The value returned by this function is scaled properly, meaning that distances returned by this method are compatible with full-precision distances.
§Validity
The results of this function are only meaningful if both x, y, and Self belong to
the same quantizer.
§Panics
Panics if x.len() != y.len().
Source§fn evaluate_similarity(
&self,
x: CompensatedVectorRef<'_, NBITS>,
y: CompensatedVectorRef<'_, NBITS>,
) -> MathematicalResult<f32>
fn evaluate_similarity( &self, x: CompensatedVectorRef<'_, NBITS>, y: CompensatedVectorRef<'_, NBITS>, ) -> MathematicalResult<f32>
Source§impl<const NBITS: usize> DistanceFunction<VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, Compensation>>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, Compensation>>, Result<f32, UnequalLengths>> for CompensatedSquaredL2where
Unsigned: Representation<NBITS>,
Self: for<'a, 'b> DistanceFunction<CompensatedVectorRef<'a, NBITS>, CompensatedVectorRef<'b, NBITS>, MathematicalResult<f32>>,
Compute the squared euclidean distance between the two compensated vectors.
impl<const NBITS: usize> DistanceFunction<VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, Compensation>>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, Compensation>>, Result<f32, UnequalLengths>> for CompensatedSquaredL2where
Unsigned: Representation<NBITS>,
Self: for<'a, 'b> DistanceFunction<CompensatedVectorRef<'a, NBITS>, CompensatedVectorRef<'b, NBITS>, MathematicalResult<f32>>,
Compute the squared euclidean distance between the two compensated vectors.
The value returned by this function is scaled properly, meaning that distances returned by this method are compatible with full-precision distances.
§Validity
The results of this function are only meaningful if both x, y, and Self belong to
the same quantizer.
§Panics
Panics if x.len() != y.len().
Source§fn evaluate_similarity(
&self,
x: CompensatedVectorRef<'_, NBITS>,
y: CompensatedVectorRef<'_, NBITS>,
) -> Result<f32>
fn evaluate_similarity( &self, x: CompensatedVectorRef<'_, NBITS>, y: CompensatedVectorRef<'_, NBITS>, ) -> Result<f32>
impl Copy for CompensatedSquaredL2
Auto Trait Implementations§
impl Freeze for CompensatedSquaredL2
impl RefUnwindSafe for CompensatedSquaredL2
impl Send for CompensatedSquaredL2
impl Sync for CompensatedSquaredL2
impl Unpin for CompensatedSquaredL2
impl UnsafeUnpin for CompensatedSquaredL2
impl UnwindSafe for CompensatedSquaredL2
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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