NearestNeighbours< cur_type > Class Template Reference

#include <NearestNeighbours.h>

List of all members.

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


Detailed Description

template<typename cur_type>
class NearestNeighbours< cur_type >

Definition at line 20 of file NearestNeighbours.h.


Constructor & Destructor Documentation

template<typename cur_type>
NearestNeighbours< cur_type >::NearestNeighbours ( unsigned int  k  )  [inline]

Create a structure that stores the k-Nearest-Neighbours.

Parameters:
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.


Member Function Documentation

template<typename cur_type>
void NearestNeighbours< cur_type >::insert ( double  dist,
cur_type *  element 
) [inline]

Insert a neighbour in the structure if not k nearer neighbours are known.

Parameters:
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().

template<typename cur_type>
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.

Parameters:
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.

template<typename cur_type>
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.

Parameters:
point The point.
box The box.
Returns:
The smallest (squared) euclidian distance.

Definition at line 131 of file NearestNeighbours.h.


Member Data Documentation

template<typename cur_type>
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().

template<typename cur_type>
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().

template<typename cur_type>
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().

template<typename cur_type>
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().

template<typename cur_type>
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().


The documentation for this class was generated from the following file:
Generated on Sat Oct 13 17:34:43 2007 for R-Tree by  doxygen 1.5.2