MyNixOS website logo
Description

Extremely Fast Nearest Neighbor Search.

Finds the k nearest neighbours for every point in a given dataset using Jose Luis' 'nanoflann' library. There is support for exact searches, fixed radius searches with 'kd' trees and two distances, the 'Euclidean' and 'Manhattan'. For more information see <https://github.com/jlblancoc/nanoflann>. Also, the 'nanoflann' library is exported and ready to be used via the linking to mechanism.

Rnanoflann Rnanoflann

CRAN_Status_Badge metacran downloads metacran downloads CRAN_latest_release_date R (linux) R (MacOS) R (windows)

1. About

Rnanoflann is a wrapper for C++'s library nanoflan which performs nearest neighbors search using kd-trees.

2. Usage

You can use the exported Rnanoflann::nn function or directly nanoflan via LinkignTo mechanism.

2.1. Rnanoflann

Rnanoflann export the function nn that performs nearest neighbors search with options:

  • data - An M x dmatrix where each of the M rows is a point.
  • points - An N x dmatrix that will be queried against data. d, the number of columns, must be the same as data. If missing, defaults to data.
  • parallel - uses omp library to perform parallel search for each point. Default is FALSE
  • cores - the cores that omp will use. Default is zero and it means to automatically compute the numbers of threads.
  • search - the supported types are standard and radius.
  • eps - Error bound. Default is 0.0.
  • k - The maximum number of nearest neighbors to compute. The default value is set to the number of rows in data

2.2. LinkingTo

Add in Description in LinkingTo section the Rnanoflann and then:

  • use nanoflann directly. Just #include "nanoflann.hpp". Refer to nanoflan for more details.
  • use the Rnanoflann::nn via C++. Just #include "Rnanoflann.h". The available implemented function are use Rcpp and RcppArmadillo. For custom matrices you need to implement you own adaptor (see above).
Metadata

Version

0.0.3

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows