Trait GenMat

Source
pub trait GenMat<T: BaseFloat, C: GenFloatVec<T>>:
    Sized
    + Zero
    + Add<Output = Self>
    + Sub<Output = Self>
    + Div<Output = Self>
    + Rem<Output = Self>
    + Neg<Output = Self>
    + Mul<T, Output = Self>
    + Index<usize, Output = C>
    + IndexMut<usize>
    + ApproxEq<BaseType = T> {
    type R: GenFloatVec<T>;
    type Transpose: GenMat<T, Self::R, R = C, Transpose = Self>;

    // Required methods
    fn transpose(&self) -> Self::Transpose;
    fn mul_c(&self, rhs: &Self) -> Self;
}
Expand description

Generic Matrix type.

Required Associated Types§

Source

type R: GenFloatVec<T>

Type of row vectors.

Source

type Transpose: GenMat<T, Self::R, R = C, Transpose = Self>

Type of transpose matrix.

Required Methods§

Source

fn transpose(&self) -> Self::Transpose

Returns the transpose matrix.

§Example
use glm::GenMat;    // bing the method into scope.

let m = glm::mat3x2(1., 2., 3., 4., 5., 6.);
let tm = glm::mat2x3(1., 3., 5., 2., 4., 6.);
assert_eq!(tm, m.transpose());
Source

fn mul_c(&self, rhs: &Self) -> Self

Component-wise multiplication.

§Example
use glm::GenMat;    // bing the method into scope.

let m1 = glm::mat2(1., 2., 3., 4.);
let m2 = glm::mat2(0., 0., -7., 0.5);
assert_eq!(m1.mul_c(&m2), glm::mat2(0., 0., -21., 2.));

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§