From 2fe9aa875c02fa4eb7311e8d8db5de24f5b7d88d Mon Sep 17 00:00:00 2001 From: Zhao Junwang Date: Thu, 28 Mar 2024 11:22:51 +0800 Subject: [PATCH] export max_degree after load PQFlashIndex, some one may want to know the graph's max_degree to caculate `num_nodes_to_cache` with limited cache budget. Signed-off-by: Zhao Junwang --- include/pq_flash_index.h | 1 + src/pq_flash_index.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/pq_flash_index.h b/include/pq_flash_index.h index ba5258e18..07cff1d12 100644 --- a/include/pq_flash_index.h +++ b/include/pq_flash_index.h @@ -107,6 +107,7 @@ template class PQFlashIndex DISKANN_DLLEXPORT std::vector get_pq_vector(std::uint64_t vid); DISKANN_DLLEXPORT uint64_t get_num_points(); + DISKANN_DLLEXPORT uint64_t get_max_degree(); protected: DISKANN_DLLEXPORT void use_medoids_data_as_centroids(); diff --git a/src/pq_flash_index.cpp b/src/pq_flash_index.cpp index b6d95b97f..af37613d5 100644 --- a/src/pq_flash_index.cpp +++ b/src/pq_flash_index.cpp @@ -1792,6 +1792,11 @@ template std::uint64_t PQFlashIndex::ge return _num_points; } +template std::uint64_t PQFlashIndex::get_max_degree() +{ + return _max_degree; +} + // instantiations template class PQFlashIndex; template class PQFlashIndex;