An efficient algorithm for finding neighbors.
|
| GKdTree (const GMatrix *pData, GDistanceMetric *pMetric=NULL, bool ownMetric=false) |
|
virtual | ~GKdTree () |
|
GKdNode * | buildTree (size_t count, size_t *pIndexes) |
| Build the tree. More...
|
|
virtual size_t | findNearest (size_t k, size_t index) |
| See the comment for GNeighborFinder::findNearest. More...
|
|
virtual size_t | findNearest (size_t k, const GVec &vector) |
| See the comment for GNeighborFinderGeneralizing::neighbors. More...
|
|
size_t | findWithinRadius (double squaredRadius, size_t index) |
| See the comment for GNeighborFinder::findWithinRadius. More...
|
|
size_t | findWithinRadius (double squaredRadius, const GVec &vector) |
| See the comment for GNeighborFinderGeneralizing::findWithinRadius. 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 | 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, 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...
|
|
virtual double | distance (size_t i) |
| See the comment for GNeighborFinder::distance. More...
|
|
GDistanceMetric * | metric () |
| Returns the metric. More...
|
|
virtual size_t | neighbor (size_t i) |
| See the comment for GNeighborFinder::neighbor. More...
|
|
void | sortNeighbors (size_t start=0, size_t end=INVALID_INDEX) |
| Uses Quick Sort to sort the neighbors from least to most distant. More...
|
|
| GNeighborFinder (const GMatrix *pData) |
|
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...
|
|
|
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...
|
|
size_t | findNearest (size_t k, const GVec &vec, size_t nExclude) |
| This is a helper method that finds the nearest neighbors. More...
|
|
size_t | findWithinRadius (double squaredRadius, const GVec &vec, size_t nExclude) |
| This is a helper method that finds neighbors within a radius. 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...
|
|
void | insertionSortNeighbors (size_t start, size_t end) |
| A helper method used by sortNeighbors when the remaining portion to sort is small. More...
|
|