Struct Matrix

Source
#[repr(C)]
pub struct Matrix<const M: usize, const N: usize, T = f32> { /* private fields */ }
Expand description

Represents a matrix with constant M rows and constant N columns.

The underlying data is represented as an array and is always stored in column-major order.

See the crate root for usage examples.

Implementations§

Source§

impl<const D: usize, T> Matrix<D, D, T>
where T: Abs + PartialOrd + Copy + Zero + One + Sum + Add<Output = T> + Neg<Output = T> + Mul<Output = T> + Sub<Output = T> + Div<Output = T>,

Source

pub fn inv(&self) -> Option<Self>

Source

pub fn det(&self) -> T

Source

pub fn lu(&self) -> (Matrix<D, D, T>, Matrix<D, D, T>, Matrix<D, D, T>)

Source§

impl<const M: usize, const N: usize, T> Matrix<M, N, T>

Source

pub fn as_slice(&self) -> &[T]

Views the underlying data as a contiguous slice.

Source

pub fn as_mut_slice(&mut self) -> &mut [T]

Views the underlying data as a contiguous mutable slice.

Source

pub fn row(&self, i: usize) -> &Row<M, N, T>

Returns a reference to the i-th row of this matrix.

Source

pub fn row_mut(&mut self, i: usize) -> &mut Row<M, N, T>

Returns a mutable reference to the i-th row of this matrix.

Source

pub fn column(&self, i: usize) -> &Column<M, N, T>

Returns a reference to the i-th column of this matrix.

Source

pub fn column_mut(&mut self, i: usize) -> &mut Column<M, N, T>

Returns a mutable reference to the i-th column of this matrix.

Source

pub fn get<I>(&self, i: I) -> Option<&I::Output>
where I: MatrixIndex<Self>,

Returns a reference to an element in the matrix or None if out of bounds.

Source

pub fn get_mut<I>(&mut self, i: I) -> Option<&mut I::Output>
where I: MatrixIndex<Self>,

Returns a mutable reference to an element in the matrix or None if out of bounds.

Source

pub unsafe fn get_unchecked<I>(&self, i: I) -> &I::Output
where I: MatrixIndex<Self>,

Returns a reference to an element in the matrix without doing any bounds checking.

§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.

Source

pub unsafe fn get_unchecked_mut<I>(&mut self, i: I) -> &mut I::Output
where I: MatrixIndex<Self>,

Returns a mutable reference to an element in the matrix without doing any bounds checking.

§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.

Source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the underlying data.

Source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator over the underlying data.

Source

pub fn swap_rows(&mut self, r1: usize, r2: usize)
where T: Copy,

Swap the two given rows of this matrix

Source

pub fn swap_columns(&mut self, c1: usize, c2: usize)
where T: Copy,

Swap the two given columns of this matrix

Source

pub fn transpose(&self) -> Matrix<N, M, T>
where T: Clone,

Transpose of the current matrix.

Source

pub fn T(&self) -> Matrix<N, M, T>
where T: Clone,

Transpose of the current matrix.

Source

pub fn norm(&self) -> T
where T: Copy + Zero + Abs + Sqrt + Add<Output = T> + Mul<Output = T>,

Compute the Frobenius norm

Source

pub fn normalize(self) -> Self
where T: Copy + Zero + Abs + Sqrt + Add<Output = T> + Mul<Output = T> + Div<Output = T>,

Compute the Frobenius norm

Source§

impl<const N: usize, T> Matrix<N, N, T>

Source

pub fn trace(&self) -> T
where T: Zero, for<'a> &'a T: Add<&'a T, Output = T>,

Compute the sum of diagonal elements

Source§

impl<T> Matrix<3, 1, T>

Source

pub fn cross(&self, other: &Self) -> Self
where for<'a> &'a T: Mul<&'a T, Output = T> + Sub<&'a T, Output = T>,

Trait Implementations§

Source§

impl<const M: usize, const N: usize, T: AbsDiffEq> AbsDiffEq for Matrix<M, N, T>
where T::Epsilon: Copy,

