pub struct TypeSafeMatrix<const ROWS: usize, const COLS: usize> { /* private fields */ }Expand description
Type-safe matrix with compile-time dimension checking
Implementations§
Source§impl<const ROWS: usize, const COLS: usize> TypeSafeMatrix<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> TypeSafeMatrix<ROWS, COLS>
Sourcepub fn new(data: Array2<Float>) -> Result<Self>
pub fn new(data: Array2<Float>) -> Result<Self>
Create a new type-safe matrix with compile-time dimension checking
Sourcepub fn eye() -> Self
pub fn eye() -> Self
Create an identity matrix (only valid for square matrices where ROWS == COLS)
Sourcepub fn dot<const OTHER_COLS: usize>(
&self,
other: &TypeSafeMatrix<COLS, OTHER_COLS>,
) -> TypeSafeMatrix<ROWS, OTHER_COLS>
pub fn dot<const OTHER_COLS: usize>( &self, other: &TypeSafeMatrix<COLS, OTHER_COLS>, ) -> TypeSafeMatrix<ROWS, OTHER_COLS>
Matrix multiplication with compile-time dimension checking
Sourcepub fn t(&self) -> TypeSafeMatrix<COLS, ROWS>
pub fn t(&self) -> TypeSafeMatrix<COLS, ROWS>
Transpose the matrix
Trait Implementations§
Source§impl<const ROWS: usize, const COLS: usize> Clone for TypeSafeMatrix<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> Clone for TypeSafeMatrix<ROWS, COLS>
Source§fn clone(&self) -> TypeSafeMatrix<ROWS, COLS>
fn clone(&self) -> TypeSafeMatrix<ROWS, COLS>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<const ROWS: usize, const COLS: usize> Freeze for TypeSafeMatrix<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> RefUnwindSafe for TypeSafeMatrix<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> Send for TypeSafeMatrix<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> Sync for TypeSafeMatrix<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> Unpin for TypeSafeMatrix<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> UnwindSafe for TypeSafeMatrix<ROWS, COLS>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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