pub struct IvfTqIndex {
pub dim: usize,
pub routing: IvfRoutingMode,
pub centroids_version: u64,
/* private fields */
}Expand description
IVF-TQ build payload for a single segment.
Fields§
§dim: usize§routing: IvfRoutingMode§centroids_version: u64Version of coarse centroids used (for merge compatibility).
Implementations§
Source§impl IvfTqIndex
impl IvfTqIndex
pub fn new( dim: usize, routing: IvfRoutingMode, centroids_version: u64, codec: Arc<TqCodec>, ) -> Self
pub fn codec(&self) -> &TqCodec
Sourcepub fn add_vector(
&mut self,
coarse_centroids: &CoarseCentroids,
doc_id: u32,
ordinal: u16,
vector: &[f32],
scratch: &mut TqIvfEncodeScratch,
)
pub fn add_vector( &mut self, coarse_centroids: &CoarseCentroids, doc_id: u32, ordinal: u16, vector: &[f32], scratch: &mut TqIvfEncodeScratch, )
Add a single vector: assign to the trained router (with SOAR when configured) and TQ-encode the residual against every assigned leaf.
Sourcepub fn add_vectors_parallel(
&mut self,
coarse_centroids: &CoarseCentroids,
doc_id_ordinals: &[(u32, u16)],
vectors: &[f32],
) -> Result<(), &'static str>
pub fn add_vectors_parallel( &mut self, coarse_centroids: &CoarseCentroids, doc_id_ordinals: &[(u32, u16)], vectors: &[f32], ) -> Result<(), &'static str>
Add one contiguous vector batch in parallel while preserving input order inside every leaf.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn estimated_memory_bytes(&self) -> usize
Trait Implementations§
Source§impl Clone for IvfTqIndex
impl Clone for IvfTqIndex
Source§fn clone(&self) -> IvfTqIndex
fn clone(&self) -> IvfTqIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IvfTqIndex
impl RefUnwindSafe for IvfTqIndex
impl Send for IvfTqIndex
impl Sync for IvfTqIndex
impl Unpin for IvfTqIndex
impl UnsafeUnpin for IvfTqIndex
impl UnwindSafe for IvfTqIndex
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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> ⓘ
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