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: usize
Implementations§
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§
Auto Trait Implementations§
impl<'a, T> Freeze for Matrix<'a, T>
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
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