MCPcopy Create free account
hub / github.com/antgroup/vsag / CalDistanceById

Method CalDistanceById

src/algorithm/inner_index_interface.cpp:298–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298DatasetPtr
299InnerIndexInterface::CalDistanceById(const float* query, const int64_t* ids, int64_t count) const {
300 auto result = Dataset::Make();
301 result->Owner(true, allocator_);
302 auto* distances = static_cast<float*>(allocator_->Allocate(sizeof(float) * count));
303 result->Distances(distances);
304 for (int64_t i = 0; i < count; ++i) {
305 distances[i] = this->CalcDistanceById(query, ids[i]);
306 }
307 return result;
308}
309
310DatasetPtr
311InnerIndexInterface::CalDistanceById(const DatasetPtr& query,

Callers 1

analyze_quantizerMethod · 0.95

Calls 5

CalcDistanceByIdMethod · 0.95
debugFunction · 0.50
OwnerMethod · 0.45
AllocateMethod · 0.45
DistancesMethod · 0.45

Tested by

no test coverage detected