pub enum SparsityScaling {
Fixed,
SquareRoot,
Logarithmic,
Custom {
a: f64,
b: f64,
c: f64,
},
}Expand description
Sparsity scaling modes for dynamic dimension handling
Variants§
Fixed
Fixed density - nnz scales linearly with dimension Good for: Consistent memory usage per dimension
SquareRoot
Square root scaling - nnz scales as sqrt(dimension) Good for: Maintaining constant similarity precision Formula: target_nnz = base_nnz * sqrt(dim / base_dim)
Logarithmic
Logarithmic scaling - nnz scales as log(dimension) Good for: Memory-constrained environments with large dimensions Formula: target_nnz = base_nnz * log(dim) / log(base_dim)
Custom
Custom scaling with user-provided function coefficients Formula: target_nnz = a * dim^b + c
Trait Implementations§
Source§impl Clone for SparsityScaling
impl Clone for SparsityScaling
Source§fn clone(&self) -> SparsityScaling
fn clone(&self) -> SparsityScaling
Returns a duplicate of the value. Read more
1.0.0 · 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 SparsityScaling
impl Debug for SparsityScaling
Source§impl Default for SparsityScaling
impl Default for SparsityScaling
Source§fn default() -> SparsityScaling
fn default() -> SparsityScaling
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SparsityScaling
impl<'de> Deserialize<'de> for SparsityScaling
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SparsityScaling
impl PartialEq for SparsityScaling
Source§impl Serialize for SparsityScaling
impl Serialize for SparsityScaling
impl Copy for SparsityScaling
impl StructuralPartialEq for SparsityScaling
Auto Trait Implementations§
impl Freeze for SparsityScaling
impl RefUnwindSafe for SparsityScaling
impl Send for SparsityScaling
impl Sync for SparsityScaling
impl Unpin for SparsityScaling
impl UnwindSafe for SparsityScaling
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> 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>
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