pub fn matrix_diagonal(mat: &[f64], d: usize) -> Vec<f64>
Extract the diagonal of a d×d matrix stored as a flat d*d slice.
d×d
d*d