pub struct AhCodebook { /* private fields */ }Implementations§
Source§impl AhCodebook
impl AhCodebook
pub fn train( residuals: &[f32], points: usize, dimension: usize, dimensions_per_block: usize, iterations: usize, seed: u64, ) -> ScannResult<Self>
pub fn from_artifact( dimension: usize, artifact: &ScannAhCodebook, ) -> ScannResult<Self>
Sourcepub fn from_artifact_ref(
dimension: usize,
artifact: ScannAhCodebookRef<'_>,
) -> ScannResult<Self>
pub fn from_artifact_ref( dimension: usize, artifact: ScannAhCodebookRef<'_>, ) -> ScannResult<Self>
Decode only the small AH codebook from a borrowed global-artifact view. Routing centroid planes remain mmap-backed in the executable model.
pub fn to_artifact(&self) -> ScannAhCodebook
pub fn dimension(&self) -> usize
pub fn dimensions_per_block(&self) -> usize
pub fn blocks(&self) -> usize
pub fn code_bytes(&self) -> usize
pub fn estimated_memory_bytes(&self) -> usize
Sourcepub fn encode(
&self,
residual: &[f32],
original: &[f32],
anisotropic_threshold: f32,
codes: &mut [u8],
) -> ScannResult<()>
pub fn encode( &self, residual: &[f32], original: &[f32], anisotropic_threshold: f32, codes: &mut [u8], ) -> ScannResult<()>
Encode one residual with ScaNN’s anisotropic direction-aware objective. Codes are unpacked nibbles to make streaming FastScan transposition cheap.
pub fn encode_with_scratch( &self, residual: &[f32], original: &[f32], anisotropic_threshold: f32, codes: &mut [u8], scratch: &mut AhEncodeScratch, ) -> ScannResult<()>
pub fn encode_packed( &self, residual: &[f32], original: &[f32], anisotropic_threshold: f32, output: &mut [u8], ) -> ScannResult<()>
pub fn query_dot_product(&self, query: &[f32]) -> ScannResult<AhQuery>
Trait Implementations§
Source§impl Clone for AhCodebook
impl Clone for AhCodebook
Source§fn clone(&self) -> AhCodebook
fn clone(&self) -> AhCodebook
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 moreSource§impl Debug for AhCodebook
impl Debug for AhCodebook
Source§impl PartialEq for AhCodebook
impl PartialEq for AhCodebook
impl StructuralPartialEq for AhCodebook
Auto Trait Implementations§
impl Freeze for AhCodebook
impl RefUnwindSafe for AhCodebook
impl Send for AhCodebook
impl Sync for AhCodebook
impl Unpin for AhCodebook
impl UnsafeUnpin for AhCodebook
impl UnwindSafe for AhCodebook
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