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

Function rechunk_splits_into_smaller_tiles

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

Source from the content-addressed store, hash-verified

104
105 #[test]
106 fn rechunk_splits_into_smaller_tiles() {
107 let src = schema(vec![100, 100]);
108 let dst = schema(vec![10, 10]);
109 let mut b = SparseTileBuilder::new(&src);
110 b.push(
111 &[CoordValue::Int64(5), CoordValue::Int64(5)],
112 &[CellValue::Int64(1)],
113 )
114 .unwrap();
115 b.push(
116 &[CoordValue::Int64(50), CoordValue::Int64(50)],
117 &[CellValue::Int64(2)],
118 )
119 .unwrap();
120 let big = b.build();
121 let out = rechunk_sparse(&dst, &big).unwrap();
122 assert_eq!(out.len(), 2);
123 for (_, t) in &out {
124 assert_eq!(t.nnz(), 1);
125 }
126 }
127
128 #[test]
129 fn rechunk_preserves_total_cells() {

Callers

nothing calls this directly

Calls 4

rechunk_sparseFunction · 0.85
schemaFunction · 0.70
pushMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected