[Genabel-commits] r1600 - pkg/OmicABEL/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 7 18:32:25 CET 2014


Author: dfabregat
Date: 2014-02-07 18:32:24 +0100 (Fri, 07 Feb 2014)
New Revision: 1600

Modified:
   pkg/OmicABEL/src/REML.c
Log:
Performance improvement for REML estimation.
Reusing precomputed data to replace an expensive
n^2 gemv for a cheaper n*p gemv.


Modified: pkg/OmicABEL/src/REML.c
===================================================================
--- pkg/OmicABEL/src/REML.c	2014-02-06 21:29:08 UTC (rev 1599)
+++ pkg/OmicABEL/src/REML.c	2014-02-07 17:32:24 UTC (rev 1600)
@@ -194,10 +194,15 @@
 	// loglik = a + b
 	//  a -> log(det(M))
 	//  b -> YmXB' inv(M) YmXB
-    dgemv_(TRANS, 
+    /*dgemv_(TRANS, 
             &n, &n, 
             &ONE, Z, &n, YmXB, &iONE,
-            &ZERO, ZtY_upd, &iONE);
+            &ZERO, ZtY_upd, &iONE);*/
+    memcpy( ZtY_upd, ZtY, n * sizeof(double) );
+    dgemv_( NO_TRANS, 
+            &n, &wXL, 
+            &MINUS_ONE, ZtX, &n, beta, &iONE,
+            &ONE, ZtY_upd, &iONE );
 	// YmXB' * inv( M ) * YmXB
 	*loglik = 0.0;
 	for (i = 0; i < n; i++ )



More information about the Genabel-commits mailing list