pub struct MatrixSketcher { /* private fields */ }Expand description
Matrix sketching for dimension reduction
Implementations§
Source§impl MatrixSketcher
impl MatrixSketcher
Sourcepub fn new(
original_dimension: usize,
sketch_dimension: usize,
seed: Option<u64>,
) -> Result<Self>
pub fn new( original_dimension: usize, sketch_dimension: usize, seed: Option<u64>, ) -> Result<Self>
Create new matrix sketcher
Sourcepub fn sketch_vector(&self, vector: &[Precision]) -> Result<Vec<Precision>>
pub fn sketch_vector(&self, vector: &[Precision]) -> Result<Vec<Precision>>
Sketch a vector (reduce dimension)
Sourcepub fn sketch_matrix(
&self,
matrix_rows: &[Vec<Precision>],
) -> Result<Vec<Vec<Precision>>>
pub fn sketch_matrix( &self, matrix_rows: &[Vec<Precision>], ) -> Result<Vec<Vec<Precision>>>
Sketch a matrix (reduce both dimensions)
Sourcepub fn compression_ratio(&self) -> Precision
pub fn compression_ratio(&self) -> Precision
Get compression ratio
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MatrixSketcher
impl RefUnwindSafe for MatrixSketcher
impl Send for MatrixSketcher
impl Sync for MatrixSketcher
impl Unpin for MatrixSketcher
impl UnsafeUnpin for MatrixSketcher
impl UnwindSafe for MatrixSketcher
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