Source§

type Epsilon = <T as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
Source§

fn default_epsilon() -> Self::Epsilon

The default tolerance to use when testing values that are close together. Read more
Source§

fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
Source§

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
Source§

impl<T, const M: usize, const N: usize> Add<&Matrix<M, N, T>> for &Matrix<M, N, T>
where T: Copy + Zero + Add<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &Matrix<M, N, T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, const M: usize, const N: usize> Add<&Matrix<M, N, T>> for Matrix<M, N, T>
where T: Copy + Add<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &Matrix<M, N, T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, const M: usize, const N: usize> Add<&T> for &Matrix<M, N, T>
where T: Copy + Zero + Add<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &T) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, const M: usize, const N: usize> Add<&T> for Matrix<M, N, T>
where T: Copy + Add<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &T) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, const M: usize, const N: usize> Add<Matrix<M, N, T>> for &Matrix<M, N, T>
where T: Copy + Zero + Add<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the + operator.
Source§

fn add(self, other: Matrix<M, N, T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, const M: usize, const N: usize> Add<T> for &Matrix<M, N, T>
where T: Copy + Zero + Add<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the + operator.
Source§

fn add(self, other: T) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, const M: usize, const N: usize> Add<T> for Matrix<M, N, T>
where T: Copy + Add<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the + operator.
Source§

fn add(self, other: T) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, const M: usize, const N: usize> Add for Matrix<M, N, T>
where T: Copy + Add<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the + operator.
Source§

fn add(self, other: Matrix<M, N, T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, const M: usize, const N: usize> AddAssign<&Matrix<M, N, T>> for Matrix<M, N, T>
where T: Copy + AddAssign,

Source§

fn add_assign(&mut self, other: &Matrix<M, N, T>)

Performs the += operation. Read more
Source§

impl<T, const M: usize, const N: usize> AddAssign<&T> for Matrix<M, N, T>
where T: Copy + AddAssign<T>,

Source§

fn add_assign(&mut self, other: &T)

Performs the += operation. Read more
Source§

impl<'a, T, const M: usize, const N: usize> AddAssign<T> for Matrix<M, N, T>
where T: Copy + AddAssign<T>,

Source§

fn add_assign(&mut self, other: T)

Performs the += operation. Read more
Source§

impl<T, const M: usize, const N: usize> AddAssign for Matrix<M, N, T>
where T: Copy + AddAssign,

Source§

fn add_assign(&mut self, other: Matrix<M, N, T>)

Performs the += operation. Read more
Source§

impl<const M: usize, const N: usize, T: Clone> Clone for Matrix<M, N, T>

Source§

fn clone(&self) -> Matrix<M, N, T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, const M: usize, const N: usize> Debug for Matrix<M, N, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Display, const M: usize, const N: usize> Display for Matrix<M, N, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T, const M: usize, const N: usize> Div<&T> for &Matrix<M, N, T>
where T: Copy + Zero + Div<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the / operator.
Source§

fn div(self, other: &T) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, const M: usize, const N: usize> Div<&T> for Matrix<M, N, T>
where T: Copy + Div<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the / operator.
Source§

fn div(self, other: &T) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, const M: usize, const N: usize> Div<T> for &Matrix<M, N, T>
where T: Copy + Zero + Div<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the / operator.
Source§

fn div(self, other: T) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, const M: usize, const N: usize> Div<T> for Matrix<M, N, T>
where T: Copy + Div<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the / operator.
Source§

fn div(self, other: T) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, const M: usize, const N: usize> DivAssign<&T> for Matrix<M, N, T>
where T: Copy + DivAssign<T>,

Source§

fn div_assign(&mut self, other: &T)

Performs the /= operation. Read more
Source§

impl<'a, T, const M: usize, const N: usize> DivAssign<T> for Matrix<M, N, T>
where T: Copy + DivAssign<T>,

Source§

fn div_assign(&mut self, other: T)

Performs the /= operation. Read more
Source§

impl<T: Copy> From<(T, T, T)> for Matrix<1, 3, T>

Source§

fn from(src: (T, T, T)) -> Self

Converts to this type from the input type.
Source§

impl<T: Copy> From<(T, T, T)> for Matrix<3, 1, T>

Source§

fn from(src: (T, T, T)) -> Self

Converts to this type from the input type.
Source§

impl<T: Copy> From<(T, T, T, T)> for Matrix<1, 4, T>

Source§

fn from(src: (T, T, T, T)) -> Self

Converts to this type from the input type.
Source§

impl<T: Copy> From<(T, T, T, T)> for Matrix<4, 1, T>

Source§

fn from(src: (T, T, T, T)) -> Self

Converts to this type from the input type.
Source§

impl<T: Copy> From<Matrix<1, 3, T>> for (T, T, T)

Source§

fn from(src: Matrix<1, 3, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Copy> From<Matrix<1, 4, T>> for (T, T, T, T)

Source§

fn from(src: Matrix<1, 4, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Copy> From<Matrix<3, 1, T>> for (T, T, T)

Source§

fn from(src: Matrix<3, 1, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Copy> From<Matrix<4, 1, T>> for (T, T, T, T)

Source§

fn from(src: Matrix<4, 1, T>) -> Self

Converts to this type from the input type.
Source§

impl<T, const M: usize, const N: usize> FromIterator<T> for Matrix<M, N, T>

Source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = T>,

Create a new matrix from an iterator.

Elements will be filled in column-major order.

§Panics

If the iterator doesn’t yield enough elements to fill the matrix.

Source§

impl<const M: usize, const N: usize, T: Hash> Hash for Matrix<M, N, T>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T, I, const M: usize, const N: usize> Index<I> for Matrix<M, N, T>
where I: MatrixIndex<Self>,

Source§

type Output = <I as MatrixIndex<Matrix<M, N, T>>>::Output

The returned type after indexing.
Source§

fn index(&self, index: I) -> &I::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T, I, const M: usize, const N: usize> IndexMut<I> for Matrix<M, N, T>
where I: MatrixIndex<Self>,

Source§

fn index_mut(&mut self, index: I) -> &mut I::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T, const M: usize, const N: usize> MatrixIndex<Matrix<M, N, T>> for (usize, usize)

Source§

type Output = T

The output type returned by methods.
Source§

fn get(self, matrix: &Matrix<M, N, T>) -> Option<&Self::Output>

Returns a shared reference to the output at this location, if in bounds.
Source§

fn get_mut(self, matrix: &mut Matrix<M, N, T>) -> Option<&mut Self::Output>

Returns a mutable reference to the output at this location, if in bounds.
Source§

unsafe fn get_unchecked( self, matrix: *const Matrix<M, N, T>, ) -> *const Self::Output

Returns a shared reference to the output at this location, without performing any bounds checking. Read more
Source§

unsafe fn get_unchecked_mut( self, matrix: *mut Matrix<M, N, T>, ) -> *mut Self::Output

Returns a mutable reference to the output at this location, without performing any bounds checking. Read more
Source§

fn index(self, matrix: &Matrix<M, N, T>) -> &Self::Output

Returns a shared reference to the output at this location, panicking if out of bounds.
Source§

fn index_mut(self, matrix: &mut Matrix<M, N, T>) -> &mut Self::Output

Returns a mutable reference to the output at this location, panicking if out of bounds.
Source§

impl<T, const M: usize, const N: usize> MatrixIndex<Matrix<M, N, T>> for usize

Source§

type Output = T

The output type returned by methods.
Source§

fn get(self, matrix: &Matrix<M, N, T>) -> Option<&Self::Output>

Returns a shared reference to the output at this location, if in bounds.
Source§

fn get_mut(self, matrix: &mut Matrix<M, N, T>) -> Option<&mut Self::Output>

Returns a mutable reference to the output at this location, if in bounds.
Source§

unsafe fn get_unchecked( self, matrix: *const Matrix<M, N, T>, ) -> *const Self::Output

Returns a shared reference to the output at this location, without performing any bounds checking. Read more
Source§

unsafe fn get_unchecked_mut( self, matrix: *mut Matrix<M, N, T>, ) -> *mut Self::Output

Returns a mutable reference to the output at this location, without performing any bounds checking. Read more
Source§

fn index(self, matrix: &Matrix<M, N, T>) -> &Self::Output

Returns a shared reference to the output at this location, panicking if out of bounds.
Source§

fn index_mut(self, matrix: &mut Matrix<M, N, T>) -> &mut Self::Output

Returns a mutable reference to the output at this location, panicking if out of bounds.
Source§

impl<T, const N: usize, const M: usize, const P: usize> Mul<&Matrix<N, P, T>> for &Matrix<M, N, T>
where T: Copy + Zero + Mul<Output = T> + Sum,

Source§

type Output = Matrix<M, P, T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Matrix<N, P, T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const N: usize, const M: usize, const P: usize> Mul<&Matrix<N, P, T>> for Matrix<M, N, T>
where T: Copy + Zero + Mul<Output = T> + Sum,

Source§

type Output = Matrix<M, P, T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Matrix<N, P, T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const M: usize, const N: usize> Mul<&T> for &Matrix<M, N, T>
where T: Copy + Zero + Mul<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &T) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const M: usize, const N: usize> Mul<&T> for Matrix<M, N, T>
where T: Copy + Mul<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &T) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const N: usize, const M: usize, const P: usize> Mul<Matrix<N, P, T>> for &Matrix<M, N, T>
where T: Copy + Zero + Mul<Output = T> + Sum,

Source§

type Output = Matrix<M, P, T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Matrix<N, P, T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const N: usize, const M: usize, const P: usize> Mul<Matrix<N, P, T>> for Matrix<M, N, T>
where T: Copy + Zero + Mul<Output = T> + Sum,

Source§

type Output = Matrix<M, P, T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Matrix<N, P, T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const M: usize, const N: usize> Mul<T> for &Matrix<M, N, T>
where T: Copy + Zero + Mul<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: T) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const M: usize, const N: usize> Mul<T> for Matrix<M, N, T>
where T: Copy + Mul<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: T) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, const M: usize, const N: usize> MulAssign<&T> for Matrix<M, N, T>
where T: Copy + MulAssign<T>,

Source§

fn mul_assign(&mut self, other: &T)

Performs the *= operation. Read more
Source§

impl<'a, T, const M: usize, const N: usize> MulAssign<T> for Matrix<M, N, T>
where T: Copy + MulAssign<T>,

Source§

fn mul_assign(&mut self, other: T)

Performs the *= operation. Read more
Source§

impl<T, const M: usize, const N: usize> Neg for &Matrix<M, N, T>
where T: Copy + Zero + Neg<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T, const M: usize, const N: usize> Neg for Matrix<M, N, T>
where T: Copy + Zero + Neg<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T, const M: usize, const N: usize> Not for &Matrix<M, N, T>
where T: Copy + Zero + Not<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<T, const M: usize, const N: usize> Not for Matrix<M, N, T>
where T: Copy + Zero + Not<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<const M: usize, const N: usize, T: Ord> Ord for Matrix<M, N, T>

Source§

fn cmp(&self, other: &Matrix<M, N, T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<const M: usize, const N: usize, T: PartialEq> PartialEq for Matrix<M, N, T>

Source§

fn eq(&self, other: &Matrix<M, N, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const M: usize, const N: usize, T: PartialOrd> PartialOrd for Matrix<M, N, T>

Source§

fn partial_cmp(&self, other: &Matrix<M, N, T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const M: usize, const N: usize, T: RelativeEq> RelativeEq for Matrix<M, N, T>
where T::Epsilon: Copy,

Source§

fn default_max_relative() -> Self::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
Source§

fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
Source§

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of RelativeEq::relative_eq.
Source§

impl<T, const M: usize, const N: usize> Rem<&T> for &Matrix<M, N, T>
where T: Copy + Zero + Rem<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &T) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, const M: usize, const N: usize> Rem<&T> for Matrix<M, N, T>
where T: Copy + Rem<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &T) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, const M: usize, const N: usize> Rem<T> for &Matrix<M, N, T>
where T: Copy + Zero + Rem<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: T) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, const M: usize, const N: usize> Rem<T> for Matrix<M, N, T>
where T: Copy + Rem<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: T) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, const M: usize, const N: usize> RemAssign<&T> for Matrix<M, N, T>
where T: Copy + RemAssign<T>,

