private method used by the randomized-select method see the book for details . concode_field_sep KDNode root concode_elem_sep double[] nearestNeighboor concode_elem_sep Random random concode_elem_sep double minDist concode_elem_sep int dimensionCount concode_elem_sep RedBlackTree<KNNPoint> resultKNN concode_elem_sep int nodeCount concode_elem_sep int k concode_field_sep void buildtree concode_elem_sep RedBlackTree<KNNPoint> knearest concode_elem_sep double distance concode_elem_sep void swap concode_elem_sep void findParent_knn concode_elem_sep void tryToSave concode_elem_sep double[] nearest concode_elem_sep void nearest concode_elem_sep double[] randomizedSelect concode_elem_sep int size concode_elem_sep void findParent concode_elem_sep String toString concode_elem_sep String toString concode_elem_sep String toString concode_elem_sep int randomizedPartition concode_elem_sep KDNode generateNode concode_elem_sep void nearest_knn
int function ( double [ ] [ ] arg0 , int arg1 , int arg2 , int arg3 ) { double [ ] loc0 = arg0 [ arg2 ] ; int loc1 = arg1 - 1 ; for ( int loc2 = arg1 ; loc2 <= arg2 - 1 ; loc2 ++ ) { if ( arg0 [ loc2 ] [ arg3 ] <= loc0 [ arg3 ] ) { loc1 = loc1 + 1 ; swap ( arg0 , loc1 , loc2 ) ; } } swap ( arg0 , loc1 + 1 , arg2 ) ; return loc1 + 1 ; }