Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /src/modules/glm/samplers/GLMMethod.cc [01a998] .. [081fbe] Maximize Restore

  Switch to side-by-side view

--- a/src/modules/glm/samplers/GLMMethod.cc
+++ b/src/modules/glm/samplers/GLMMethod.cc
@@ -328,7 +328,7 @@
 	cholmod_free_sparse(&Alik, glm_wk);
     }
 
-    void GLMMethod::updateLM(RNG *rng, bool stochastic, bool chol) 
+    void GLMMethod::updateLM(RNG *rng, bool stochastic) 
     {
 	//   The log of the full conditional density takes the form
 	//   -(t(x) %*% A %*% x - 2 * b %*% x)/2
@@ -357,8 +357,7 @@
 	}
 
 	// Use the LDL' decomposition to generate a new sample
-	// with mean mu such that A %*% mu = b and precision A. The
-	// vector b is overwritten with the result
+	// with mean mu such that A %*% mu = b and precision A. 
 	
 	unsigned int nrow = _view->length();
 	cholmod_dense *w = cholmod_allocate_dense(nrow, 1, nrow, CHOLMOD_REAL, 
@@ -371,15 +370,9 @@
 	    wx[i] = b[perm[i]];
 	}
 
-	cholmod_dense *u1 = 0;
-	if (chol) {
-	    u1 = cholmod_solve(CHOLMOD_L, _factor, w, glm_wk);
-	    updateAuxiliary(u1, _factor, rng);
-	}
-	else {
-	    updateAuxiliary(w, _factor, rng);
-	    u1 = cholmod_solve(CHOLMOD_L, _factor, w, glm_wk);
-	}
+	cholmod_dense *u1 = cholmod_solve(CHOLMOD_L, _factor, w, glm_wk);
+	updateAuxiliary(u1, _factor, rng);
+
 	if (stochastic) {
 	    double *u1x = static_cast<double*>(u1->x);
 	    if (_factor->is_ll) {