protected static < O > DoubleIntPair [ ] rankReferencePoints ( DistanceQuery < O > distanceQuery , O obj , ArrayDBIDs referencepoints ) { DoubleIntPair [ ] priority = new DoubleIntPair [ referencepoints . size ( ) ] ; // Compute distances to reference points. 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