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

Method HnswIndex

python_bindings/hnsw_bindings.cpp:18–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16class HnswIndex {
17 public:
18 HnswIndex(
19 size_t dim,
20 size_t max_elements,
21 size_t M,
22 size_t ef_construction,
23 size_t nbits,
24 const std::string& metric = "l2",
25 size_t random_seed = 100
26 )
27 : dim_(dim)
28 , max_elements_(max_elements)
29 , M_(M)
30 , ef_construction_(ef_construction)
31 , nbits_(nbits)
32 , metric_(metric_from_string(metric))
33 , random_seed_(random_seed)
34 , index_(std::make_unique<rabitqlib::hnsw::HierarchicalNSW>(
35 max_elements,
36 dim,
37 nbits,
38 M,
39 ef_construction,
40 random_seed,
41 metric_
42 )) {}
43
44 void build(
45 py::handle data,

Callers

nothing calls this directly

Calls 1

metric_from_stringFunction · 0.85

Tested by

no test coverage detected