Skip to content

Commit

Permalink
Merge pull request #112 from eddelbuettel/master
Browse files Browse the repository at this point in the history
Make one more AnnoyIndex use be Annoy::AnnoyIndex
  • Loading branch information
jlmelville authored Jun 27, 2023
2 parents e065bd5 + a730716 commit d2ef77f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/nn_parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,17 @@ template <typename UwotAnnoyDistance> struct NNWorker {
std::vector<int> idx;
std::vector<typename UwotAnnoyDistance::T> dists;

#if ANNOY_VERSION >= Annoy_Version(1,17,3)
Annoy::AnnoyIndex<typename UwotAnnoyDistance::S, typename UwotAnnoyDistance::T,
typename UwotAnnoyDistance::Distance, Kiss64Random,
AnnoyIndexThreadedBuildPolicy>
index;
#else
AnnoyIndex<typename UwotAnnoyDistance::S, typename UwotAnnoyDistance::T,
typename UwotAnnoyDistance::Distance, Kiss64Random,
AnnoyIndexThreadedBuildPolicy>
index;
#endif

NNWorker(const std::string &index_name, const std::vector<double> &mat,
std::size_t ncol, std::size_t n_neighbors, std::size_t search_k)
Expand Down

0 comments on commit d2ef77f

Please sign in to comment.