Switched to the new knncolle C++ libaries for all implementations. This greatly streamlines the internals and allows downstream packages to re-use the search indices in their own C++ code.
Parallelization is now performed using the standard <thread>
library.
This avoids the overhead of forking or starting new processes via BiocParallel.
All *Index
classes have been removed.
The output of buildIndex()
is no longer guaranteed to be serializable, e.g., external pointers to C++-owned objects;
attempting to do so will raise a “null pointer to prebuilt index” error for all methods implemented in this package.
The removal of this guarantee makes it easier to extend BiocNeighbors to new methods where the index structure does not have an obvious R representation.
All functions (findKNN()
, queryNeighbors()
, etc.) will no longer coerce X
to a matrix, to avoid the headache of S4 dispatch ambiguity.
Users should coerce their data into matrix format before supplying it to these functions.
The last=
option in findKNN()
and queryKNN()
has been replaced by the findDistance()
and queryDistance()
functions instead.
This provides a much more intuitive method for the typical use of last=
, i.e., to obtain the distance to the k-th nearest neighbor.
findNeighbors()
no longer reports each point as its own neighbor.
Also, all neighbors are now sorted by increasing distance in findNeighbors()
and queryNeighbors()
.
Migrated findMutualNN()
from batchelor.
Vendored the RcppAnnoy headers for greater reproducibility.
Added a distance="Cosine"
option for all algorithms.
Allow memory-efficient retrieval of the distance to the furthest neighbors.
Added a warn.ties= argument to turn off tie-related warnings in the KMKNN and VP tree algorithms.
Return neighbor counts in rangeFind*() and rangeQuery*() functions when get.index=FALSE and get.distance=FALSE.
findNeighbors() and queryNeighbors() now accept a vector of point-specific thresholds.
Added an VP tree implemention in findVptree(), queryVptree(), buildVptree(). Supported dispatch to these methods in the generics.
Added a HNSW implementation in findHnsw(), queryHnsw(), buildHnsw(). Supported dispatch to these methods in the generics.
Renamed buildNNIndex() to buildIndex().
Converted findNeighbors() and queryNeighbors() into S4 methods. Created specific rangeFind*() and rangeQuery*() functions for KMKNN and VP tree algorithms.
Modified AnnoyIndex class to hold the original data matrix. Created bnorder(), bndata() generics to obtain (possibly reordered) input matrices for all indexes.
Supported Manhattan distance searching in all algorithms.
New package BiocNeighbors, for k-means-based k-nearest neighbor detection.