TMatrix

qm::m

Trait TMatrix 

Source
pub trait TMatrix<F: Float + Debug> {
Show 20 methods // Required methods fn col_major(m: &Vec<Vec<F>>) -> Self; fn row_major(m: &Vec<Vec<F>>) -> Self; fn new(m: &Vec<Vec<F>>) -> Self; fn identity() -> Self; fn prec_eq(&self, e: F, m: &impl TMatrix<F>) -> bool; fn dot_m(&self, m: &impl TMatrix<F>) -> Self; fn to_vec(&self) -> Vec<Vec<F>>; // Provided methods fn colmajor3(_m: Vec<Vector3<F>>) -> Self where Self: Sized { ... } fn rowmajor3(_m: Vec<Vector3<F>>) -> Self where Self: Sized { ... } fn colmajor4(_m: Vec<Vector4<F>>) -> Self where Self: Sized { ... } fn rowmajor4(_m: Vec<Vector4<F>>) -> Self where Self: Sized { ... } fn mev3(&self) -> &[Vector3<F>] { ... } fn mev4(&self) -> &[Vector4<F>] { ... } fn rowv3(&self, _j: usize) -> Vector3<F> { ... } fn colv3(&self, _i: usize) -> Vector3<F> { ... } fn rowv4(&self, _j: usize) -> Vector4<F> { ... } fn colv4(&self, _i: usize) -> Vector4<F> { ... } fn transpose(&self) -> Self where Self: Sized { ... } fn det(&self) -> F { ... } fn inv(&self, p: F) -> Option<Self> where Self: Sized { ... }
}
Expand description

TMatrix

Required Methods§

Source

fn col_major(m: &Vec<Vec<F>>) -> Self

constructor col major

Source

fn row_major(m: &Vec<Vec<F>>) -> Self

constructor row major

Source

fn new(m: &Vec<Vec<F>>) -> Self

constructor row major

Source

fn identity() -> Self

constructor

Source

fn prec_eq(&self, e: F, m: &impl TMatrix<F>) -> bool

check equal with precision

Source

fn dot_m(&self, m: &impl TMatrix<F>) -> Self

m dot self

Source

fn to_vec(&self) -> Vec<Vec<F>>

to_vec

Provided Methods§

Source

fn colmajor3(_m: Vec<Vector3<F>>) -> Self
where Self: Sized,

constructor col major from v3 (move)

Source

fn rowmajor3(_m: Vec<Vector3<F>>) -> Self
where Self: Sized,

constructor row major from v3 (move)

Source

fn colmajor4(_m: Vec<Vector4<F>>) -> Self
where Self: Sized,

constructor col major from v4 (move)

Source

fn rowmajor4(_m: Vec<Vector4<F>>) -> Self
where Self: Sized,

constructor row major from v4 (move)

Source

fn mev3(&self) -> &[Vector3<F>]

like as slice v3

Source

fn mev4(&self) -> &[Vector4<F>]

like as slice v4

Source

fn rowv3(&self, _j: usize) -> Vector3<F>

row to v3

Source

fn colv3(&self, _i: usize) -> Vector3<F>

col to v3

Source

fn rowv4(&self, _j: usize) -> Vector4<F>

row to v4

Source

fn colv4(&self, _i: usize) -> Vector4<F>

col to v4

Source

fn transpose(&self) -> Self
where Self: Sized,

transpose

Source

fn det(&self) -> F

det

Source

fn inv(&self, p: F) -> Option<Self>
where Self: Sized,

inv

  • p: prec (assume det = 0)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F: Float + Debug + Sum> TMatrix<F> for Matrix3<F>

TMatrix for Matrix3

Source§

impl<F: Float + Debug + Sum> TMatrix<F> for Matrix4<F>

TMatrix for Matrix4