[Genabel-commits] r1207 - pkg/ProbABEL/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 7 18:50:29 CEST 2013


Author: lckarssen
Date: 2013-05-07 18:50:28 +0200 (Tue, 07 May 2013)
New Revision: 1207

Modified:
   pkg/ProbABEL/src/reg1.cpp
   pkg/ProbABEL/src/reg1.h
Log:
Fix bug #2772 in ProbABEL: "palogist with mmscore crashes (memory issue)". 
The invvarmatrix (actually the inverse correlation matrix in palogist) was copied when being passed on to the estimate() function. Now we pass a reference. 

Actually this was fixed in palinear quite some time ago...


Modified: pkg/ProbABEL/src/reg1.cpp
===================================================================
--- pkg/ProbABEL/src/reg1.cpp	2013-05-07 16:39:54 UTC (rev 1206)
+++ pkg/ProbABEL/src/reg1.cpp	2013-05-07 16:50:28 UTC (rev 1207)
@@ -587,10 +587,10 @@
 void logistic_reg::estimate(regdata& rdatain, int verbose, int maxiter,
                             double eps, double tol_chol, int model,
                             int interaction, int ngpreds,
-                            masked_matrix invvarmatrixin, int robust,
+                            masked_matrix& invvarmatrixin, int robust,
                             int nullmodel)
 {
-    // on the contrast to the 'linear' 'invvarmatrix' contains
+    // In contrast to the 'linear' case 'invvarmatrix' contains the
     // inverse of correlation matrix (not the inverse of var-cov matrix)
     // h2.object$InvSigma * h.object2$h2an$estimate[length(h2$h2an$estimate)]
     // the inverse of var-cov matrix scaled by total variance
@@ -815,7 +815,7 @@
 
 void logistic_reg::score(mematrix<double>& resid, regdata& rdata, int verbose,
                          double tol_chol, int model, int interaction,
-                         int ngpreds, masked_matrix invvarmatrix,
+                         int ngpreds, masked_matrix& invvarmatrix,
                          int nullmodel)
 {
     base_score(resid, rdata, verbose, tol_chol, model, interaction, ngpreds,

Modified: pkg/ProbABEL/src/reg1.h
===================================================================
--- pkg/ProbABEL/src/reg1.h	2013-05-07 16:39:54 UTC (rev 1206)
+++ pkg/ProbABEL/src/reg1.h	2013-05-07 16:50:28 UTC (rev 1207)
@@ -65,12 +65,13 @@
     }
 
     void estimate(regdata& rdatain, int verbose, double tol_chol, int model,
-            int interaction, int ngpreds, masked_matrix& invvarmatrixin,
-            int robust, int nullmodel = 0);
+                  int interaction, int ngpreds,
+                  masked_matrix& invvarmatrixin,
+                  int robust, int nullmodel = 0);
 
     void score(mematrix<double>& resid, regdata& rdatain, int verbose,
-            double tol_chol, int model, int interaction, int ngpreds,
-            const masked_matrix& invvarmatrix, int nullmodel = 0);
+               double tol_chol, int model, int interaction, int ngpreds,
+               const masked_matrix& invvarmatrix, int nullmodel = 0);
 };
 
 class logistic_reg: public base_reg {
@@ -85,12 +86,13 @@
     }
 
     void estimate(regdata& rdatain, int verbose, int maxiter, double eps,
-            double tol_chol, int model, int interaction, int ngpreds,
-            masked_matrix invvarmatrixin, int robust, int nullmodel = 0);
+                  double tol_chol, int model, int interaction, int ngpreds,
+                  masked_matrix& invvarmatrixin, int robust,
+                  int nullmodel = 0);
     // just a stupid copy from linear_reg
     void score(mematrix<double>& resid, regdata& rdata, int verbose,
-            double tol_chol, int model, int interaction, int ngpreds,
-            masked_matrix invvarmatrix, int nullmodel = 0);
+               double tol_chol, int model, int interaction, int ngpreds,
+               masked_matrix& invvarmatrix, int nullmodel = 0);
 };
 
 #endif



More information about the Genabel-commits mailing list