private void recomputeSeperation(double[][] means,double[] sep){
  final int k=means.length;
  assert (sep.length == k);
  boolean issquared=(distanceFunction instanceof SquaredEuclideanDistanceFunction);
  Arrays.fill(sep,Double.POSITIVE_INFINITY);
  for (int i=1; i < k; i++) {
    DoubleVector m1=DoubleVector.wrap(means[i]);
    for (int j=0; j < i; j++) {
      double d=distanceFunction.distance(m1,DoubleVector.wrap(means[j]));
      sep[i]=(d < sep[i]) ? d : sep[i];
      sep[j]=(d < sep[j]) ? d : sep[j];
    }
  }
  for (int i=0; i < k; i++) {
    sep[i]=issquared ? Math.sqrt(sep[i]) : sep[i];
    sep[i]*=.5;
  }
}

private void recomputeSeperation ( double [ ] [ ] means , double [ ] sep ) { final int k = means . length ; assert ( sep . length == k ) ; boolean issquared = ( distanceFunction instanceof SquaredEuclideanDistanceFunction ) ; Arrays . fill ( sep , Double . POSITIVE_INFINITY ) ; for ( int i = 1 ; i < k ; i ++ ) { DoubleVector m1 = DoubleVector . wrap ( means [ i ] ) ; for ( int j = 0 ; j < i ; j ++ ) { double d = distanceFunction . distance ( m1 , DoubleVector . wrap ( means [ j ] ) ) ; sep [ i ] = ( d < sep [ i ] ) ? d : sep [ i ] ; sep [ j ] = ( d < sep [ j ] ) ? d : sep [ j ] ; } } for ( int i = 0 ; i < k ; i ++ ) { sep [ i ] = issquared ? Math . sqrt ( sep [ i ] ) : sep [ i ] ; sep [ i ] *= .5 ; } }
recompute the separation of cluster means .
