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: usize§cols: usizeImplementations§
source§impl<'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_row_iter(&self, row: usize) -> StepBy<Skip<Iter<'_, T>>>
pub fn get_row_iter(&self, row: usize) -> StepBy<Skip<Iter<'_, T>>>
Get access to a row of the data, as an iterator.
Trait Implementations§
source§impl<'a, T> Display for Matrix<'a, T>where
T: FromStr + Display,
<T as FromStr>::Err: 'static + Error,
impl<'a, T> Display for Matrix<'a, T>where T: FromStr + Display, <T as FromStr>::Err: 'static + Error,
A lightweight row major matrix, this is primarily for returning data to the user, it is especially suited for appending rows to, such as when building up a matrix of contributions to return to the user, the added benefit is it will be even faster to return to numpy.
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§
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