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

Function BuildIndex

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

Source from the content-addressed store, hash-verified

373}
374
375static void BuildIndex(const IndexMeta &meta, IndexHolder::Pointer holder,
376 const std::string &path) {
377 auto builder = IndexFactory::CreateBuilder("FlatBuilder");
378 auto dumper = IndexFactory::CreateDumper("FileDumper");
379 ASSERT_NE(nullptr, builder);
380 ASSERT_NE(nullptr, dumper);
381
382 Params params;
383 ASSERT_EQ(0, builder->init(meta, params));
384 ASSERT_EQ(0, dumper->create(path));
385 ASSERT_EQ(0, IndexBuilder::TrainBuildAndDump(builder, holder, dumper));
386 ASSERT_EQ(0, dumper->close());
387}
388
389//! Create a quantizer and build a flat index with quantized datapoints
390static void BuildQuantizedIndex(const std::string &metric_name,

Callers 1

TEST_FFunction · 0.70

Calls 3

initMethod · 0.45
createMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected