private void updateClusterCenters(){
  int j=0;
  final List<CentroidCluster<T>> newClusters=new ArrayList<CentroidCluster<T>>(k);
  for (  final CentroidCluster<T> cluster : clusters) {
    final Clusterable center=cluster.getCenter();
    int i=0;
    double[] arr=new double[center.getPoint().length];
    double sum=0.0;
    for (    final T point : points) {
      final double u=FastMath.pow(membershipMatrix[i][j],fuzziness);
      final double[] pointArr=point.getPoint();
      for (int idx=0; idx < arr.length; idx++) {
        arr[idx]+=u * pointArr[idx];
      }
      sum+=u;
      i++;
    }
    MathArrays.scaleInPlace(1.0 / sum,arr);
    newClusters.add(new CentroidCluster<T>(new DoublePoint(arr)));
    j++;
  }
  clusters.clear();
  clusters=newClusters;
}

private void updateClusterCenters ( ) { int j = 0 ; final List < CentroidCluster < T > > newClusters = new ArrayList < CentroidCluster < T > > ( k ) ; for ( final CentroidCluster < T > cluster : clusters ) { final Clusterable center = cluster . getCenter ( ) ; int i = 0 ; double [ ] arr = new double [ center . getPoint ( ) . length ] ; double sum = 0.0 ; for ( final T point : points ) { final double u = FastMath . pow ( membershipMatrix [ i ] [ j ] , fuzziness ) ; final double [ ] pointArr = point . getPoint ( ) ; for ( int idx = 0 ; idx < arr . length ; idx ++ ) { arr [ idx ] += u * pointArr [ idx ] ; } sum += u ; i ++ ; } MathArrays . scaleInPlace ( 1.0 / sum , arr ) ; newClusters . add ( new CentroidCluster < T > ( new DoublePoint ( arr ) ) ) ; j ++ ; } clusters . clear ( ) ; clusters = newClusters ; }
update the cluster centers .
