STATUS: work in progress Fast Nearest-Neighbour searching. More...
#include "mathadd.h"
#include "distances.h"
#include "definitions.h"
#include "optarg.h"
Go to the source code of this file.
Data Structures | |
struct | SearchTree |
Functions | |
SearchTree * | nn_prepare (const double **X, int m, int N, OptArgList *optargs) |
void | nn_search_k (const SearchTree *S, const double *x, int k, int *nn_idx, double *nn_dist) |
void | nn_searck_k_slow (const double **X, int N, int m, const double *x, int k, int *nn_idx, double *nn_dist, OptArgList *optargs) |
STATUS: work in progress Fast Nearest-Neighbour searching.
see
Merkwirth et al. Fast nearest-neighbor searching for nonlinear signal processing. Physical review E, Statistical physics, plasmas, fluids, and related interdisciplinary topics (2000) vol. 62 (2 Pt A) pp. 2089-97
Definition in file nnsearch.h.
SearchTree* nn_prepare | ( | const double ** | X, | |
int | N, | |||
int | m, | |||
OptArgList * | optargs | |||
) |
Initialize the search tree for fast-nearest-neighbour searching.
data | matrix of m variables with N measurements each | |
m | dimensionality | |
N | number of measurements | |
optargs | may contain:
|
Definition at line 38 of file nnsearch.c.
void nn_search_k | ( | const SearchTree * | S, | |
const double * | x, | |||
int | k, | |||
int * | nn_idx, | |||
double * | nn_dist | |||
) |
Searching the k nearest neighbour of vector x in searchtree. This implementation uses a searchtree-based method.
S | the searchtree, previously initialized by nn_prepare | |
x | query point; must be of dimension m in searchtree S | |
k | number of neighbours to look for | |
nn_idx | memory for holding the indices for the k NN's | |
nn_dist | memory for holding distances for k NN's |
Definition at line 147 of file nnsearch.c.
void nn_searck_k_slow | ( | const double ** | X, | |
int | N, | |||
int | m, | |||
const double * | x, | |||
int | k, | |||
int * | nn_idx, | |||
double * | nn_dist, | |||
OptArgList * | optargs | |||
) |