[][src]Macro tensor_macros::tensor

macro_rules! tensor {
    ($name:ident $dim:literal) => { ... };
    ($name:ident row $dim:literal) => { ... };
    ($name:ident $dim1:literal x $dim2:literal) => { ... };
    ($name:ident $($dim:literal)x+ ) => { ... };
}

Generates a tensor type

Generates a type with the given name and dimensions (space seperated) There's no upper limit on the amount of dimensions given Matricies and vectors have special properties assigned to them

Example

#![feature(try_from)]
use tensor_macros::*;
tensor!(M23 2 x 3);
let m23: M23<f64> = Default::default();
assert_eq!(m23.dims(), vec!(2, 3));