(matrix: DMatrix<f64>)
| 331 | } |
| 332 | |
| 333 | fn matrix_to_vec(matrix: DMatrix<f64>) -> Vec<Vec<f64>> { |
| 334 | let mut rows = Vec::with_capacity(matrix.nrows()); |
| 335 | for i in 0..matrix.nrows() { |
| 336 | let mut row = Vec::with_capacity(matrix.ncols()); |
| 337 | for j in 0..matrix.ncols() { |
| 338 | row.push(matrix[(i, j)]); |
| 339 | } |
| 340 | rows.push(row); |
| 341 | } |
| 342 | rows |
| 343 | } |
| 344 | use nalgebra::DMatrix; |