Struct static_math::matrix4x4::M44[][src]

pub struct M44<T>(_);
Expand description

A static Matrix of 4x4 shape

Implementations

impl<T> M44<T>[src]

pub fn new(data_input: [[T; 4]; 4]) -> M44<T>[src]

pub fn rows(&self) -> usize[src]

pub fn cols(&self) -> usize[src]

impl<T: Num + Copy> M44<T>[src]

pub fn identity() -> M44<T>[src]

contruct identity matrix

pub fn zeros() -> M44<T>[src]

construct the matrix with all zeros

pub fn as_vec(&self) -> [T; 16][src]

transform the matrix to a flatten vector

pub fn new_from_vecs(cols: V4<V4<T>>) -> Self[src]

pub fn get_diagonal(&self) -> V4<T>[src]

get the diagonal of the matrix

pub fn get_submatrix(&self, selected: (usize, usize)) -> M33<T>[src]

pub fn get_rows(self) -> V4<V4<T>>[src]

pub fn get_cols(self) -> V4<V4<T>>[src]

pub fn get_upper_triagular(&self) -> [T; 6][src]

pub fn get_lower_triangular(&self) -> [T; 6][src]

pub fn for_each(&self, f: impl Fn(T) -> T) -> Self[src]

Applies f of each element in the M44

Methods from Deref<Target = [[T; 4]; 4]>

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

🔬 This is a nightly-only experimental API. (array_methods)

Returns a slice containing the entire array. Equivalent to &s[..].

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

🔬 This is a nightly-only experimental API. (array_methods)

Returns a mutable slice containing the entire array. Equivalent to &mut s[..].

pub fn each_ref(&self) -> [&T; N][src]

🔬 This is a nightly-only experimental API. (array_methods)

Borrows each element and returns an array of references with the same size as self.

Example

#![feature(array_methods)]

let floats = [3.1, 2.7, -1.0];
let float_refs: [&f64; 3] = floats.each_ref();
assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);

This method is particularly useful if combined with other methods, like map. This way, you can avoid moving the original array if its elements are not Copy.

#![feature(array_methods, array_map)]

let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
let is_ascii = strings.each_ref().map(|s| s.is_ascii());
assert_eq!(is_ascii, [true, false, true]);

// We can still access the original array: it has not been moved.
assert_eq!(strings.len(), 3);

pub fn each_mut(&mut self) -> [&mut T; N][src]

🔬 This is a nightly-only experimental API. (array_methods)

Borrows each element mutably and returns an array of mutable references with the same size as self.

Example

#![feature(array_methods)]

let mut floats = [3.1, 2.7, -1.0];
let float_refs: [&mut f64; 3] = floats.each_mut();
*float_refs[0] = 0.0;
assert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);
assert_eq!(floats, [0.0, 2.7, -1.0]);

Trait Implementations

impl<T: Num + Copy> Add<M44<T>> for M44<T>[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, rhs: Self) -> Self[src]

Performs the + operation. Read more

impl<T: Num + Copy> AddAssign<M44<T>> for M44<T>[src]

fn add_assign(&mut self, other: Self)[src]

Performs the += operation. Read more

impl<T: Clone> Clone for M44<T>[src]

fn clone(&self) -> M44<T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for M44<T>[src]

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

Formats the value using the given formatter. Read more

impl<T> Deref for M44<T>[src]

type Target = [[T; 4]; 4]

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl<T> DerefMut for M44<T>[src]

fn deref_mut(&mut self) -> &mut Self::Target[src]

Mutably dereferences the value.

impl<T: Num + Display> Display for M44<T>[src]

