macro_rules! tensor {
($name:ident: $dim:literal) => { ... };
($name:ident: row $dim:literal) => { ... };
($name:ident: $dim1:literal x $dim2:literal) => { ... };
($name:ident: $($dim:literal)x+ ) => { ... };
}
Expand description
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)]
#[macro_use]
use tensor_macros::*;
use tensor_macros::traits::*;
tensor!(M23: 2 x 3);
assert_eq!(M23::<f64>::dims(), vec!(2, 3));
let m23: M23<f64> = Default::default();
assert_eq!(m23.get_dims(), vec!(2, 3));