Source§

fn rem_assign(&mut self, other: &T)

Performs the %= operation. Read more
Source§

impl<'a, T, const M: usize, const N: usize> RemAssign<T> for Matrix<M, N, T>
where T: Copy + RemAssign<T>,

Source§

fn rem_assign(&mut self, other: T)

Performs the %= operation. Read more
Source§

impl<T, const M: usize, const N: usize> Sub<&Matrix<M, N, T>> for &Matrix<M, N, T>
where T: Copy + Zero + Sub<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Matrix<M, N, T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, const M: usize, const N: usize> Sub<&Matrix<M, N, T>> for Matrix<M, N, T>
where T: Copy + Sub<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Matrix<M, N, T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, const M: usize, const N: usize> Sub<&T> for &Matrix<M, N, T>
where T: Copy + Zero + Sub<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &T) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, const M: usize, const N: usize> Sub<&T> for Matrix<M, N, T>
where T: Copy + Sub<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &T) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, const M: usize, const N: usize> Sub<Matrix<M, N, T>> for &Matrix<M, N, T>
where T: Copy + Zero + Sub<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Matrix<M, N, T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, const M: usize, const N: usize> Sub<T> for &Matrix<M, N, T>
where T: Copy + Zero + Sub<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: T) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, const M: usize, const N: usize> Sub<T> for Matrix<M, N, T>
where T: Copy + Sub<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: T) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, const M: usize, const N: usize> Sub for Matrix<M, N, T>
where T: Copy + Sub<Output = T>,

