Macro mathru::matrix

source ·
macro_rules! matrix {
    ($( $( $x: expr ),*);*) => { ... };
}
Expand description

Macro to construct matrices

use mathru::{matrix,
algebra::linear::matrix::General
};

// Construct a 2x3 matrix of f32
let mat: General<f32> = matrix![1.0, 2.0, 3.0; 4.0, 5.0, 6.0];
let (m, n) = mat.dim();

assert_eq!(m, 2);
assert_eq!(n, 3);