MCPcopy Create free account
hub / github.com/VectorDB-NTU/RaBitQ-Library / IvfIndex

Method IvfIndex

python_bindings/ivf_bindings.cpp:17–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15class IvfIndex {
16 public:
17 IvfIndex(
18 size_t dim,
19 size_t max_elements,
20 size_t num_clusters,
21 size_t nbits,
22 const std::string& metric = "l2"
23 )
24 : dim_(dim)
25 , max_elements_(max_elements)
26 , num_clusters_(num_clusters)
27 , nbits_(nbits)
28 , metric_(metric_from_string(metric))
29 , index_(std::make_unique<rabitqlib::ivf::IVF>(
30 max_elements,
31 dim,
32 num_clusters,
33 nbits,
34 metric_,
35 rabitqlib::RotatorType::FhtKacRotator
36 )) {}
37
38 void build(
39 py::handle data,

Callers

nothing calls this directly

Calls 1

metric_from_stringFunction · 0.85

Tested by

no test coverage detected