Skip to content

Commit

Permalink
Run clang-format on the repo
Browse files Browse the repository at this point in the history
Suryansh Gupta committed Jan 24, 2025
1 parent b7d1520 commit 68e7bb6
Showing 2 changed files with 13 additions and 16 deletions.
11 changes: 5 additions & 6 deletions python/include/builder.h
Original file line number Diff line number Diff line change
@@ -18,10 +18,9 @@ void build_disk_index(diskann::Metric metric, const std::string &data_file_path,

template <typename DT, typename TagT = DynamicIdType, typename LabelT = filterT>
void build_memory_index(diskann::Metric metric, const std::string &vector_bin_path,
const std::string &index_output_path, uint32_t graph_degree, uint32_t complexity,
float alpha, uint32_t num_threads, bool use_pq_build,
size_t num_pq_bytes, bool use_opq, bool use_tags = false,
const std::string& filter_labels_file = "", const std::string& universal_label = "",
uint32_t filter_complexity = 0);
const std::string &index_output_path, uint32_t graph_degree, uint32_t complexity, float alpha,
uint32_t num_threads, bool use_pq_build, size_t num_pq_bytes, bool use_opq,
bool use_tags = false, const std::string &filter_labels_file = "",
const std::string &universal_label = "", uint32_t filter_complexity = 0);

}
} // namespace diskannpy
18 changes: 8 additions & 10 deletions python/include/dynamic_memory_index.h
Original file line number Diff line number Diff line change
@@ -18,8 +18,7 @@ namespace py = pybind11;
namespace diskannpy
{

template <typename DT>
class DynamicMemoryIndex
template <typename DT> class DynamicMemoryIndex
{
public:
DynamicMemoryIndex(diskann::Metric m, size_t dimensions, size_t max_vectors, uint32_t complexity,
@@ -31,19 +30,18 @@ class DynamicMemoryIndex
void load(const std::string &index_path);
int insert(const py::array_t<DT, py::array::c_style | py::array::forcecast> &vector, DynamicIdType id);
py::array_t<int> batch_insert(py::array_t<DT, py::array::c_style | py::array::forcecast> &vectors,
py::array_t<DynamicIdType, py::array::c_style | py::array::forcecast> &ids, int32_t num_inserts,
int num_threads = 0);
py::array_t<DynamicIdType, py::array::c_style | py::array::forcecast> &ids,
int32_t num_inserts, int num_threads = 0);
int mark_deleted(DynamicIdType id);
void save(const std::string &save_path, bool compact_before_save = false);
NeighborsAndDistances<DynamicIdType> search(py::array_t<DT, py::array::c_style | py::array::forcecast> &query, uint64_t knn,
uint64_t complexity);
NeighborsAndDistances<DynamicIdType> batch_search(py::array_t<DT, py::array::c_style | py::array::forcecast> &queries,
uint64_t num_queries, uint64_t knn, uint64_t complexity,
uint32_t num_threads);
NeighborsAndDistances<DynamicIdType> search(py::array_t<DT, py::array::c_style | py::array::forcecast> &query,
uint64_t knn, uint64_t complexity);
NeighborsAndDistances<DynamicIdType> batch_search(
py::array_t<DT, py::array::c_style | py::array::forcecast> &queries, uint64_t num_queries, uint64_t knn,
uint64_t complexity, uint32_t num_threads);
void consolidate_delete();
size_t num_points();


private:
const uint32_t _initial_search_complexity;
const diskann::IndexWriteParameters _write_parameters;

0 comments on commit 68e7bb6

Please sign in to comment.