private double dot(final int k0,final int k1,final int[] assignment0,final int[] assignment1){
  double dot=0;
  final int N=X.size();
  int a=0, b=0;
  for (int i=0; i < N; i++) {
    if (assignment0[i] != k0)     continue;
    a++;
    for (int j=0; j < N; j++) {
      if (assignment1[j] != k1)       continue;
      dot+=kernel.eval(i,j,X,accel);
    }
  }
  for (int j=0; j < N; j++)   if (assignment1[j] == k1)   b++;
  return dot / (a * b);
}

private double dot ( final int k0 , final int k1 , final int [ ] assignment0 , final int [ ] assignment1 ) { double dot = 0 ; final int N = X . size ( ) ; int a = 0 , b = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( assignment0 [ i ] != k0 ) continue ; a ++ ; for ( int j = 0 ; j < N ; j ++ ) { if ( assignment1 [ j ] != k1 ) continue ; dot += kernel . eval ( i , j , X , accel ) ; } } for ( int j = 0 ; j < N ; j ++ ) if ( assignment1 [ j ] == k1 ) b ++ ; return dot / ( a * b ) ; }
dot product between two different clusters from different sets of cluster assignments . two different assignment arrays are used to allow overlapping assignment of points to the clusters .
