public static <O> KNNQuery<O> getKNNQuery(Relation<O> relation, DistanceFunction<? super O> distanceFunction, Object... hints) {
    final DistanceQuery<O> distanceQuery = relation.getDistanceQuery(distanceFunction, hints);
    return relation.getKNNQuery(distanceQuery, hints);
  }
public static < O > KNNQuery < O > getKNNQuery ( Relation < O > relation , DistanceFunction < ? super O > distanceFunction , Object ... hints ) { final DistanceQuery < O > distanceQuery = relation . getDistanceQuery ( distanceFunction , hints ) ; return relation . getKNNQuery ( distanceQuery , hints ) ; }
Get a KNN query object for the given distance function.

An index is used when possible, but it may fall back to a linear scan.

Hints include:
<ul>
<li>Integer: maximum value for k needed</li>
<li>{@link de.lmu.ifi.dbs.elki.database.query.DatabaseQuery#HINT_BULK} bulk
query needed</li>
</ul>

@param relation Relation used
@param distanceFunction Distance function
@param hints Optimizer hints

@param <O> Object type
@return KNN Query object