pub struct Matrix<'a, T> {
pub data: &'a [T],
pub index: Vec<usize>,
pub rows: usize,
pub cols: usize,
/* private fields */
}Expand description
Contigious Column major matrix data container. This is used throughout the crate, to house both the user provided data as well as the binned data.
Fields
data: &'a [T]index: Vec<usize>rows: usizecols: usizeImplementations
sourceimpl<'a, T> Matrix<'a, T>
impl<'a, T> Matrix<'a, T>
pub fn new(data: &'a [T], rows: usize, cols: usize) -> Self
sourcepub fn get(&self, i: usize, j: usize) -> &T
pub fn get(&self, i: usize, j: usize) -> &T
Get a single reference to an item in the matrix.
i- The ith row of the data to get.j- the jth column of the data to get.
sourcepub fn get_col_slice(&self, col: usize, start_row: usize, end_row: usize) -> &[T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn get_col_slice(&self, col: usize, start_row: usize, end_row: usize) -> &[T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Get a slice of a column in the matrix.
col- The index of the column to select.start_row- The index of the start of the slice.end_row- The index of the end of the slice of the column to select.
Trait Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Matrix<'a, T> where
T: RefUnwindSafe,
impl<'a, T> Send for Matrix<'a, T> where
T: Sync,
impl<'a, T> Sync for Matrix<'a, T> where
T: Sync,
impl<'a, T> Unpin for Matrix<'a, T>
impl<'a, T> UnwindSafe for Matrix<'a, T> where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more