[Genabel-commits] r1448 - in branches/ProbABEL-pvals/filevector: . fvlib

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 3 12:59:49 CET 2013


Author: lckarssen
Date: 2013-12-03 12:59:49 +0100 (Tue, 03 Dec 2013)
New Revision: 1448

Modified:
   branches/ProbABEL-pvals/filevector/Makefile
   branches/ProbABEL-pvals/filevector/fvlib/CastUtils.cpp
   branches/ProbABEL-pvals/filevector/fvlib/FilteredMatrix.cpp
Log:
Merged filevector trunk into the p-values branch (r.1375 -- 1447)

Modified: branches/ProbABEL-pvals/filevector/Makefile
===================================================================
--- branches/ProbABEL-pvals/filevector/Makefile	2013-12-03 11:57:37 UTC (rev 1447)
+++ branches/ProbABEL-pvals/filevector/Makefile	2013-12-03 11:59:49 UTC (rev 1448)
@@ -29,7 +29,17 @@
 # use for Solaris
 # CPP = CC
 
-CFLAGS = -I $(LIBDIR) -I $(SRCDIR) -g -Wall -std=c++11 #-m64 
+CFLAGS = -I $(LIBDIR) -I $(SRCDIR) -g -Wall -D_NOT_R_FILEVECTOR #-m64
+
+# Get the gcc version and check if the minor version number is above
+# 7. Before gcc 4.7 the option for -std=c++11 was named -std=c++0x.
+GCCVERSIONGTEQ47 := $(shell expr `gcc -dumpversion | cut -f2 -d.` \>= 7)
+ifeq "$(GCCVERSIONGTEQ47)" "1"
+    CFLAGS += -std=c++11
+else
+    CFLAGS += -std=c++0x
+endif
+
 CPPUNITFLAGS = -lcppunit
 EXECS = $(TEXT2FVF) $(MERGEVARS) ${CONVERT}
 
@@ -86,7 +96,7 @@
 	$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(TESTSDIR)/TestUtil.cpp $(TESTSDIR)/ReusableFileHandleTest.cpp $(CPPUNITFLAGS) -o $(RFHTEST); $(RFHTEST)
 
 converter : $(CONVERT)
-$(CONVERT): $(LIBFILES) $(SRCDIR)/convert.cpp 
+$(CONVERT): $(LIBFILES) $(SRCDIR)/convert.cpp
 	$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/text2fvf.cpp $(SRCDIR)/convert.cpp $(CPPUNITFLAGS) -o $(CONVERT)
 
 transpose :$(TRANSPOSE)
@@ -107,14 +117,14 @@
 	$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/text2fvf.cpp $(TESTSDIR)/TestUtil.cpp $(TESTSDIR)/ConvertTest.cpp $(CPPUNITFLAGS) -o $(CONVERTTEST); $(CONVERTTEST)
 
 buildtestdata : $(BUILDTESTDATA)
-$(BUILDTESTDATA):$(TESTSDIR)/BuildTestData.cpp $(LIBDIR)/*.cpp $(LIBDIR)/*.h 
+$(BUILDTESTDATA):$(TESTSDIR)/BuildTestData.cpp $(LIBDIR)/*.cpp $(LIBDIR)/*.h
 	$(CPP) $(CFLAGS) $(TESTSDIR)/BuildTestData.cpp $(LIBDIR)/*.cpp $(CPPUNITFLAGS) -o $(BUILDTESTDATA)
 
-preparetestdata: buildtestdata 
-	$(BUILDTESTDATA) tests/data/correctnessTestData 33815 1473 100 120; $(BUILDTESTDATA) tests/data/2write/modify_me 1001 1003; 
+preparetestdata: buildtestdata
+	$(BUILDTESTDATA) tests/data/correctnessTestData 33815 1473 100 120; $(BUILDTESTDATA) tests/data/2write/modify_me 1001 1003;
 
 tests : preparetestdata correctnesstest readspeed modificationtest unittest writespeed accessmodetest converttest transposetest
 runtests : tests
 
-tests-clean: 
+tests-clean:
 	rm -rf tests/data/2write/* tests/data/modetests/* tests/data/correctnessTestData.*

Modified: branches/ProbABEL-pvals/filevector/fvlib/CastUtils.cpp
===================================================================
--- branches/ProbABEL-pvals/filevector/fvlib/CastUtils.cpp	2013-12-03 11:57:37 UTC (rev 1447)
+++ branches/ProbABEL-pvals/filevector/fvlib/CastUtils.cpp	2013-12-03 11:59:49 UTC (rev 1448)
@@ -18,12 +18,13 @@
 
 int initConsts(){
   int i;
+  unsigned int ui;
   sscanf("32767","%hi",&SHORT_INT_NAN);
   sscanf("65535","%hu",&UNSIGNED_SHORT_INT_NAN);
   sscanf("2147483647","%i",&INT_NAN);
   sscanf("4294967295","%u",&UNSIGNED_INT_NAN);
   sscanf("127","%i",&i); CHAR_NAN = i;
-  sscanf("255","%u",&i); UNSIGNED_CHAR_NAN = i;
+  sscanf("255","%u",&ui); UNSIGNED_CHAR_NAN = ui;
 
   parseFormats[UNSIGNED_SHORT_INT] = "%hu";
   parseFormats[SHORT_INT] = "%hd";
@@ -184,9 +185,17 @@
     	case INT:
     	    return (*(int*) data) == INT_NAN;
     	case FLOAT:
-	  return std::isnan(*(float*) data);
+#ifdef _NOT_R_FILEVECTOR
+			return std::isnan(*(float*) data);
+#else
+			return ISNAN(*(float*) data);
+#endif
     	case DOUBLE:
+#ifdef _NOT_R_FILEVECTOR
 	  return std::isnan(*(double*)data);
+#else
+	  return ISNAN(*(double*)data);
+#endif
     	case UNSIGNED_CHAR:
     	    return (*(unsigned char*) data) == UNSIGNED_CHAR_NAN;
     	case SIGNED_CHAR:

Modified: branches/ProbABEL-pvals/filevector/fvlib/FilteredMatrix.cpp
===================================================================
--- branches/ProbABEL-pvals/filevector/fvlib/FilteredMatrix.cpp	2013-12-03 11:57:37 UTC (rev 1447)
+++ branches/ProbABEL-pvals/filevector/fvlib/FilteredMatrix.cpp	2013-12-03 11:59:49 UTC (rev 1448)
@@ -132,7 +132,7 @@
 
     filterIdxList(obsIndexes, this->getNumObservations(), recodedColIndexes, filteredToRealColIdx);
     filterIdxList(varIndexes, nvars, recodedRowIndexes, filteredToRealRowIdx);
-    delete obsIndexes;
+    delete[] obsIndexes;
 }
 
 void FilteredMatrix::saveObservationsAs( string newFilename, unsigned long nobss, unsigned long * obsIndexes) {



More information about the Genabel-commits mailing list