[Rcpp-commits] r2394 - in pkg/Rcpp: . inst/include/Rcpp/sugar/block

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 4 19:44:48 CET 2010


Author: romain
Date: 2010-11-04 19:44:47 +0100 (Thu, 04 Nov 2010)
New Revision: 2394

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/sugar/block/SugarMath.h
Log:
improved SUGAR_MATH_1 macro

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2010-11-04 16:42:16 UTC (rev 2393)
+++ pkg/Rcpp/ChangeLog	2010-11-04 18:44:47 UTC (rev 2394)
@@ -5,9 +5,12 @@
 
 2010-11-04  Romain Francois <romain at r-enthusiasts.com>
 
-	* inst/Rcpp/Module.h: experimental way to specify which constructor
+	* inst/include/Rcpp/Module.h: experimental way to specify which constructor
 	to use in classes exposed by modules. This is still too restrictive
 	as it only allows one constructor.
+	
+	* inst/include/Rcpp/sugar/block/SugarMath.h: extend the SUGAR_MATH_1 macro
+	so that we can apply functions (e.g. sqrt) directly on SEXP
 
 2010-11-01  Dirk Eddelbuettel  <edd at debian.org>
 
@@ -60,7 +63,7 @@
 2010-10-20  Dirk Eddelbuettel  <edd at debian.org>
 
 	* include/Rcpp/XPtr.h: Applied patch by Karl Millar
-	* include/Rcpp/vector/Vector.h): Idem
+	* include/Rcpp/vector/Vector.h: Idem
 
 2010-10-19  Dirk Eddelbuettel  <edd at debian.org>
 

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/block/SugarMath.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/block/SugarMath.h	2010-11-04 16:42:16 UTC (rev 2393)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/block/SugarMath.h	2010-11-04 18:44:47 UTC (rev 2394)
@@ -108,6 +108,8 @@
 			&__SYMBOL__ , t                                                   \
 		) ;                                                                  \
 	}                                                                        \
+	inline sugar::SugarMath_1<true,double,double,NumericVector,double(*)(double)>   \
+	__NAME__( SEXP x){ return __NAME__( NumericVector( x ) ) ; }             \
 	template <bool NA, typename T>                                           \
 	inline sugar::SugarMath_1<NA,double,int,T, double (*)(double) >          \
 	__NAME__(                                                                \



More information about the Rcpp-commits mailing list