pub struct FormatConfig {
pub threshold: f32,
pub dense_threshold: f32,
pub block_size: (usize, usize),
pub enable_hybrid: bool,
pub analyze_patterns: bool,
}
Expand description
Format selection configuration for advanced users
Fields§
§threshold: f32
Threshold for considering elements as zero
dense_threshold: f32
Minimum density to consider a region as dense
block_size: (usize, usize)
Block size for block-based analysis
enable_hybrid: bool
Whether to enable hybrid format selection
analyze_patterns: bool
Whether to analyze sparsity patterns
Implementations§
Source§impl FormatConfig
impl FormatConfig
Sourcepub fn memory_optimized() -> Self
pub fn memory_optimized() -> Self
Create a configuration optimized for memory efficiency
Sourcepub fn performance_optimized() -> Self
pub fn performance_optimized() -> Self
Create a configuration optimized for computational performance
Sourcepub fn validate(&self) -> TorshResult<()>
pub fn validate(&self) -> TorshResult<()>
Validate the configuration parameters
Sourcepub fn with_threshold(self, threshold: f32) -> Self
pub fn with_threshold(self, threshold: f32) -> Self
Create a configuration with custom threshold
Sourcepub fn with_block_size(self, block_size: (usize, usize)) -> Self
pub fn with_block_size(self, block_size: (usize, usize)) -> Self
Create a configuration with custom block size
Sourcepub fn with_hybrid(self, enable: bool) -> Self
pub fn with_hybrid(self, enable: bool) -> Self
Enable or disable hybrid format selection
Trait Implementations§
Source§impl Clone for FormatConfig
impl Clone for FormatConfig
Source§fn clone(&self) -> FormatConfig
fn clone(&self) -> FormatConfig
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 FormatConfig
impl Debug for FormatConfig
Auto Trait Implementations§
impl Freeze for FormatConfig
impl RefUnwindSafe for FormatConfig
impl Send for FormatConfig
impl Sync for FormatConfig
impl Unpin for FormatConfig
impl UnwindSafe for FormatConfig
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