[Dplr-commits] r818 - in pkg/dplR: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 16 12:49:28 CEST 2014


Author: mvkorpel
Date: 2014-04-16 12:49:27 +0200 (Wed, 16 Apr 2014)
New Revision: 818

Modified:
   pkg/dplR/ChangeLog
   pkg/dplR/DESCRIPTION
   pkg/dplR/R/ffcsaps.R
Log:
Small optimization to ffcsaps()

Modified: pkg/dplR/ChangeLog
===================================================================
--- pkg/dplR/ChangeLog	2014-04-15 12:05:41 UTC (rev 817)
+++ pkg/dplR/ChangeLog	2014-04-16 10:49:27 UTC (rev 818)
@@ -13,6 +13,12 @@
 - Added summary.rwl as an S3Method.
 - Added insert and delete.ring functions.
 
+File: ffcsaps.R
+---------------
+
+- Small optimization: using "usually slightly faster"
+  'tcrossprod(x)' instead of 'x %*% t(x)'
+
 File: insert.ring.R
 -------------------------
 - insert.ring and delete.ring functions for editing rw vectors. Very simple.

Modified: pkg/dplR/DESCRIPTION
===================================================================
--- pkg/dplR/DESCRIPTION	2014-04-15 12:05:41 UTC (rev 817)
+++ pkg/dplR/DESCRIPTION	2014-04-16 10:49:27 UTC (rev 818)
@@ -3,7 +3,7 @@
 Type: Package
 Title: Dendrochronology Program Library in R
 Version: 1.6.0
-Date: 2014-04-15
+Date: 2014-04-16
 Authors at R: c(person("Andy", "Bunn", role = c("aut", "cph",
         "cre", "trl"), email = "andy.bunn at wwu.edu"), person("Mikko",
         "Korpela", role = c("aut", "trl")), person("Franco", "Biondi",

Modified: pkg/dplR/R/ffcsaps.R
===================================================================
--- pkg/dplR/R/ffcsaps.R	2014-04-15 12:05:41 UTC (rev 817)
+++ pkg/dplR/R/ffcsaps.R	2014-04-16 10:49:27 UTC (rev 818)
@@ -124,7 +124,7 @@
     mplier <- 6 - 6 / p.inv # slightly more accurate than 6*(1-1/p.inv)
     ## forR*p is faster than forR/p.inv, and a quick test didn't
     ## show any difference in the final spline
-    u <- solve(mplier * (forR2 %*% t(forR2)) + forR * p,
+    u <- solve(mplier * tcrossprod(forR2) + forR * p,
                diff(diff(yi) / diff.xi))
     yi <- yi - mplier * diff(c(0, diff(c(0, u, 0)) / diff.xi, 0))
     test0 <- xi[-c(1, n)]



More information about the Dplr-commits mailing list