private static boolean incrementalKMeans(MixtureModel f, MixtureModel g, Clustering.CLUSTERING_TYPE type, int[] repartition){
		boolean cond = false;
		int iterations = 0;
		double lf_init = getLossFunction(f, g, type); 
		double lf_min  = lf_init;
		int n = f.size;
		int m = g.size;
		int i;
		int[] rep_opt = new int[n];
		
		MixtureModel g_tmp = new MixtureModel(m);
		
		int[] count = new int[m];
		for (i=0; i<n; i++)
			count[repartition[i]]++;
		

		for (i=0; i<n; i++){
			int[] rep_tmp = Arrays.copyOf(repartition,n);
			int cl = repartition[i];
			if (count[cl]>1){
				for (int j=0; j<m; j++){
					if (j!=cl){
						rep_tmp[i]=j;
						computeCentroids(f, g_tmp, type, rep_tmp );
						double lf = getLossFunction(f, g_tmp, type);
						if (lf<lf_min){
							lf_min = lf;
							rep_opt = Arrays.copyOf(rep_tmp,n);
							iterations++;
							System.out.println(lf_min);
						}
					}
				}
			}
		}

		if ((lf_min/lf_init)<0.98){
			cond=true;
			for (i=0; i<n; i++)
				repartition[i] = rep_opt[i];
			computeCentroids(f, g, type, repartition);
			System.out.println("--> " + getLossFunction(f, g, type));
		}	
		
		return cond;
	}