pub struct Matrix<T> { /* private fields */ }
Expand description
Generic struct definition
Implementations§
Source§impl<T> Matrix<T>
impl<T> Matrix<T>
Sourcepub fn from_data(data: Vec<Vec<T>>) -> Self
pub fn from_data(data: Vec<Vec<T>>) -> Self
Create an NxM matrix given a 2d vector with elements of type T
Sourcepub fn from_constant(dimension: (u32, u32), constant: T) -> Self
pub fn from_constant(dimension: (u32, u32), constant: T) -> Self
Create an NxM matrix where every entry is populated with the value passed in the constant param
Sourcepub fn diagonal_from_constant(dimension: (u32, u32), constant: T) -> Self
pub fn diagonal_from_constant(dimension: (u32, u32), constant: T) -> Self
Create an NxM diagonal matrix with diagonal taking values from the supplied constant
Sourcepub fn default_diagonal(dimension: (u32, u32)) -> Self
pub fn default_diagonal(dimension: (u32, u32)) -> Self
Initialize a new NxM unit matrix, assuming T::default() is the unit for T.
Sourcepub fn default_from_dimension(dimension: (u32, u32)) -> Self
pub fn default_from_dimension(dimension: (u32, u32)) -> Self
Create an NxM matrix by dimension where every entry is populated with default values for T
Sourcepub fn default_from_rows_and_columns(rows: u32, columns: u32) -> Self
pub fn default_from_rows_and_columns(rows: u32, columns: u32) -> Self
Create an NxM matrix by row and column numbers where every entry is populated with default values for T
Trait Implementations§
impl<T> StructuralPartialEq for Matrix<T>
Auto Trait Implementations§
impl<T> Freeze for Matrix<T>
impl<T> RefUnwindSafe for Matrix<T>where
T: RefUnwindSafe,
impl<T> Send for Matrix<T>where
T: Send,
impl<T> Sync for Matrix<T>where
T: Sync,
impl<T> Unpin for Matrix<T>where
T: Unpin,
impl<T> UnwindSafe for Matrix<T>where
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