protected static <O>DoubleIntPair[] rankReferencePoints(DistanceQuery<O> distanceQuery,O obj,ArrayDBIDs referencepoints){
  DoubleIntPair[] priority=new DoubleIntPair[referencepoints.size()];
  for (DBIDArrayIter iter=referencepoints.iter(); iter.valid(); iter.advance()) {
    final int i=iter.getOffset();
    final double dist=distanceQuery.distance(obj,iter);
    priority[i]=new DoubleIntPair(dist,i);
  }
  Arrays.sort(priority);
  return priority;
}

protected static < O > DoubleIntPair [ ] rankReferencePoints ( DistanceQuery < O > distanceQuery , O obj , ArrayDBIDs referencepoints ) { DoubleIntPair [ ] priority = new DoubleIntPair [ referencepoints . size ( ) ] ; for ( DBIDArrayIter iter = referencepoints . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { final int i = iter . getOffset ( ) ; final double dist = distanceQuery . distance ( obj , iter ) ; priority [ i ] = new DoubleIntPair ( dist , i ) ; } Arrays . sort ( priority ) ; return priority ; }
sort the reference points by distance to the query object
