[][src]Macro mkv_chain::matrix

macro_rules! matrix {
    ($(#[$outer:meta])* $name:ident[$row:literal,$col:literal], $inner:ident) => { ... };
}

Generate code for a quare matrix with name, order and inner type

Example:

extern crate mkv_chain;
use mkv_chain::{vector, matrix};

vector!(MyVec3, 3); // vector!(name, order)
matrix!(MyMatrix3[3, 3], MyVec3); // matrix!(name[order], inner_type)

fn main() {
   let mat3 = MyMatrix3::new(
       [[1.0, 0.0, 0.0],
        [0.0, 1.0, 0.0],
        [0.0, 0.0, 1.0]]
   );
   let vec3 = MyVec3::new([1.0, 2.0, 3.0]);
   assert_eq!(mat3 * vec3, vec3);
}