Function flatten_matrix

Source
pub fn flatten_matrix(matrix: &DMatrix<f64>) -> Vec<f64>
Expand description

Flatten a DMatrix into a 1D vector considering columns as the primary dimension.

use elm::{flatten_matrix, ToMatrix};

let a: Vec<Vec<f64>> = vec![vec![0.0, 1.0], vec![2.0, 3.0]];
assert_eq!(flatten_matrix(&a.to_matrix()), vec![0.0, 2.0, 1.0, 3.0]);