#include <NearestNeighbours.h>
Public Member Functions | |
NearestNeighbours (unsigned int k) | |
void | insert (double dist, cur_type *element) |
void | insert (double dist, int index) |
Static Public Member Functions | |
static double | minimumDistance (vector< double > p, const cur_type *const in) |
Public Attributes | |
unsigned int | max |
unsigned int | size |
double | maxdist |
vector< int > * | ids |
vector< double > * | dists |
Definition at line 20 of file NearestNeighbours.h.
NearestNeighbours< cur_type >::NearestNeighbours | ( | unsigned int | k | ) | [inline] |
Create a structure that stores the k-Nearest-Neighbours.
k | The maximum number of neighbours to-be found. |
Definition at line 35 of file NearestNeighbours.h.
References NearestNeighbours< cur_type >::dists, NearestNeighbours< cur_type >::ids, NearestNeighbours< cur_type >::max, NearestNeighbours< cur_type >::maxdist, and NearestNeighbours< cur_type >::size.
void NearestNeighbours< cur_type >::insert | ( | double | dist, | |
cur_type * | element | |||
) | [inline] |
Insert a neighbour in the structure if not k nearer neighbours are known.
dist | The distance from the element to. | |
element | Pointer to the element that may be inserted. |
Definition at line 49 of file NearestNeighbours.h.
References NearestNeighbours< cur_type >::dists, NearestNeighbours< cur_type >::ids, NearestNeighbours< cur_type >::maxdist, and NearestNeighbours< cur_type >::size.
Referenced by R_tree< r_tree_variation >::neighboursOf().
void NearestNeighbours< cur_type >::insert | ( | double | dist, | |
int | index | |||
) | [inline] |
Function which decides whether or not to insert a given item to the nearest neighbourhood list.
dist | Distance of the current item. | |
index | Index of the current item. |
Definition at line 89 of file NearestNeighbours.h.
References NearestNeighbours< cur_type >::dists, NearestNeighbours< cur_type >::ids, NearestNeighbours< cur_type >::maxdist, and NearestNeighbours< cur_type >::size.
static double NearestNeighbours< cur_type >::minimumDistance | ( | vector< double > | p, | |
const cur_type *const | in | |||
) | [inline, static] |
Calculates the smallest (squared) euclidian distance between a point and a box.
point | The point. | |
box | The box. |
Definition at line 131 of file NearestNeighbours.h.
unsigned int NearestNeighbours< cur_type >::max |
Maximum number of neighbours (k)
Definition at line 23 of file NearestNeighbours.h.
Referenced by NearestNeighbours< cur_type >::NearestNeighbours(), and R_tree< r_tree_variation >::neighboursOf().
unsigned int NearestNeighbours< cur_type >::size |
Current number of neighbours in structure
Definition at line 24 of file NearestNeighbours.h.
Referenced by NearestNeighbours< cur_type >::insert(), NearestNeighbours< cur_type >::NearestNeighbours(), and R_tree< r_tree_variation >::neighboursOf().
double NearestNeighbours< cur_type >::maxdist |
The maximum distance of the neighbours in the structure
Definition at line 26 of file NearestNeighbours.h.
Referenced by NearestNeighbours< cur_type >::insert(), NearestNeighbours< cur_type >::NearestNeighbours(), and R_tree< r_tree_variation >::neighboursOf().
vector<int>* NearestNeighbours< cur_type >::ids |
The ids of the neighbours
Definition at line 27 of file NearestNeighbours.h.
Referenced by NearestNeighbours< cur_type >::insert(), NearestNeighbours< cur_type >::NearestNeighbours(), and R_tree< r_tree_variation >::neighboursOf().
vector<double>* NearestNeighbours< cur_type >::dists |
The distances of the neighbours
Definition at line 28 of file NearestNeighbours.h.
Referenced by NearestNeighbours< cur_type >::insert(), and NearestNeighbours< cur_type >::NearestNeighbours().