MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / group_by_cell

Function group_by_cell

tiledb/sm/cpp_api/utils.h:91–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 */
90template <typename T, typename E = typename std::vector<T>>
91std::vector<E> group_by_cell(
92 const std::vector<uint64_t>& offsets,
93 const std::vector<T>& data,
94 uint64_t num_offsets,
95 uint64_t num_data) {
96 std::vector<E> ret;
97 ret.reserve(num_offsets);
98 for (unsigned i = 0; i < num_offsets; ++i) {
99 ret.emplace_back(
100 data.begin() + (offsets[i] / sizeof(T)),
101 (i == num_offsets - 1) ? data.begin() + num_data :
102 data.begin() + (offsets[i + 1] / sizeof(T)));
103 }
104 return ret;
105}
106
107/**
108 * Convert an (offset, data) vector pair into a single vector of vectors. Useful

Callers 1

Calls 5

reserveMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected