|
| GKdTree (const GMatrix *pData, size_t neighborCount, GDistanceMetric *pMetric=NULL, bool ownMetric=false) |
|
virtual | ~GKdTree () |
|
GKdNode * | buildTree (size_t count, size_t *pIndexes) |
| Build the tree. More...
|
|
bool | isGreaterOrEqual (const double *pPat, size_t attr, double pivot) |
| Returns true iff the specified point-vector is on the >= side of the specified pivot. More...
|
|
virtual void | neighbors (size_t *pOutNeighbors, size_t index) |
| See the comment for GNeighborFinder::neighbors. More...
|
|
virtual void | neighbors (size_t *pOutNeighbors, double *pOutDistances, size_t index) |
| See the comment for GNeighborFinder::neighbors. More...
|
|
virtual void | neighbors (size_t *pOutNeighbors, double *pOutDistances, const double *pInputVector) |
| See the comment for GNeighborFinderGeneralizing::neighbors. More...
|
|
virtual void | reoptimize () |
| Rebuilds the tree to improve subsequent performance. This should be called after a significant number of point-vectors are added to or released from the internal set. More...
|
|
GKdNode * | root () |
| Returns the root node of the kd-tree. More...
|
|
void | setMaxLeafSize (size_t n) |
| Specify the max number of point-vectors to store in each leaf node. More...
|
|
| GNeighborFinderGeneralizing (const GMatrix *pData, size_t neighborCount, GDistanceMetric *pMetric=NULL, bool ownMetric=false) |
| Create a neighborfinder for finding the neighborCount nearest neighbors under the given metric. If ownMetric is true, then the neighborFinder takes responsibility for deleting the metric, otherwise it is the caller's responsibility. More...
|
|
virtual | ~GNeighborFinderGeneralizing () |
|
virtual bool | canGeneralize () |
| Returns true. See the comment for GNeighborFinder::canGeneralize. More...
|
|
| GNeighborFinder (const GMatrix *pData, size_t neighborCount) |
|
virtual | ~GNeighborFinder () |
|
const GMatrix * | data () |
| Returns the data passed to the constructor of this object. More...
|
|
virtual bool | isCached () |
| Returns true iff the neighbors and distances are pre-computed. More...
|
|
size_t | neighborCount () |
| Returns the number of neighbors to find. More...
|
|
void | sortNeighbors (size_t *pNeighbors, double *pDistances) |
| Uses Quick Sort to sort the neighbors from least to most dissimilar, followed by any slots for with INVALID_INDEX for the index. (Note: This method is pointless, since the neighors are already guaranteed to come in sorted order. Todo: figure out why it is still here) More...
|
|
|
void | computePivotAndGoodness (size_t count, size_t *pIndexes, size_t attr, double *pOutPivot, double *pOutGoodness) |
| Computes a good pivot for the specified attribute, and the goodness of splitting on that attribute. For continuous attributes, the pivot is the (not scaled) mean and the goodness is the scaled variance. For nominal attributes, the pivot is the most common value and the goodness is scaled entropy. More...
|
|
void | findNeighbors (size_t *pOutNeighbors, double *pOutDistances, const double *pInputVector, size_t nExclude) |
| This is the helper method that finds the neighbors. More...
|
|
size_t | splitIndexes (size_t count, size_t *pIndexes, size_t attr, double pivot) |
| Moves all the indexes that refer to rows that have a value less than pivot in the specified attribute to the beginning of the list, and the rest to the end. Returns the number of rows with a value less than the pivot. For nominal values, not-equal values are moved to the beginning, and equal values are moved to the end. More...
|
|
An efficient algorithm for finding neighbors.