MCPcopy Create free account
hub / github.com/alibaba/zvec / get_sparse_data

Method get_sparse_data

tools/core/vecs_reader.h:323–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321 }
322
323 const void *get_sparse_data(size_t index) const {
324 auto sparse_data_meta = sparse_base_meta_ + index * sizeof(uint64_t);
325 uint64_t sparse_offset = *((uint64_t *)sparse_data_meta);
326 uint32_t sparse_count = *((uint32_t *)(sparse_base_data_ + sparse_offset));
327 void *sparse_data =
328 (uint32_t *)(sparse_base_data_ + sparse_offset + sizeof(uint32_t) +
329 sparse_count * sizeof(uint32_t));
330
331 return sparse_data;
332 }
333
334 size_t get_total_sparse_count() const {
335 size_t total_sparse_count = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected