protected static double getMinDist ( DBIDArrayIter j , DistanceQuery < ? > distQ , DBIDArrayIter mi , WritableDoubleDataStore mindist ) { double prev = mindist . doubleValue ( j ) ; if ( Double . isNaN ( prev ) ) { // NaN = unknown prev = Double . POSITIVE_INFINITY ; for ( mi . seek ( 0 ) ; mi . valid ( ) ; mi . advance ( ) ) { double d = distQ . distance ( j , mi ) ; prev = d < prev ? d : prev ; } mindist . putDouble ( j , prev ) ; } return prev ; }
Get the minimum distance to previous medoids .