[Genabel-commits] r825 - in pkg/GenABEL/src: . GAlib

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 7 12:07:40 CET 2011


Author: yurii
Date: 2011-12-07 12:07:40 +0100 (Wed, 07 Dec 2011)
New Revision: 825

Modified:
   pkg/GenABEL/src/GAlib/gwaa.c
   pkg/GenABEL/src/GAlib/reg1.h
   pkg/GenABEL/src/Makevars
Log:
get rid of 'printf's

Modified: pkg/GenABEL/src/GAlib/gwaa.c
===================================================================
--- pkg/GenABEL/src/GAlib/gwaa.c	2011-12-07 10:55:53 UTC (rev 824)
+++ pkg/GenABEL/src/GAlib/gwaa.c	2011-12-07 11:07:40 UTC (rev 825)
@@ -56,13 +56,14 @@
 		for (j=0;j<4;j++) {
 			gt[idx] = str & msk[j]; 
 			gt[idx++] >>= ofs[j];
-			printf("%i (%i);",idx-1,gt[idx-1]);
+			//printf("%i (%i);",idx-1,gt[idx-1]);
 			if (idx>=nids) {idx=0;break;}
 		}
 	}
-	printf("going out of decomp...\n");
+	//printf("going out of decomp...\n");
 }
 
+/*
 void temp(char *indata, int *Nids, int *g) {
 	int i;
 	int nids = (*Nids);
@@ -71,6 +72,7 @@
 	for (i=0;i<nids;i++) printf("%i ",g[i]);
 	printf("\n");
 }
+*/
 
 void get_snps_many(char *a, int *Nsnps, int *Nrows, int *b) {
 	int i,j,m,idx=0;

Modified: pkg/GenABEL/src/GAlib/reg1.h
===================================================================
--- pkg/GenABEL/src/GAlib/reg1.h	2011-12-07 10:55:53 UTC (rev 824)
+++ pkg/GenABEL/src/GAlib/reg1.h	2011-12-07 11:07:40 UTC (rev 825)
@@ -18,13 +18,13 @@
 		mematrix<double> tXX = tX*(rdata.X);
 
 		double N = tXX.get(0,0);
-		if (verbose) {printf("tXX:\n");tXX.print();}
+		if (verbose) {Rprintf("tXX:\n");tXX.print();}
 		mematrix<double> tXX_i = invert(tXX);
-		if (verbose) {printf("tXX-1:\n");tXX_i.print();}
+		if (verbose) {Rprintf("tXX-1:\n");tXX_i.print();}
 		mematrix<double> tXY = tX*(rdata.Y);
-		if (verbose) {printf("tXY:\n");tXY.print();}
+		if (verbose) {Rprintf("tXY:\n");tXY.print();}
 		beta = tXX_i*tXY;
-		if (verbose) {printf("beta:\n");(beta).print();}
+		if (verbose) {Rprintf("beta:\n");(beta).print();}
 
 		// now compute residual variance
 		sigma2 = 0.;
@@ -37,14 +37,14 @@
 			sigma2 += (beta.get(i,0)) * (beta.get(j,0)) * tXX.get(i,j);
 		sigma2 /= (N - double(length_beta));
 
-		if (verbose) {printf("sigma2 = %Lf\n",sigma2);}
+		if (verbose) {Rprintf("sigma2 = %Lf\n",sigma2);}
 
 		for (int i=0;i<(length_beta);i++)
 		{	
 			double value = sqrt(sigma2*tXX_i.get(i,i));
 			sebeta.put(value,i,0);
 		}
-		if (verbose) {printf("sebeta (%d):\n",sebeta.nrow);sebeta.print();}
+		if (verbose) {Rprintf("sebeta (%d):\n",sebeta.nrow);sebeta.print();}
 	}
 	~linear_reg()
 	{
@@ -106,18 +106,18 @@
 
 //			printMatr(productMatrDiag(tX,W));
 			mematrix<double> tmp = productMatrDiag(tX,W);
-			if (verbose) {printf("tXW:\n");tmp.print();}
+			if (verbose) {Rprintf("tXW:\n");tmp.print();}
 			mematrix<double> tXWX = tmp*(rdata.X);
 			N = tXWX.get(0,0);
 
-			if (verbose) {printf("tXWX:\n");tXWX.print();}
+			if (verbose) {Rprintf("tXWX:\n");tXWX.print();}
 			tXWX_i=invert(tXWX);
-			if (verbose) {printf("tXWX-1:\n");tXWX_i.print();}
+			if (verbose) {Rprintf("tXWX-1:\n");tXWX_i.print();}
 			mematrix<double> tmp1 = productMatrDiag(tX,W);
 			mematrix<double> tXWz = tmp1*z;
-			if (verbose) {printf("tXWz:\n");tXWz.print();}
+			if (verbose) {Rprintf("tXWz:\n");tXWz.print();}
 			beta = tXWX_i*tXWz;
-			if (verbose) {printf("beta:\n");beta.print();}
+			if (verbose) {Rprintf("beta:\n");beta.print();}
 	
 		}
 		sigma2 = 0.;
@@ -127,7 +127,7 @@
 			double value = sqrt(tXWX_i.get(i,i));
 			sebeta.put(value,i,0);
 		}
-		if (verbose) {printf("sebeta (%d):\n",sebeta.nrow);sebeta.print();}
+		if (verbose) {Rprintf("sebeta (%d):\n",sebeta.nrow);sebeta.print();}
 	}
 	~logistic_reg()
 	{

Modified: pkg/GenABEL/src/Makevars
===================================================================
--- pkg/GenABEL/src/Makevars	2011-12-07 10:55:53 UTC (rev 824)
+++ pkg/GenABEL/src/Makevars	2011-12-07 11:07:40 UTC (rev 825)
@@ -1,4 +1,4 @@
-PKG_CXXFLAGS=-DCOMPILE_WITH_R# -Wall -pedantic
+PKG_CXXFLAGS=-DCOMPILE_WITH_R -Wall -pedantic
 
 all: $(SHLIB) cleanNoSo
 



More information about the Genabel-commits mailing list