pub struct MatrixShape<const ROWS: usize, const COLS: usize>;Expand description
Matrix shape marker for compile-time verification
Implementations§
Source§impl<const ROWS: usize, const COLS: usize> MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> MatrixShape<ROWS, COLS>
Sourcepub const fn total_elements() -> usize
pub const fn total_elements() -> usize
Get the total number of elements
Sourcepub const fn matmul_compatible<const OTHER_COLS: usize>(
_other: MatrixShape<COLS, OTHER_COLS>,
) -> bool
pub const fn matmul_compatible<const OTHER_COLS: usize>( _other: MatrixShape<COLS, OTHER_COLS>, ) -> bool
Check if shapes are compatible for matrix multiplication
Trait Implementations§
Source§impl<const ROWS: usize, const COLS: usize> Clone for MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> Clone for MatrixShape<ROWS, COLS>
Source§fn clone(&self) -> MatrixShape<ROWS, COLS>
fn clone(&self) -> MatrixShape<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 moreimpl<const ROWS: usize, const COLS: usize> Copy for MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> Eq for MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> StructuralPartialEq for MatrixShape<ROWS, COLS>
Auto Trait Implementations§
impl<const ROWS: usize, const COLS: usize> Freeze for MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> RefUnwindSafe for MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> Send for MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> Sync for MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> Unpin for MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> UnsafeUnpin for MatrixShape<ROWS, COLS>
impl<const ROWS: usize, const COLS: usize> UnwindSafe for MatrixShape<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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.