@Override public boolean findNearest(P point, double maxDistance, NnData<P> result) { if( maxDistance < 0 ) maxDistance = Double.MAX_VALUE; int index = alg.findClosest(point,maxDistance); if( index >= 0 ) { result.point = points.get(index); result.distance = alg.getBestDistance(); result.index = index; return true; } else { return false; } }
@Override public boolean findNearest(P point, double maxDistance, NnData<P> result) { if( maxDistance < 0 ) maxDistance = Double.MAX_VALUE; int index = alg.findClosest(point,maxDistance); if( index >= 0 ) { result.point = points.get(index); result.distance = alg.getBestDistance(); result.index = index; return true; } else { return false; } }