fn fmt(&self, dest: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<T: Num + Copy> Div<T> for M44<T>[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, rhs: T) -> Self::Output[src]

Performs the / operation. Read more

impl<T> From<[[T; 4]; 4]> for M44<T>[src]

fn from(data: [[T; 4]; 4]) -> M44<T>[src]

Performs the conversion.

impl<T> Index<(usize, usize)> for M44<T>[src]

type Output = T

The returned type after indexing.

fn index(&self, index: (usize, usize)) -> &T[src]

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

impl<T> IndexMut<(usize, usize)> for M44<T>[src]

fn index_mut(&mut self, index: (usize, usize)) -> &mut T[src]

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

impl<T: Float + Sum> LinearAlgebra<T> for M44<T>[src]

fn inverse(&self) -> Option<Self>[src]

Calculate the inverse

fn qr(&self) -> Option<(Self, Self)>[src]

Calculate de QR factorization of the M44 via gram-schmidt orthogonalization process

fn rows(&self) -> usize[src]

get the rows of the matrix

fn cols(&self) -> usize[src]

get the columns of the matrix

fn transpose(&self) -> M44<T>[src]

transpose dimentions of the matrix

fn trace(&self) -> T[src]

get the trace of the matrix

fn norm2(&self) -> T[src]

compute the euclidean norm of the matrix

fn det(&self) -> T[src]

compute the determinant of the matrix

fn shape(&self) -> (usize, usize)[src]

get the overal shape of the matrix

impl<T: Num + Copy> Mul<M44<T>> for M44<T>[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, rhs: Self) -> Self[src]

Performs the * operation. Read more

impl<T: Num + Copy> Mul<M44<T>> for V4<T>[src]

type Output = V4<T>

The resulting type after applying the * operator.

fn mul(self, rhs: M44<T>) -> V4<T>[src]

Performs the * operation. Read more

impl<T: Num + Copy> Mul<T> for M44<T>[src]

type Output = M44<T>

The resulting type after applying the * operator.

fn mul(self, rhs: T) -> M44<T>[src]

Performs the * operation. Read more

impl<T: Num + Copy> Mul<V4<T>> for M44<T>[src]

type Output = V4<T>

The resulting type after applying the * operator.

fn mul(self, rhs: V4<T>) -> V4<T>[src]

Performs the * operation. Read more

impl<T: Num + Copy + Signed> Neg for M44<T>[src]

type Output = Self

The resulting type after applying the - operator.

fn neg(self) -> Self[src]

Performs the unary - operation. Read more

impl<T: Num + Copy> One for M44<T>[src]

fn one() -> M44<T>[src]

Create an identity matrix

fn set_one(&mut self)[src]

Sets self to the multiplicative identity element of Self, 1.

fn is_one(&self) -> bool where
    Self: PartialEq<Self>, 
[src]

Returns true if self is equal to the multiplicative identity. Read more

impl<T: PartialEq> PartialEq<M44<T>> for M44<T>[src]

fn eq(&self, other: &M44<T>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &M44<T>) -> bool[src]

This method tests for !=.

impl<T: Num + Copy> Sub<M44<T>> for M44<T>[src]

type Output = Self

The resulting type after applying the - operator.

fn sub(self, rhs: Self) -> Self[src]

Performs the - operation. Read more

impl<T: Num + Copy> SubAssign<M44<T>> for M44<T>[src]

fn sub_assign(&mut self, other: Self)[src]

Performs the -= operation. Read more

impl<T: Num + Copy> Zero for M44<T>[src]

fn zero() -> M44<T>[src]

Returns the additive identity element of Self, 0. Read more

fn is_zero(&self) -> bool[src]

Returns true if self is equal to the additive identity.

fn set_zero(&mut self)[src]

Sets self to the additive identity element of Self, 0.

impl<T: Copy> Copy for M44<T>[src]

impl<T> StructuralPartialEq for M44<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for M44<T> where
    T: RefUnwindSafe

impl<T> Send for M44<T> where
    T: Send

impl<T> Sync for M44<T> where
    T: Sync

impl<T> Unpin for M44<T> where
    T: Unpin

impl<T> UnwindSafe for M44<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.