pub struct AdaptiveMemoryCompressor { /* private fields */ }
Expand description
Adaptive memory compression manager
Implementations§
Source§impl AdaptiveMemoryCompressor
impl AdaptiveMemoryCompressor
Sourcepub fn new(config: AdaptiveCompressionConfig) -> SparseResult<Self>
pub fn new(config: AdaptiveCompressionConfig) -> SparseResult<Self>
Create a new adaptive memory compressor
Sourcepub fn compress_matrix<T>(
&mut self,
matrix_id: u64,
rows: usize,
indptr: &[usize],
indices: &[usize],
data: &[T],
) -> SparseResult<CompressedMatrix<T>>
pub fn compress_matrix<T>( &mut self, matrix_id: u64, rows: usize, indptr: &[usize], indices: &[usize], data: &[T], ) -> SparseResult<CompressedMatrix<T>>
Compress sparse matrix data adaptively
Sourcepub fn decompress_matrix<T>(
&mut self,
compressed_matrix: &CompressedMatrix<T>,
) -> SparseResult<(Vec<usize>, Vec<usize>, Vec<T>)>
pub fn decompress_matrix<T>( &mut self, compressed_matrix: &CompressedMatrix<T>, ) -> SparseResult<(Vec<usize>, Vec<usize>, Vec<T>)>
Decompress matrix data
Sourcepub fn get_memory_stats(&self) -> MemoryStats
pub fn get_memory_stats(&self) -> MemoryStats
Get memory usage statistics
Sourcepub fn get_stats(&self) -> CompressionStats
pub fn get_stats(&self) -> CompressionStats
Get compression statistics
Sourcepub fn optimize_for_sequential_access(&mut self)
pub fn optimize_for_sequential_access(&mut self)
Optimize for sequential access patterns
Sourcepub fn optimize_for_random_access(&mut self)
pub fn optimize_for_random_access(&mut self)
Optimize for random access patterns
Sourcepub fn reset(&mut self) -> SparseResult<()>
pub fn reset(&mut self) -> SparseResult<()>
Clear cache and reset statistics
Auto Trait Implementations§
impl !Freeze for AdaptiveMemoryCompressor
impl RefUnwindSafe for AdaptiveMemoryCompressor
impl Send for AdaptiveMemoryCompressor
impl Sync for AdaptiveMemoryCompressor
impl Unpin for AdaptiveMemoryCompressor
impl UnwindSafe for AdaptiveMemoryCompressor
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