pub enum CompressedMatrix {
Dense(Array2<f64>),
Sparse(Vec<(usize, usize, f64)>, (usize, usize)),
Quantized(Array2<f64>, u8),
BlockCompressed(Vec<Array2<f64>>, (usize, usize), usize),
}Expand description
Compressed matrix representation
Variants§
Dense(Array2<f64>)
Sparse(Vec<(usize, usize, f64)>, (usize, usize))
Quantized(Array2<f64>, u8)
BlockCompressed(Vec<Array2<f64>>, (usize, usize), usize)
Implementations§
Source§impl CompressedMatrix
impl CompressedMatrix
pub fn from_dense(matrix: &Array2<f64>) -> Self
pub fn sparse(data: Vec<(usize, usize, f64)>, shape: (usize, usize)) -> Self
pub fn quantized(matrix: &Array2<f64>, bits: u8) -> Self
pub fn block_compressed(matrix: &Array2<f64>, block_size: usize) -> Self
pub fn compressed_size(&self) -> usize
pub fn decompress(&self) -> SklearsResult<Array2<f64>>
Trait Implementations§
Source§impl Clone for CompressedMatrix
impl Clone for CompressedMatrix
Auto Trait Implementations§
impl Freeze for CompressedMatrix
impl RefUnwindSafe for CompressedMatrix
impl Send for CompressedMatrix
impl Sync for CompressedMatrix
impl Unpin for CompressedMatrix
impl UnsafeUnpin for CompressedMatrix
impl UnwindSafe for CompressedMatrix
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> 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