Finds neighbors by measuring the distance to all points using a sparse distance metric.
|
| GSparseNeighborFinder (GSparseMatrix *pData, GMatrix *pBogusData, GSparseSimilarity *pMetric, bool ownMetric=false) |
| pData is the sparse dataset in which you want to find neighbors. pBogusData must be a pointer to a valid dense dataset that will be ignored. (Obviously, this is a hack that should be cleaned up.) neighborCount is the number of neighbors that you want to find. pMetric is the similarity metric to use in finding neighbors. Higher similarity indicates closer neighbors. ownMetric specifies whether this object should delete pMetric when it is deleted. More...
|
|
virtual | ~GSparseNeighborFinder () |
|
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::findNearest. More...
|
|
virtual size_t | findWithinRadius (double squaredRadius, size_t index) |
| See the comment for GNeighborFinder::findWithinRadius Currently, this method just throws an exception because it is not yet implemented. More...
|
|
virtual size_t | findWithinRadius (double squaredRadius, const GVec &vector) |
| See the comment for GNeighborFinderGeneralizing::findWithinRadius Currently, this method just throws an exception because it is not yet implemented. More...
|
|
virtual void | reoptimize () |
| This is a no-op method in this class. 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...
|
|