MCPcopy Create free account
hub / github.com/Open-Quant/openquant / submatrix

Function submatrix

crates/openquant/src/onc.rs:305–314  ·  view source on GitHub ↗
(m: &DMatrix<f64>, idx: &[usize])

Source from the content-addressed store, hash-verified

303}
304
305fn submatrix(m: &DMatrix<f64>, idx: &[usize]) -> DMatrix<f64> {
306 let n = idx.len();
307 let mut out = DMatrix::zeros(n, n);
308 for (i, &ri) in idx.iter().enumerate() {
309 for (j, &cj) in idx.iter().enumerate() {
310 out[(i, j)] = m[(ri, cj)];
311 }
312 }
313 out
314}
315
316fn corr_to_distance(corr: &DMatrix<f64>) -> DMatrix<f64> {
317 let n = corr.nrows();

Callers 4

cluster_kmeans_topFunction · 0.85
improve_clustersFunction · 0.85
cluster_kmeans_baseFunction · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected