pub struct FullQuery {
pub data: Box<[f32]>,
pub meta: FullQueryMeta,
}Expand description
The inner product between X = ax * X' + bx and Y for d-dimensional
vectors X and Y is:
<X, Y> = <ax * X' + bx, Y>
= ax * <X', Y> + bx * sum(Y).
--------
|
Integer-Float Dot ProductTo compute the squared L2 distance,
|X - Y|^2 = |ax * X' + bx|^2 + |Y|^2 - 2 * <X', Y>A Full Precision Query
Fields§
§data: Box<[f32]>The data after transform is applied to it.
meta: FullQueryMetaImplementations§
Trait Implementations§
Source§impl<T> CompressInto<&[T], &mut FullQuery> for MinMaxQuantizer
impl<T> CompressInto<&[T], &mut FullQuery> for MinMaxQuantizer
Source§fn compress_into(
&self,
from: &[T],
to: &mut FullQuery,
) -> Result<(), Self::Error>
fn compress_into( &self, from: &[T], to: &mut FullQuery, ) -> Result<(), Self::Error>
Compress the input vector from into a mutable reference for a FullQuery to.
This method simply applies the transformation to the input without any compression.
§Error
Returns an error if the input contains NaN.
§Panics
Panics if:
from.len() != self.dim(): Vector to be compressed must have the same dimensionality as the quantizer.to.len() != self.output_dim(): Compressed vector must have the same dimensionality as the quantizer.
Source§type Error = InputContainsNaN
type Error = InputContainsNaN
Errors that may occur during compression.
Source§impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<MathematicalValue<f32>, UnequalLengths>> for MinMaxIPwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<&'a [f32], BitSlice<'b, NBITS, Unsigned>, MathematicalResult<f32>>,
impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<MathematicalValue<f32>, UnequalLengths>> for MinMaxIPwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<&'a [f32], BitSlice<'b, NBITS, Unsigned>, MathematicalResult<f32>>,
Source§impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<MathematicalValue<f32>, UnequalLengths>> for MinMaxL2Squaredwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<&'a [f32], BitSlice<'b, NBITS, Unsigned>, MathematicalResult<f32>>,
impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<MathematicalValue<f32>, UnequalLengths>> for MinMaxL2Squaredwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<&'a [f32], BitSlice<'b, NBITS, Unsigned>, MathematicalResult<f32>>,
Source§impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<f32, UnequalLengths>> for MinMaxCosinewhere
Unsigned: Representation<NBITS>,
MinMaxIP: for<'a, 'b> PureDistanceFunction<&'a FullQuery, DataRef<'b, NBITS>, MathematicalResult<f32>>,
impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<f32, UnequalLengths>> for MinMaxCosinewhere
Unsigned: Representation<NBITS>,
MinMaxIP: for<'a, 'b> PureDistanceFunction<&'a FullQuery, DataRef<'b, NBITS>, MathematicalResult<f32>>,
Source§impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<f32, UnequalLengths>> for MinMaxCosineNormalizedwhere
Unsigned: Representation<NBITS>,
MinMaxIP: for<'a, 'b> PureDistanceFunction<&'a FullQuery, DataRef<'b, NBITS>, MathematicalResult<f32>>,
impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<f32, UnequalLengths>> for MinMaxCosineNormalizedwhere
Unsigned: Representation<NBITS>,
MinMaxIP: for<'a, 'b> PureDistanceFunction<&'a FullQuery, DataRef<'b, NBITS>, MathematicalResult<f32>>,
Source§impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<f32, UnequalLengths>> for MinMaxIPwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<&'a [f32], BitSlice<'b, NBITS, Unsigned>, MathematicalResult<f32>>,
impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<f32, UnequalLengths>> for MinMaxIPwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<&'a [f32], BitSlice<'b, NBITS, Unsigned>, MathematicalResult<f32>>,
Source§impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<f32, UnequalLengths>> for MinMaxL2Squaredwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<&'a [f32], BitSlice<'b, NBITS, Unsigned>, MathematicalResult<f32>>,
impl<const NBITS: usize> PureDistanceFunction<&FullQuery, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, MinMaxCompensation>>, Result<f32, UnequalLengths>> for MinMaxL2Squaredwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<&'a [f32], BitSlice<'b, NBITS, Unsigned>, MathematicalResult<f32>>,
Auto Trait Implementations§
impl Freeze for FullQuery
impl RefUnwindSafe for FullQuery
impl Send for FullQuery
impl Sync for FullQuery
impl Unpin for FullQuery
impl UnwindSafe for FullQuery
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