From f01e0cbaf764ced1ea0962c1cc0c53e7368a429c Mon Sep 17 00:00:00 2001 From: evanbiederstedt Date: Fri, 19 Nov 2021 14:31:00 -0500 Subject: [PATCH] udpate, v1.0.0 --- DESCRIPTION | 3 +-- README.md | 70 +++++++++++++++++++++++++---------------------------- 2 files changed, 34 insertions(+), 39 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 208309b..ef3c0d7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,7 @@ Package: N2R Type: Package Title: Implements kNN methods using n2 library -Version: 0.0.1 -Date: 2020-06-26 +Version: 1.0.0 Authors@R: c(person("Peter", "Kharchenko", email = "Peter_Kharchenko@hms.harvard.edu", role = c("aut")), person("Evan", "Biederstedt", email = "evan.biederstedt@gmail.com", role=c("cre", "aut"))) Description: One paragraph description of what the package does as one or more full sentences. diff --git a/README.md b/README.md index ac2b6a1..a464d88 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,48 @@ +[![](https://circleci.com/gh/kharchenkolab/N2R.svg?style=svg)](https://app.circleci.com/pipelines/github/kharchenkolab/N2R) +[![CRAN status](https://www.r-pkg.org/badges/version/N2R)](https://cran.r-project.org/package=N2R) +[![CRAN downloads](https://cranlogs.r-pkg.org/badges/N2R)](https://cran.r-project.org/package=N2R) + # N2R -R extensions to n2 implementing kNN functions, from conos +R extensions to N2 implementing kNN functions. -Newer version with Python and Go bindings here: https://github.com/kakao/n2 -(Note: both Python and Go extensions are quite different in design than this library.) +Implements methods to perform fast approximate K-nearest neighbor search on an input matrix. The algorithm implemented is based on the N2 implementation of an approximate nearest neighbor search using Hierarchical NSW graphs. The original algorithm is described in "Efficient and Robust Approximate Nearest Neighbor Search Using Hierarchical Navigable Small World Graphs", Y. Malkov and D. Yashunin, doi: 10.1109/TPAMI.2018.2889473, arXiv: 1603.09320. +Related libraries: +* The original C++ library with Python and Go bindings here: https://github.com/kakao/n2 +* Rust library here: https://github.com/rust-cv/hnsw -## Functions -* `n2Knn()`: k-NN using n2 approximate nearest neighbors algorithm -(similar to ) +## Installation -* `n2CrossKnn()`: matrixA cross matrixB k-NN using n2 +To install the stable version from [CRAN](https://CRAN.R-project.org/package=N2R), use: -## Installation +```r +install.packages('N2R') +``` -For Mac OS X 10.15.5, +To install the latest version, use: -`brew install gcc gfortran` +```r +install.packages('devtools') +devtools::install_github('kharchenkolab/N2R') +``` -I've included `llvm` as well for my configuration below, though it's not required. +For installing from source on Mac OS, please see instructions in the wiki [here](https://github.com/kharchenkolab/N2R/wiki/Installing-N2R-for-Mac-OS) -including the following in my `~/.zshrc`: +## Functions -``` -export PATH="/usr/local/opt/llvm/bin:$PATH" -export LDFLAGS="-L/usr/local/opt/llvm/lib" -export CPPFLAGS="-I/usr/local/opt/llvm/include" -``` +* `Knn()`: k-NN using N2 approximate nearest neighbors algorithm -and my `.R/Makevars` contains: +* `crossKnn()`: matrixA cross matrixB k-NN using N2 + + +## Citation + +If you find `N2R` useful for your publication, please cite: ``` -XCBASE:=$(shell xcrun --show-sdk-path) -LLVMBASE:=$(shell brew --prefix llvm) -GCCBASE:=$(shell brew --prefix gcc) -GETTEXT:=$(shell brew --prefix gettext) - -CC=$(LLVMBASE)/bin/clang -fopenmp -CXX=$(LLVMBASE)/bin/clang++ -fopenmp -CXX11=$(LLVMBASE)/bin/clang++ -fopenmp -CXX14=$(LLVMBASE)/bin/clang++ -fopenmp -CXX17=$(LLVMBASE)/bin/clang++ -fopenmp -CXX1X=$(LLVMBASE)/bin/clang++ -fopenmp - -CPPFLAGS=-isystem "$(LLVMBASE)/include" -isysroot "$(XCBASE)" -LDFLAGS=-L"$(LLVMBASE)/lib" -L"$(GETTEXT)/lib" --sysroot="$(XCBASE)" - -FC=$(GCCBASE)/bin/gfortran -fopenmp -F77=$(GCCBASE)/bin/gfortran -fopenmp -FLIBS=-L$(GCCBASE)/lib/gcc/9/ -lm -``` +Peter Kharchenko, Viktor Petukhov and Evan Biederstedt (2020). N2R: +Fast and Scalable Approximate k-Nearest Neighbor Search Methods using +N2 Library. R package version 1.0.0 +https://github.com/kharchenkolab/N2R +``` \ No newline at end of file