diff --git a/pyproject.toml b/pyproject.toml index d886710..fe41693 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["scikit-build-core >=0.4.3", "nanobind >=1.3.2"] +requires = ["scikit-build-core >=0.4.3", "nanobind >=1.3.2,<2.0.0"] build-backend = "scikit_build_core.build" [project] diff --git a/src/sparse_dot_topn_core/include/sparse_dot_topn/maxheap.hpp b/src/sparse_dot_topn_core/include/sparse_dot_topn/maxheap.hpp index 2d07ce8..5a3bbe5 100644 --- a/src/sparse_dot_topn_core/include/sparse_dot_topn/maxheap.hpp +++ b/src/sparse_dot_topn_core/include/sparse_dot_topn/maxheap.hpp @@ -59,7 +59,7 @@ class MaxHeap { * \param initial initial `val` to set for all the entries */ explicit MaxHeap(int n, eT initial) : heap_size{n}, init{initial} { - heap.reserve(n); + heap.reserve(n + 1); for (int i = 0; i < heap_size; i++) { heap.push_back({max_order, -1, initial}); }