private static void computeRepartition(MixtureModel f, MixtureModel g, Clustering.CLUSTERING_TYPE type, int[] repartition){
		int n = f.size;
		int m = g.size;
		    
		for (int i=0; i<n; i++){

			// Initial values
			int    index = -1;
			double d_min = Double.MAX_VALUE;
						
			// Compute distance between f[i] and g[j]
			for (int j=0; j<m ; j++){
				double d = 0;
				if (type==CLUSTERING_TYPE.RIGHT_SIDED)
					d = f.EF.BD(f.param[i], g.param[j]);
				else if (type==CLUSTERING_TYPE.LEFT_SIDED)
					d = f.EF.BD(g.param[j], f.param[i]);
				else if (type==CLUSTERING_TYPE.SYMMETRIC){
					d = 0.5 * ( f.EF.BD(f.param[i], g.param[j]) + f.EF.BD(g.param[j], f.param[i]) );
				}
				if (d<d_min){
					d_min = d;
					index = j;
				}
			}
			
			// Set the repartition array
			repartition[i] = index;
		}
	}