Macro numb_rs::symmat [−][src]
macro_rules! symmat {
($($($item : expr), +) ; +) => { ... };
($val : expr => $n : expr) => { ... };
}
Expand description
Creates a symmetrical matrix Note that the symmetrical matrix is of type MatrixS, The aim of this macro and associated struct is for saving space
example:
let a = symmat![
0;
1, 2;
3, 4, 5
];
assert_eq!(a[[1, 2]], a[[2, 1]]);
// equivalent to:
let b = mat![
0, 1, 3;
1, 2, 4;
3, 4, 5
];
assert_eq!(a, b);