forgot to pass parll arg
[epclust.git] / epclust / R / clustering.R
index 74d009e..14e1f83 100644 (file)
@@ -121,10 +121,7 @@ computeSynchrones = function(medoids, getRefSeries,
        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
@@ -184,14 +181,16 @@ computeWerDists = function(synchrones, ncores_clust=1,verbose=FALSE,parll=TRUE)
                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