INNER CODE UNIT · C++

total_graph_size

epsilla-cloud/vectordb · engine/db/ann_graph_segment.cpp:220

  int64_t total_graph_size = index_->Build(n, vector_column, nullptr, b_params);

  // Convert the graph.
  if (offset_table_ != nullptr) {
    delete[] offset_table_;
  }
  offset_table_ = new int64_t[n + 1];  // +1 for the last node.
  if (neighbor_list_ != nullptr) {
    delete[] neighbor_list_;
  }
  neighbor_list_ = new int64_t[total_graph_size];
  int64_t offset = 0;
  for (int64_t i = 0; i < n; ++i) {
    offset_table_[i] = offset;
    auto& knn = index_->nsg.at(i);
    for (int64_t j = 0; j < knn.size(); ++j) {
      neighbor_list_[offset + j] = knn.at(j);
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…