KDTree< T >::KDTree::PointHeap Class Reference

Performs a nearest-neighbour search by managing a heap from nodes of a KDTree. More...

#include <kdTree.h>

Collaboration diagram for KDTree< T >::KDTree::PointHeap:

Collaboration graph
[legend]

List of all members.

Classes

struct  HeapNode
 One element of the heap representing a node in the KDTree kd. More...
struct  HeapOrder
 Defines the order of heap - ascending according to getSE. More...

Public Member Functions

 PointHeap (const KDTree &tree, const T *point_, bool checkNaNs)
 Builds the heap from a KDTree tree and vector point_ (they've got to remain valid until the destruction of this instance).
bool isEmpty ()
 Returns whether the heap is empty ( !isEmpty() is needed for all other methods).
getTopSE ()
 Returns the SE of the top node (always equals the SE of the next leaf).
template<bool CheckNaNs>
int popLeaf (T maxSE)
 Removes a leaf, returns the matching vector's index, assumes it's safe to discard nodes further than maxSE.

Protected Member Functions

template<bool CheckNaNs>
void makeTopLeaf (T maxSE)
 Divides the top nodes until there's a leaf on the top assumes it's safe to discard nodes further than maxSE.

Private Attributes

const KDTreekd
 Reference to the KDTree we operate on.
const T *const point
 Pointer to the point we are trying to approach.
vector< HeapNodeheap
 The current heap of the tree nodes.
BulkAllocator< T > allocator
 The allocator for HeapNode::data.


Detailed Description

template<class T>
class KDTree< T >::PointHeap

Performs a nearest-neighbour search by managing a heap from nodes of a KDTree.

It returns vectors (their indices) in the order of ascending distance (SE) from a given fixed point. It can compute a lower bound of the SEs of the remaining vectors at any time.

Definition at line 144 of file kdTree.h.


The documentation for this class was generated from the following file:

Generated on Thu Aug 6 22:33:14 2009 for Fractal Image Compressor by  doxygen 1.5.8