protected double[][] meansWithTreshhold(List<? extends ModifiableDoubleDBIDList> clusters,double[][] means,Relation<V> database,Double tresh){
  double[][] newMeans=new double[k][];
  for (int i=0; i < k; i++) {
    DoubleDBIDList list=clusters.get(i);
    double[] raw=null;
    int count=0;
    for (DoubleDBIDListIter iter=list.iter(); iter.valid(); iter.advance()) {
      if (iter.doubleValue() >= tresh) {
        continue;
      }
      NumberVector vec=database.get(iter);
      if (raw == null) {
        raw=vec.toArray();
      }
      for (int j=0; j < raw.length; j++) {
        raw[j]+=vec.doubleValue(j);
      }
      count++;
    }
    newMeans[i]=(raw != null) ? VMath.timesEquals(raw,1.0 / count) : means[i];
  }
  return newMeans;
}

protected double [ ] [ ] meansWithTreshhold ( List < ? extends ModifiableDoubleDBIDList > clusters , double [ ] [ ] means , Relation < V > database , Double tresh ) { double [ ] [ ] newMeans = new double [ k ] [ ] ; for ( int i = 0 ; i < k ; i ++ ) { DoubleDBIDList list = clusters . get ( i ) ; double [ ] raw = null ; int count = 0 ; for ( DoubleDBIDListIter iter = list . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { if ( iter . doubleValue ( ) >= tresh ) { continue ; } NumberVector vec = database . get ( iter ) ; if ( raw == null ) { raw = vec . toArray ( ) ; } for ( int j = 0 ; j < raw . length ; j ++ ) { raw [ j ] += vec . doubleValue ( j ) ; } count ++ ; } newMeans [ i ] = ( raw != null ) ? VMath . timesEquals ( raw , 1.0 / count ) : means [ i ] ; } return newMeans ; }
returns the mean vectors of the given clusters in the given database .
