Struct libmat::mat::SMatrix [−]
Expand description
Statically sized matrix.
SMatrix is used almost just like Matrix, but its size is known at compile-time,
so operations can be done without the &
operator. The size of this matrix cannot be changed.
Example
let mut mat_a: SMatrix<i32, 3, 3> = SMatrix::one(); mat_a = mat_a * 2; mat_a[1] = [1,2,3]; assert_eq!(mat_a, smatrix!{{2,0,0},{1,2,3},{0,0,2}});
Implementations
Methods for matrices with general dimensions.
Creates new Matrix
Example
let mut mat_a: SMatrix<i32, 3, 3> = SMatrix::new(1_i32); mat_a[1] = [1, 2, 3]; assert_eq!(mat_a[1], [1, 2, 3]); assert_eq!(mat_a[1][1], 2); let mat_b = smatrix!{1, 1, 1; 1, 1, 1; 1, 1, 1;}; let mat_c: SMatrix<u32, 3, 3> = SMatrix::new(1); assert_eq!(mat_b, mat_c);
Creates a diagonal matrix with every diagonal entry havong the value of init
.
Trait Implementations
fn add_assign(&mut self, rhs: SMatrix<T, M, N>)
fn add_assign(&mut self, rhs: SMatrix<T, M, N>)
Performs the +=
operation. Read more
fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the /=
operation. Read more
fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the *=
operation. Read more
fn sub_assign(&mut self, rhs: SMatrix<T, M, N>)
fn sub_assign(&mut self, rhs: SMatrix<T, M, N>)
Performs the -=
operation. Read more
impl<T, const M: usize, const N: usize> StructuralPartialEq for SMatrix<T, M, N>
Auto Trait Implementations
impl<T, const M: usize, const N: usize> RefUnwindSafe for SMatrix<T, M, N> where
T: RefUnwindSafe,
impl<T, const M: usize, const N: usize> UnwindSafe for SMatrix<T, M, N> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more