MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / rechunk_preserves_total_cells

Function rechunk_preserves_total_cells

nodedb-array/src/query/rechunk.rs:129–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127
128 #[test]
129 fn rechunk_preserves_total_cells() {
130 let src = schema(vec![16, 16]);
131 let dst = schema(vec![4, 4]);
132 let mut b = SparseTileBuilder::new(&src);
133 for i in 0..8i64 {
134 b.push(
135 &[CoordValue::Int64(i), CoordValue::Int64(i)],
136 &[CellValue::Int64(i)],
137 )
138 .unwrap();
139 }
140 let big = b.build();
141 let out = rechunk_sparse(&dst, &big).unwrap();
142 let total: u32 = out.iter().map(|(_, t)| t.nnz()).sum();
143 assert_eq!(total, 8);
144 }
145}

Callers

nothing calls this directly

Calls 7

rechunk_sparseFunction · 0.85
sumMethod · 0.80
schemaFunction · 0.70
pushMethod · 0.45
buildMethod · 0.45
iterMethod · 0.45
nnzMethod · 0.45

Tested by

no test coverage detected