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

Function RandomData

tests/core/algorithm/flat/flat_builder_test.cc:362–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360 "Fp32Quantizer", "Fp16Quantizer", "Int8Quantizer", "Int4Quantizer"};
361
362static std::vector<std::vector<float>> RandomData(size_t count, size_t dim) {
363 std::mt19937 gen(2026);
364 std::uniform_real_distribution<float> dist(-1.0f, 1.0f);
365 std::vector<std::vector<float>> data(count);
366 for (auto &vec : data) {
367 vec.resize(dim);
368 for (auto &v : vec) {
369 v = dist(gen);
370 }
371 }
372 return data;
373}
374
375static void BuildIndex(const IndexMeta &meta, IndexHolder::Pointer holder,
376 const std::string &path) {

Callers 1

TEST_FFunction · 0.85

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected