private DoubleDBIDList initialRange ( DBIDRef obj , DBIDs cands , PrimitiveDistanceFunction < ? super NumberVector > df , double eps , KernelDensityEstimator kernel , ModifiableDoubleDBIDList n ) { n . clear ( ) ; NumberVector o = kernel . relation . get ( obj ) ; final double twoeps = eps * 2 ; int matches = 0 ; for ( DBIDIter cand = cands . iter ( ) ; cand . valid ( ) ; cand . advance ( ) ) { final double dist = df . distance ( o , kernel . relation . get ( cand ) ) ; if ( dist <= twoeps ) { n . add ( dist , cand ) ; if ( dist <= eps ) { ++ matches ; } } } n . sort ( ) ; return n . slice ( 0 , matches ) ; }
Initial range query .