Struct faiss::NSG
-
struct NSG
Public Types
-
using storage_idx_t = int32_t
internal storage of vectors (32 bits: this is expensive)
-
using Node = nsg::Node
-
using Neighbor = nsg::Neighbor
Public Functions
-
explicit NSG(int R = 32)
-
void reset()
-
void search(DistanceComputer &dis, int k, idx_t *I, float *D, VisitedTable &vt) const
-
template<bool collect_fullset, class index_t>
void search_on_graph(const nsg::Graph<index_t> &graph, DistanceComputer &dis, VisitedTable &vt, int ep, int pool_size, std::vector<Neighbor> &retset, std::vector<Node> &fullset) const
-
void add_reverse_links(int q, std::vector<std::mutex> &locks, DistanceComputer &dis, nsg::Graph<Node> &graph)
-
void sync_prune(int q, std::vector<Node> &pool, DistanceComputer &dis, VisitedTable &vt, const nsg::Graph<idx_t> &knn_graph, nsg::Graph<Node> &graph)
-
void link(Index *storage, const nsg::Graph<idx_t> &knn_graph, nsg::Graph<Node> &graph, bool verbose)
-
int dfs(VisitedTable &vt, int root, int cnt) const
-
int attach_unlinked(Index *storage, VisitedTable &vt, VisitedTable &vt2, std::vector<int> °rees)
-
void check_graph() const
Public Members
-
int ntotal = 0
nb of nodes
-
int R
nb of neighbors per node
-
int L
length of the search path at construction time
-
int C
candidate pool size at construction time
-
int search_L = 16
length of the search path
-
int enterpoint
enterpoint
-
bool is_built = false
NSG is built or not.
-
RandomGenerator rng
random generator
-
using storage_idx_t = int32_t