[Rcpp-commits] r1059 - in pkg/RcppArmadillo: . R inst/unitTests src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 17 14:31:46 CEST 2010


Author: romain
Date: 2010-04-17 14:31:46 +0200 (Sat, 17 Apr 2010)
New Revision: 1059

Modified:
   pkg/RcppArmadillo/DESCRIPTION
   pkg/RcppArmadillo/R/armadillo_version.R
   pkg/RcppArmadillo/R/fastLm.R
   pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R
   pkg/RcppArmadillo/src/RcppArmadillo.cpp
Log:
back to using .Call

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2010-04-17 12:27:36 UTC (rev 1058)
+++ pkg/RcppArmadillo/DESCRIPTION	2010-04-17 12:31:46 UTC (rev 1059)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp/Armadillo translation layer
-Version: 0.1.0.2
+Version: 0.1.0.3
 Date: $Date$
 Author: Romain Francois, Dirk Eddelbuettel and Doug Bates
 Maintainer: Romain, Dirk and Doug <RcppArmadillo-authors at r-enthusiasts.com>
@@ -24,6 +24,6 @@
  capabilities of the Rcpp package for seamless R and C++ integration/
 License: GPL (>= 2)
 LazyLoad: yes
-Depends: Rcpp (>= 0.7.11.5)
+Depends: Rcpp (>= 0.7.12.6)
 LinkingTo: Rcpp
 URL: http://arma.sourceforge.net/, http://dirk.eddelbuettel.com/code/rcpp.html, http://romainfrancois.blog.free.fr/index.php?category/R-package/RcppArmadillo

Modified: pkg/RcppArmadillo/R/armadillo_version.R
===================================================================
--- pkg/RcppArmadillo/R/armadillo_version.R	2010-04-17 12:27:36 UTC (rev 1058)
+++ pkg/RcppArmadillo/R/armadillo_version.R	2010-04-17 12:31:46 UTC (rev 1059)
@@ -16,6 +16,6 @@
 ## along with RcppArmadillo.  If not, see <http://www.gnu.org/licenses/>.
 
 armadillo_version <- function(single = FALSE){
-	.Cpp( "armadillo_version", isTRUE(single), PACKAGE = "RcppArmadillo" )
+	.Call( "armadillo_version", isTRUE(single), PACKAGE = "RcppArmadillo" )
 }
 

Modified: pkg/RcppArmadillo/R/fastLm.R
===================================================================
--- pkg/RcppArmadillo/R/fastLm.R	2010-04-17 12:27:36 UTC (rev 1058)
+++ pkg/RcppArmadillo/R/fastLm.R	2010-04-17 12:31:46 UTC (rev 1059)
@@ -23,7 +23,7 @@
     stopifnot(is.matrix(X))
     stopifnot(nrow(y)==nrow(X))
 
-    res <- .Cpp("fastLm", y, X, package="RcppArmadillo")
+    res <- .Call("fastLm", y, X, package="RcppArmadillo")
 }
 
 ## What would be nice here:

Modified: pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R
===================================================================
--- pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R	2010-04-17 12:27:36 UTC (rev 1058)
+++ pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R	2010-04-17 12:31:46 UTC (rev 1059)
@@ -18,7 +18,7 @@
 # along with RcppArmadillo.  If not, see <http://www.gnu.org/licenses/>.
 
 test.wrap.R <- function(){
-	res <- .Cpp( "RcppArmadillo_wrap", PACKAGE = "RcppArmadillo" )
+	res <- .Call( "RcppArmadillo_wrap", PACKAGE = "RcppArmadillo" )
 
 	checkEquals( res[[1]][[1]], matrix(as.integer((diag(3))),nr=3), msg = "eye<imat>(3,3)" )
 	checkEquals( res[[1]][[2]], diag(3), msg = "eye<mat>(3,3)" )
@@ -36,12 +36,12 @@
 }
 
 test.wrap.Glue <- function(){
-	res <- .Cpp( "RcppArmadillo_wrap_Glue", PACKAGE = "RcppArmadillo" )
+	res <- .Call( "RcppArmadillo_wrap_Glue", PACKAGE = "RcppArmadillo" )
 	checkEquals( res[[1]], 2*diag(3), msg = "wrap(Glue)" )
 }
 
 test.wrap.Op <- function(){
-	res <- .Cpp( "RcppArmadillo_wrap_Op", PACKAGE = "RcppArmadillo" )
+	res <- .Call( "RcppArmadillo_wrap_Op", PACKAGE = "RcppArmadillo" )
 	checkEquals( res[[1]], -1*diag(3), msg = "wrap(Op)" )
 }
 
@@ -49,21 +49,21 @@
 
 	integer_mat <- matrix( as.integer(diag(4)), ncol = 4, nrow = 4 )
 	numeric_mat <- diag(5)
-	res <- .Cpp( "RcppArmadillo_as_Mat",
+	res <- .Call( "RcppArmadillo_as_Mat",
 		list( integer_mat, numeric_mat ),
 		PACKAGE = "RcppArmadillo" )
 	checkEquals( unlist( res), c(4L, 5L, 4L, 5L ), msg = "as<Mat>" )
 }
 
 test.as.Col <- function(){
-	res <- .Cpp( "RcppArmadillo_as_Col",
+	res <- .Call( "RcppArmadillo_as_Col",
 	      list( 1:10, as.numeric(1:10) ),
 	      PACKAGE = "RcppArmadillo" )
 	checkEquals( unlist( res ), rep(55.0, 4 ), msg = "as<Col>" )
 }
 
 test.as.Row <- function(){
-	res <- .Cpp( "RcppArmadillo_as_Row",
+	res <- .Call( "RcppArmadillo_as_Row",
 	      list( 1:10, as.numeric(1:10) ),
 	      PACKAGE = "RcppArmadillo" )
 	checkEquals( unlist( res ), rep(55.0, 4 ), msg = "as<Row>" )
@@ -71,7 +71,7 @@
 
 test.fastLm <- function() {
     data(trees)
-    flm <- .Cpp("fastLm",
+    flm <- .Call("fastLm",
                  log(trees$Volume),
                  cbind(rep(1,31), log(trees$Girth)),
                  PACKAGE="RcppArmadillo")

Modified: pkg/RcppArmadillo/src/RcppArmadillo.cpp
===================================================================
--- pkg/RcppArmadillo/src/RcppArmadillo.cpp	2010-04-17 12:27:36 UTC (rev 1058)
+++ pkg/RcppArmadillo/src/RcppArmadillo.cpp	2010-04-17 12:31:46 UTC (rev 1059)
@@ -159,3 +159,10 @@
     return version ;
 }
 
+#if defined(WIN32)
+#include <R_ext/Rdynload.h>
+void R_init_RcppArmadillo(DllInfo* info){
+	std::set_terminate( forward_uncaught_exceptions_to_r ) ;
+}
+#endif
+



More information about the Rcpp-commits mailing list