MCPcopy Create free account
hub / github.com/SingleRust/SingleRust / convert_to_array_f64_csc

Function convert_to_array_f64_csc

src/shared/mod.rs:335–346  ·  view source on GitHub ↗
(
    csc: &CscMatrix<T>,
    shape: Shape,
)

Source from the content-addressed store, hash-verified

333}
334
335fn convert_to_array_f64_csc<T: NumericOps>(
336 csc: &CscMatrix<T>,
337 shape: Shape,
338) -> anyhow::Result<Array2<f64>> {
339 let mut dense = Array2::<f64>::zeros((shape[0], shape[1]));
340 for (col, vec) in csc.col_iter().enumerate() {
341 for (&row, val) in vec.row_indices().iter().zip(csc.values()) {
342 dense[[row, col]] = NumCast::from(*val).unwrap();
343 }
344 }
345 Ok(dense)
346}
347
348fn convert_to_array_f64_csr<T: NumericOps>(
349 csr: &CsrMatrix<T>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected