AllkFN Class Reference

Performs all-furthest-neighbors. More...

Collaboration diagram for AllkFN:
[legend]

List of all members.

Public Member Functions

 AllkFN ()
 Constructors are generally very simple in FASTlib; most of the work is done by Init().
void ComputeBaseCase_ (TreeType *query_node, TreeType *reference_node)
 Performs exhaustive computation between two leaves.
void ComputeNaive (ArrayList< index_t > *resulting_neighbors, ArrayList< double > *distances)
 Does the entire computation naively.
void ComputeNeighbors (ArrayList< index_t > *resulting_neighbors, ArrayList< double > *distances)
 Computes the nearest neighbors and stores them in *results.
void ComputeNeighborsRecursion_ (TreeType *query_node, TreeType *reference_node, double higher_bound_distance)
 The recursive function.
void Destruct ()
void Init (const Matrix &references_in, index_t leaf_size, index_t kfns)
void Init (const Matrix &queries_in, const Matrix &references_in, index_t leaf_size, index_t kfns)
void Init (const Matrix &references_in, struct datanode *module_in)
 Use this if you want to run allknn it on a single dataset the query tree and reference tree are the same.
void Init (const Matrix &queries_in, const Matrix &references_in, struct datanode *module_in)
 Setup the class and build the trees.
void InitNaive (const Matrix &references_in, index_t kfns)
void InitNaive (const Matrix &queries_in, const Matrix &references_in, index_t kfns)
 Initializes the AllNN structure for naive computation.
double MaxNodeDistSq_ (TreeType *query_node, TreeType *reference_node)
 Computes the maximum squared distance between the bounding boxes of two nodes.
 ~AllkFN ()
 The tree is the only member we are responsible for deleting.

Friends

class TestAllkNFN

Detailed Description

Performs all-furthest-neighbors.

This class will build the trees and perform the recursive computation.

Definition at line 57 of file allkfn.h.


Constructor & Destructor Documentation

AllkFN::AllkFN (  )  [inline]

Constructors are generally very simple in FASTlib; most of the work is done by Init().

This is only responsible for ensuring that the object is ready to be destroyed safely.

Definition at line 165 of file allkfn.h.

AllkFN::~AllkFN (  )  [inline]

The tree is the only member we are responsible for deleting.

The others will take care of themselves.

Definition at line 173 of file allkfn.h.


Member Function Documentation

void AllkFN::ComputeBaseCase_ ( TreeType query_node,
TreeType reference_node 
) [inline]

Performs exhaustive computation between two leaves.

Definition at line 198 of file allkfn.h.

References BinarySpaceTree< TBound, TDataset, TStatistic >::begin(), la::DistanceSqEuclidean(), and BinarySpaceTree< TBound, TDataset, TStatistic >::end().

Referenced by ComputeNaive(), and ComputeNeighborsRecursion_().

void AllkFN::ComputeNaive ( ArrayList< index_t > *  resulting_neighbors,
ArrayList< double > *  distances 
) [inline]

Does the entire computation naively.

Definition at line 658 of file allkfn.h.

References ComputeBaseCase_(), ArrayList< TElem >::Init(), GenVector< T >::length(), and ArrayList< TElem >::size().

void AllkFN::ComputeNeighbors ( ArrayList< index_t > *  resulting_neighbors,
ArrayList< double > *  distances 
) [inline]

Computes the nearest neighbors and stores them in *results.

Definition at line 616 of file allkfn.h.

References ComputeNeighborsRecursion_(), ArrayList< TElem >::Init(), GenVector< T >::length(), MaxNodeDistSq_(), and ArrayList< TElem >::size().

void AllkFN::ComputeNeighborsRecursion_ ( TreeType query_node,
TreeType reference_node,
double  higher_bound_distance 
) [inline]
void AllkFN::Init ( const Matrix &  references_in,
struct datanode module_in 
) [inline]

Use this if you want to run allknn it on a single dataset the query tree and reference tree are the same.

Definition at line 435 of file allkfn.h.

References fx_param_int(), fx_timer_start(), fx_timer_stop(), GenVector< T >::Init(), ArrayList< TElem >::Init(), and GenVector< T >::SetAll().

void AllkFN::Init ( const Matrix &  queries_in,
const Matrix &  references_in,
struct datanode module_in 
) [inline]

Setup the class and build the trees.

Note: we are initializing with const references to prevent local copies of the data.

Definition at line 386 of file allkfn.h.

References fx_param_int(), fx_timer_start(), fx_timer_stop(), GenVector< T >::Init(), ArrayList< TElem >::Init(), and GenVector< T >::SetAll().

void AllkFN::InitNaive ( const Matrix &  queries_in,
const Matrix &  references_in,
index_t  kfns 
) [inline]

Initializes the AllNN structure for naive computation.

This means that we simply ignore the tree building.

Definition at line 568 of file allkfn.h.

References GenVector< T >::Init(), ArrayList< TElem >::Init(), and GenVector< T >::SetAll().

double AllkFN::MaxNodeDistSq_ ( TreeType query_node,
TreeType reference_node 
) [inline]

Computes the maximum squared distance between the bounding boxes of two nodes.

Definition at line 188 of file allkfn.h.

Referenced by ComputeNeighbors(), and ComputeNeighborsRecursion_().


The documentation for this class was generated from the following file:
Generated on Mon Jan 24 12:04:39 2011 for FASTlib by  doxygen 1.6.3