(tile: &SparseTile)
| 137 | } |
| 138 | |
| 139 | fn index_rows(tile: &SparseTile) -> BTreeMap<Vec<CoordKey>, Vec<CellValue>> { |
| 140 | let mut out = BTreeMap::new(); |
| 141 | let n = tile.nnz() as usize; |
| 142 | for row in 0..n { |
| 143 | let coord: Vec<CoordValue> = tile |
| 144 | .dim_dicts |
| 145 | .iter() |
| 146 | .map(|d| d.values[d.indices[row] as usize].clone()) |
| 147 | .collect(); |
| 148 | let attrs: Vec<CellValue> = tile.attr_cols.iter().map(|col| col[row].clone()).collect(); |
| 149 | out.insert(encode_key(&coord), attrs); |
| 150 | } |
| 151 | out |
| 152 | } |
| 153 | |
| 154 | #[cfg(test)] |
| 155 | mod tests { |
no test coverage detected