[Genabel-commits] r1025 - branches/ProbABEL-refactoring/ProbABEL/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 18 18:52:06 CET 2012


Author: maartenk
Date: 2012-11-18 18:52:06 +0100 (Sun, 18 Nov 2012)
New Revision: 1025

Modified:
   branches/ProbABEL-refactoring/ProbABEL/src/eigen_mematrix.cpp
   branches/ProbABEL-refactoring/ProbABEL/src/main.cpp
   branches/ProbABEL-refactoring/ProbABEL/src/maskedmatrix.cpp
   branches/ProbABEL-refactoring/ProbABEL/src/reg1.cpp
Log:
-fixed eigen_mematrix reorder function
-removed unused variables 

Modified: branches/ProbABEL-refactoring/ProbABEL/src/eigen_mematrix.cpp
===================================================================
--- branches/ProbABEL-refactoring/ProbABEL/src/eigen_mematrix.cpp	2012-11-15 13:54:10 UTC (rev 1024)
+++ branches/ProbABEL-refactoring/ProbABEL/src/eigen_mematrix.cpp	2012-11-18 17:52:06 UTC (rev 1025)
@@ -293,14 +293,16 @@
 {
     if (M.nrow != order.nrow)
     {
-        fprintf(stderr, "reorder: M & order have differet # of rows\n");
+        fprintf(stderr, "reorder: M & order have different # of rows\n");
         exit(1);
     }
     mematrix<DT> temp(M.nrow, M.ncol);
-//FIXME(maarten): commented out to get compilation running
-//    for (int i = 0; i < temp.nrow; i++)
-//        for (int j = 0; j < temp.ncol; j++)
-//            temp.data[order[i] * temp.ncol + j] = M.data[i * M.ncol + j];
+    int source;
+    for (int i = 0; i < temp.nrow; i++)
+    {
+        source = order.data(i, 0);
+        temp.data.row(i) = M.data.row(source);
+    }
     return temp;
 }
 //

Modified: branches/ProbABEL-refactoring/ProbABEL/src/main.cpp
===================================================================
--- branches/ProbABEL-refactoring/ProbABEL/src/main.cpp	2012-11-15 13:54:10 UTC (rev 1024)
+++ branches/ProbABEL-refactoring/ProbABEL/src/main.cpp	2012-11-18 17:52:06 UTC (rev 1025)
@@ -307,8 +307,6 @@
      gendata gtd (input_var.getGenfilename(),nsnps,input_var.getNgpreds(),phd.nids_all,phd.nids,phd.allmeasured,skipd,phd.idnames);
      **/
     // estimate null model
-    //TODO(maarten): remove this unused variable if there is not a reason to keep it
-    //double null_loglik = 0.;
 #if COXPH
     coxph_data nrgd = coxph_data(phd, gtd, -1);
 #else

Modified: branches/ProbABEL-refactoring/ProbABEL/src/maskedmatrix.cpp
===================================================================
--- branches/ProbABEL-refactoring/ProbABEL/src/maskedmatrix.cpp	2012-11-15 13:54:10 UTC (rev 1024)
+++ branches/ProbABEL-refactoring/ProbABEL/src/maskedmatrix.cpp	2012-11-18 17:52:06 UTC (rev 1025)
@@ -23,7 +23,6 @@
 
 masked_matrix::masked_matrix(mematrix<double> M)
 {
-    // TODO Auto-generated constructor stub
     matrix_original = M;
     masked_data = &matrix_original;
     mask_of_old = new unsigned short int[M.nrow];
@@ -33,7 +32,7 @@
     }
     //TODO:set length of mask for all types
     length_of_mask = M.nrow;
-    //TODO:snet type (row,column,symmetric)
+    //TODO:set type (row,column,symmetric)
     //type="symmetric";
 }
 
@@ -55,7 +54,6 @@
 
 masked_matrix::~masked_matrix()
 {
-    // TODO Auto-generated destructor stub
     delete[] mask_of_old;
 }
 void masked_matrix::update_mask(short unsigned int *newmask)
@@ -110,17 +108,12 @@
             for (int j = 0; j < length_of_mask; j++)
                 if (mask_of_old[j] == 0)
                 {
-                    //fprintf(stdout, "val%i %i\n", i1,j1);
                     matrix_masked_data.put(matrix_original.get(i, j), i1, j1);
                     j1++;
                 }
             i1++;
         }
 }
-//mematrix<double>* masked_matrix::get_matrix()
-//{
-// //   return masked_matrix;
-//}
 
 bool masked_matrix::is_equal_array(unsigned short int *a, unsigned short int *b,
         int size)

Modified: branches/ProbABEL-refactoring/ProbABEL/src/reg1.cpp
===================================================================
--- branches/ProbABEL-refactoring/ProbABEL/src/reg1.cpp	2012-11-15 13:54:10 UTC (rev 1024)
+++ branches/ProbABEL-refactoring/ProbABEL/src/reg1.cpp	2012-11-18 17:52:06 UTC (rev 1025)
@@ -584,8 +584,6 @@
      fprintf(stdout,"tXInv %f %f %f\n",tX.get(0,0),tX.get(1,0),tX.get(2,0));
      if (X.ncol==4) fprintf(stdout,"X[4] %f\n",tX.get(3,0));
      */
-    //TODO(maarten): remove this unused variable if there is not a reason to keep it
-    //double N;
     niter = 0;
     double delta = 1.;
     double prevlik = 0.;



More information about the Genabel-commits mailing list