Trait glm::GenMat [] [src]

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>;
    fn transpose(&self) -> Self::Transpose;
    fn mul_c(&self, rhs: &Self) -> Self;
}

Generic Matrix type.

Associated Types

Type of row vectors.

Type of transpose matrix.

Required Methods

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());

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.));

Implementors