(
csr: &CsrMatrix<T>,
shape: Shape,
)
| 346 | } |
| 347 | |
| 348 | fn convert_to_array_f64_csr<T: NumericOps>( |
| 349 | csr: &CsrMatrix<T>, |
| 350 | shape: Shape, |
| 351 | ) -> anyhow::Result<Array2<f64>> { |
| 352 | let mut dense = Array2::<f64>::zeros((shape[0], shape[1])); |
| 353 | for (row, vec) in csr.row_iter().enumerate() { |
| 354 | for (&col, val) in vec.col_indices().iter().zip(csr.values()) { |
| 355 | dense[[row, col]] = NumCast::from(*val).unwrap(); |
| 356 | } |
| 357 | } |
| 358 | Ok(dense) |
| 359 | } |
| 360 | |
| 361 | fn convert_to_array_f64_csr_selected<T: NumericOps>( |
| 362 | csr: &CsrMatrix<T>, |
nothing calls this directly
no outgoing calls
no test coverage detected