double function ( final int arg0 , double [ ] arg1 ) { double loc0 = .5 * arg0 * arg0 ; int loc1 ; for ( loc1 = arg1 . length ; loc1 -- != 0 && arg1 [ loc1 ] > loc0 ; ) ; return loc1 == arg1 . length - 1 ? Double . POSITIVE_INFINITY : loc1 + 1 ; }
returns the median of distances between all pairs of nodes . note that if you have an actual neighbourhood function , you can safely pass its first value as first argument ; however , having the number of nodes as a separate input makes it possible passing this method a distance cumulative distribution function , too . concode_field_sep Logger LOGGER concode_field_sep double[] compute concode_elem_sep double[] compute concode_elem_sep double[] compute concode_elem_sep double effectiveDiameter concode_elem_sep double effectiveDiameter concode_elem_sep double harmonicDiameter concode_elem_sep double harmonicDiameter concode_elem_sep long[] computeExact concode_elem_sep double[] distanceProbabilityMassFunction concode_elem_sep double[] distanceCumulativeDistributionFunction concode_elem_sep double averageDistance concode_elem_sep void main concode_elem_sep double spid