From: Benjamin Auder Date: Thu, 23 Feb 2017 15:34:51 +0000 (+0100) Subject: facilitate test X-Git-Url: https://git.auder.net/variants/img/doc/html/pieces/cn.svg?a=commitdiff_plain;h=825cf55fc9827ba99b6d771b513545d297234897;p=valse.git facilitate test --- diff --git a/src/test/Makefile b/src/test/Makefile index d582826..26d9bc6 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -36,6 +36,6 @@ clean: rm -f *.o ../sources/*.o ../adapters/*.o cclean: clean - rm -f $(LIB) $(TESTS) + rm -f *.so $(TESTS) .PHONY: all clean cclean diff --git a/src/test/generate_test_data/generateRunSaveTest_EMGLLF.R b/src/test/generate_test_data/generateRunSaveTest_EMGLLF.R index 49e2258..ff797dc 100644 --- a/src/test/generate_test_data/generateRunSaveTest_EMGLLF.R +++ b/src/test/generate_test_data/generateRunSaveTest_EMGLLF.R @@ -1,7 +1,9 @@ +source("helpers/EMGLLF.R") + generateRunSaveTest_EMGLLF = function(n=200, p=15, m=10, k=3, mini=5, maxi=10, gamma=1., lambda=0.5, tau=1e-6) { - testFolder = "data/" + testFolder = "../data/" dir.create(testFolder, showWarnings=FALSE, mode="0755") require(valse) @@ -31,7 +33,7 @@ generateRunSaveTest_EMGLLF = function(n=200, p=15, m=10, k=3, mini=5, maxi=10, row.names=F, col.names=F) write.table(as.double(tau), paste(testFolder,"tau",sep=""), row.names=F, col.names=F) - write.table(as.integer(c(n,p,m,k)), paste(testFolder,"dimensxyns",sep=""), + write.table(as.integer(c(n,p,m,k)), paste(testFolder,"dimensions",sep=""), row.names=F, col.names=F) res = EMGLLF(params$phiInit,params$rhoInit,params$piInit,params$gamInit,mini,maxi, diff --git a/src/test/generate_test_data/generateRunSaveTest_EMGrank.R b/src/test/generate_test_data/generateRunSaveTest_EMGrank.R index a690cf5..246cb58 100644 --- a/src/test/generate_test_data/generateRunSaveTest_EMGrank.R +++ b/src/test/generate_test_data/generateRunSaveTest_EMGrank.R @@ -1,3 +1,5 @@ +source("helpers/EMGrank.R") + generateRunSaveTest_EMGrank = function(n=200, p=15, m=10, k=3, mini=5, maxi=10, gamma=1.0, rank = c(1,2,4)) { @@ -9,7 +11,7 @@ generateRunSaveTest_EMGrank = function(n=200, p=15, m=10, k=3, mini=5, maxi=10, require(valse) xy = valse:::generateXYdefault(n, p, m, k) - testFolder = "data/" + testFolder = "../data/" dir.create(testFolder, showWarnings=FALSE, mode="0755") #save inputs write.table(as.double(rho), paste(testFolder,"rho",sep=""), @@ -28,7 +30,7 @@ generateRunSaveTest_EMGrank = function(n=200, p=15, m=10, k=3, mini=5, maxi=10, row.names=F, col.names=F) write.table(as.integer(rank), paste(testFolder,"rank",sep=""), row.names=F, col.names=F) - write.table(as.integer(c(n,p,m,k)), paste(testFolder,"dimensxyns",sep=""), + write.table(as.integer(c(n,p,m,k)), paste(testFolder,"dimensions",sep=""), row.names=F, col.names=F) res = EMGrank(pi,rho,mini,maxi,xy$X,xy$Y,tau,rank) diff --git a/src/test/generate_test_data/generateRunSaveTest_constructionModelesLassoMLE.R b/src/test/generate_test_data/generateRunSaveTest_constructionModelesLassoMLE.R index 210fe3c..dbce359 100644 --- a/src/test/generate_test_data/generateRunSaveTest_constructionModelesLassoMLE.R +++ b/src/test/generate_test_data/generateRunSaveTest_constructionModelesLassoMLE.R @@ -1,3 +1,5 @@ +source("helpers/constructionModelesLassoMLE.R") + generateRunSaveTest_constructionModelesLassoMLE = function(n=200, p=15, m=10, k=3, mini=5, maxi=10, gamma=1.0, glambda=list(0.0,0.01,0.02,0.03,0.05,0.1,0.2,0.3,0.5,0.7,0.85,0.99)) { @@ -17,7 +19,7 @@ generateRunSaveTest_constructionModelesLassoMLE = function(n=200, p=15, m=10, k= params = valse:::basicInitParameters(n, p, m, k) xy = valse:::generateXYdefault(n, p, m, k) - testFolder = "data/" + testFolder = "../data/" dir.create(testFolder, showWarnings=FALSE, mode="0755") #save inputs write.table(as.double(params$phiInit), paste(testFolder,"phiInit",sep=""), diff --git a/src/test/generate_test_data/generateRunSaveTest_constructionModelesLassoRank.R b/src/test/generate_test_data/generateRunSaveTest_constructionModelesLassoRank.R index 7dd7a2e..559bd9e 100644 --- a/src/test/generate_test_data/generateRunSaveTest_constructionModelesLassoRank.R +++ b/src/test/generate_test_data/generateRunSaveTest_constructionModelesLassoRank.R @@ -1,3 +1,5 @@ +source("helpers/constructionModelesLassoRank.R") + generateRunSaveTest_constructionModelesLassoRank = function(n=200, p=15, m=10, k=3, L=12, mini=5, maxi=10, gamma=1.0, rangmin=3, rangmax=6) { @@ -13,7 +15,7 @@ generateRunSaveTest_constructionModelesLassoRank = function(n=200, p=15, m=10, k require(valse) xy = valse:::generateXYdefault(n, p, m, k) - testFolder = "data/" + testFolder = "../data/" dir.create(testFolder, showWarnings=FALSE, mode="0755") #save inputs write.table(as.double(pi), paste(testFolder,"pi",sep=""),