/** * Locate nearest neighbours for a given point in space. * @param nMin number of entries to be returned. More entries may or may not be returned if * several points have the same distance. * @param distanceFunction A distance function for rectangle data. This parameter is optional, * passing a {@code null} will use the default distance function. * @param center the center point * @return The query iterator. */ public PhKnnQuerySF<T> nearestNeighbour(int nMin, PhDistanceSF distanceFunction, double ... center) { long[] lCenter = new long[2*dims]; pre.pre(center, center, lCenter); PhDistanceSF df = distanceFunction == null ? dist : distanceFunction; return new PhKnnQuerySF<>(pht.nearestNeighbour(nMin, df, null, lCenter), dims, pre); }