for (inds in indices_workers)
{
if (verbose)
- {
- cat(paste("--- Compute synchrones for indices range ",
- min(inds)," -> ",max(inds),"\n", sep=""))
- }
+ cat(paste("--- Compute synchrones for ",length(inds)," lines\n", sep=""))
if (parll)
ignored <- parallel::mcparallel(computeSynchronesChunk(inds))
else
ts.cwt = totts.cwt[,s0log:(s0log+noctave*nvoice)]
#Normalization
sqs <- sqrt(2^(0:(noctave*nvoice)/nvoice)*s0)
- sqres <- sweep(ts.cwt,MARGIN=2,sqs,'*')
+ sqres <- sweep(ts.cwt,2,sqs,'*')
sqres / max(Mod(sqres))
}
if (parll)
{
cl = parallel::makeCluster(ncores_clust)
- parallel::clusterExport(cl, varlist=c("getContribs","K1","verbose"), envir=environment())
+ parallel::clusterExport(cl,
+ varlist=c("synchrones","totnoct","nvoice","w0","s0log","noctave","s0","verbose"),
+ envir=environment())
}
# (normalized) observations node with CWT
if (verbose)
cat("...Run final // stage 1 + stage 2\n")
indices_medoids = clusteringTask1(
- indices, getContribs, K1, nb_series_per_chunk, ncores_tasks*ncores_clust, verbose)
- medoids = computeClusters2(getSeries(indices_medoids),
- K2, getRefSeries, nb_curves, nb_series_per_chunk, ncores_tasks*ncores_clust, verbose)
+ indices, getContribs, K1, nb_series_per_chunk, ncores_tasks*ncores_clust, verbose, parll)
+ medoids = computeClusters2(getSeries(indices_medoids), K2,
+ getRefSeries, nb_curves, nb_series_per_chunk, ncores_tasks*ncores_clust, verbose, parll)
# Cleanup
unlink(bin_dir, recursive=TRUE)