X-Git-Url: https://git.auder.net/assets/bundles/framework/images/grey_magnifier.png?a=blobdiff_plain;f=old_C_code%2Fwrapper.R;fp=old_C_code%2Fstage1%2Fwrapper.R;h=ee15a7988b2a77c00179bc518871a7cd9dd9cfcb;hb=14cb6cf8266c0e1299f16a4b2352f54dbae26f44;hp=ec859dce8e93ba6471252a1929fbbe100049dacb;hpb=5edda192f1a634ba284acdea7b6302f60df7b000;p=epclust.git diff --git a/old_C_code/stage1/wrapper.R b/old_C_code/wrapper.R similarity index 89% rename from old_C_code/stage1/wrapper.R rename to old_C_code/wrapper.R index ec859dc..ee15a79 100644 --- a/old_C_code/stage1/wrapper.R +++ b/old_C_code/wrapper.R @@ -1,6 +1,8 @@ ppam_exe = function(path=".", np=parallel::detectCores(), data=NULL, - args="DontLetMeEmptyPlease!") + nbSeriesPerChunk, nbClusters, randomize=1, p_dissims=2) { + args = paste(nbSeriesPerChunk," ",nbClusters," ",randomize," ",p_dissims,sep="") + command_line = paste("mpirun -np ",np," ",path,"/ppam.exe cluster",sep="") #if data provided (as data.frame or matrix...): binarize it, and add it as first argument @@ -46,8 +48,9 @@ serialize = function(path=".", csvSeries, binSeries, byCols=0, nbSeries=0) sep="")) } -deserialize = function(path=".", binSeries, csvSeries, ranks="-1") +deserialize = function(path=".", binSeries, csvSeries, ranks="-1", return=TRUE) { system(paste(path,"/ppam.exe deserialize ",binSeries," ",csvSeries," ",ranks,sep="")) - return ( read.table(csvSeries, sep=",") ) + if (return) + return ( read.table(csvSeries, sep=",") ) }