Protected
_currRProtected
_heapReadonly
distThe distance metric used by this neighborhood
The neighborhood's original radius (Eucledian metric)
The neighborhood's target position / centroid
Returns an array of current nearest neighbor result tuples (each [dist, val]
). The array will contain at most k
items and if the sorted
ctor arg was true, will be sorted by distance.
Use KNearest.values to obtain result values without their distance metrics.
Returns true, if distance d
is <= current radius of this neighborhood. If eucledian
is true (default: true), then d
will first be converted into the metric used by this neighborhood using IDistance.to, otherwise it is expected to be already in that metric space.
Computes distance metric between pos
and this neighborhood's target pos. Returns true if result is <= current radius.
Resets search/reference position.
Similar to KNearest.deref, but returns array of result values without their distance metrics.
Generated using TypeDoc
A INeighborhood implementation for K-nearest neighbor queries around a given target location, initial query radius and IDistance metric to determine proximity. See Radial for an unbounded and unsorted version.
Remarks
The K-nearest neighbors will be accumulated via an internal
Heap
and results can be optionally returned in order of proximity (via KNearest.deref or KNearest.values). For K=1 it will be more efficient to use Nearest to avoid the additional overhead.