Source§

type Output = Matrix<M, N, T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Matrix<M, N, T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, const M: usize, const N: usize> SubAssign<&Matrix<M, N, T>> for Matrix<M, N, T>
where T: Copy + SubAssign,

Source§

fn sub_assign(&mut self, other: &Matrix<M, N, T>)

Performs the -= operation. Read more
Source§

impl<T, const M: usize, const N: usize> SubAssign<&T> for Matrix<M, N, T>
where T: Copy + SubAssign<T>,

Source§

fn sub_assign(&mut self, other: &T)

Performs the -= operation. Read more
Source§

impl<'a, T, const M: usize, const N: usize> SubAssign<T> for Matrix<M, N, T>
where T: Copy + SubAssign<T>,

Source§

fn sub_assign(&mut self, other: T)

Performs the -= operation. Read more
Source§

impl<T, const M: usize, const N: usize> SubAssign for Matrix<M, N, T>
where T: Copy + SubAssign,

Source§

fn sub_assign(&mut self, other: Matrix<M, N, T>)

Performs the -= operation. Read more
Source§

impl<const M: usize, const N: usize, T: Copy> Copy for Matrix<M, N, T>

Source§

impl<const M: usize, const N: usize, T: Eq> Eq for Matrix<M, N, T>

Source§

impl<const M: usize, const N: usize, T> StructuralPartialEq for Matrix<M, N, T>

Auto Trait Implementations§

§

impl<const M: usize, const N: usize, T> Freeze for Matrix<M, N, T>
where T: Freeze,

§

impl<const M: usize, const N: usize, T> RefUnwindSafe for Matrix<M, N, T>
where T: RefUnwindSafe,

§

impl<const M: usize, const N: usize, T> Send for Matrix<M, N, T>
where T: Send,

§

impl<const M: usize, const N: usize, T> Sync for Matrix<M, N, T>
where T: Sync,

§

impl<const M: usize, const N: usize, T> Unpin for Matrix<M, N, T>
where T: Unpin,

§

impl<const M: usize, const N: usize, T> UnwindSafe for Matrix<M, N, T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,