pub struct Matrix<T> { /* private fields */ }Implementations§
Source§impl<T> Matrix<T>
impl<T> Matrix<T>
pub fn new(data: impl Into<Vec<T>>) -> Self
pub fn empty() -> Self
pub fn from_rows<I>(rows: I) -> Selfwhere
I: IntoIterator<Item = Vec<T>>,
pub fn rows(&self) -> usize
pub fn cols(&self) -> usize
pub fn data(&self) -> &[T]
pub fn is_empty(&self) -> bool
pub fn size(&self) -> usize
pub fn clear(&mut self)
pub fn iter(&self) -> impl Iterator<Item = &[T]>
pub fn row(&self, row: usize) -> &[T]
pub fn row_mut(&mut self, row: usize) -> &mut [T]
pub fn append_row(&mut self, row_data: Vec<T>)
pub fn reshape(self, new_rows: usize, new_cols: usize) -> Self
pub fn reshape_in_place(&mut self, new_rows: usize, new_cols: usize)
Source§impl<T: Clone> Matrix<T>
impl<T: Clone> Matrix<T>
pub fn append_column(&mut self, col_data: Vec<T>)
pub fn reshape_and_fill(&mut self, rows: usize, cols: usize, default_value: T)
pub fn sort_by_indices(&self, indices: &[usize]) -> Self
pub fn split_at_row(&self, row: usize) -> (Self, Self)
pub fn fill(&mut self, value: T)
pub fn transpose(&self) -> Self
Trait Implementations§
Source§impl<T> FromIterator<Vec<T>> for Matrix<T>
impl<T> FromIterator<Vec<T>> for Matrix<T>
Auto Trait Implementations§
impl<T> Freeze for Matrix<T>
impl<T> RefUnwindSafe for Matrix<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for Matrix<T>
impl<T> Sync for Matrix<T>
impl<T> Unpin for Matrix<T>
impl<T> UnsafeUnpin for Matrix<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for Matrix<T>where
Vec<T>: UnwindSafe,
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