protected boolean macQueenIterate(Relation<V> relation,double[][] means,List<ModifiableDBIDs> clusters,WritableIntegerDataStore assignment,double[] varsum){
  boolean changed=false;
  Arrays.fill(varsum,0.);
  final NumberVectorDistanceFunction<?> df=getDistanceFunction();
  for (DBIDIter iditer=relation.iterDBIDs(); iditer.valid(); iditer.advance()) {
    double mindist=Double.POSITIVE_INFINITY;
    V fv=relation.get(iditer);
    int minIndex=0;
    for (int i=0; i < k; i++) {
      double dist=df.distance(fv,DoubleVector.wrap(means[i]));
      if (dist < mindist) {
        minIndex=i;
        mindist=dist;
      }
    }
    varsum[minIndex]+=mindist;
    changed|=updateMeanAndAssignment(clusters,means,minIndex,fv,iditer,assignment);
  }
  return changed;
}

protected boolean macQueenIterate ( Relation < V > relation , double [ ] [ ] means , List < ModifiableDBIDs > clusters , WritableIntegerDataStore assignment , double [ ] varsum ) { boolean changed = false ; Arrays . fill ( varsum , 0. ) ; final NumberVectorDistanceFunction < ? > df = getDistanceFunction ( ) ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { double mindist = Double . POSITIVE_INFINITY ; V fv = relation . get ( iditer ) ; int minIndex = 0 ; for ( int i = 0 ; i < k ; i ++ ) { double dist = df . distance ( fv , DoubleVector . wrap ( means [ i ] ) ) ; if ( dist < mindist ) { minIndex = i ; mindist = dist ; } } varsum [ minIndex ] += mindist ; changed |= updateMeanAndAssignment ( clusters , means , minIndex , fv , iditer , assignment ) ; } return changed ; }
perform a macqueen style iteration .
