- min(nb_series_per_chunk*i,length(indices_clust)), length(indices_clust) )
- indices_workers[[i]] = indices_clust[(nb_series_per_chunk*(i-1)+1):upper_bound]
- }
- indices_clust = parallel::parLapply(cl, indices_workers, clusterChunk, K1, K2*(WER=="mix"))
- # TODO: soft condition between K2 and K1, before applying final WER step
- if ((WER=="end" && length(indices_clust)==K1) || (WER=="mix" && length(indices_clust)==K2))
+ min(nb_series_per_chunk*i,length(indices)), length(indices) )
+ indices[(nb_series_per_chunk*(i-1)+1):upper_bound]
+ })
+ indices = unlist( parallel::parLapply(cl, indices_workers, function(inds)
+ computeClusters1(inds, getCoefs, K1)) )
+ if (length(indices_clust) == K1)