[Rcpp-commits] r4377 - in pkg/Rcpp: . R inst inst/include/Rcpp inst/include/Rcpp/macros inst/include/Rcpp/module inst/include/Rcpp/traits inst/include/Rcpp/vector inst/unitTests inst/unitTests/cpp
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jul 2 10:35:37 CEST 2013
Author: romain
Date: 2013-07-02 10:35:37 +0200 (Tue, 02 Jul 2013)
New Revision: 4377
Added:
pkg/Rcpp/inst/unitTests/cpp/Function.cpp
pkg/Rcpp/inst/unitTests/cpp/Matrix.cpp
Modified:
pkg/Rcpp/ChangeLog
pkg/Rcpp/R/unit.tests.R
pkg/Rcpp/inst/NEWS.Rd
pkg/Rcpp/inst/include/Rcpp/as.h
pkg/Rcpp/inst/include/Rcpp/macros/module.h
pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h
pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h
pkg/Rcpp/inst/include/Rcpp/vector/Vector.h
pkg/Rcpp/inst/unitTests/cpp/Vector.cpp
pkg/Rcpp/inst/unitTests/runit.DataFrame.R
pkg/Rcpp/inst/unitTests/runit.Function.R
pkg/Rcpp/inst/unitTests/runit.Language.R
pkg/Rcpp/inst/unitTests/runit.Matrix.R
pkg/Rcpp/inst/unitTests/runit.Vector.R
pkg/Rcpp/inst/unitTests/runit.as.R
pkg/Rcpp/inst/unitTests/runit.environments.R
Log:
supporting as<T&> and as<const T&> when T is module exposed
Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog 2013-06-30 20:12:33 UTC (rev 4376)
+++ pkg/Rcpp/ChangeLog 2013-07-02 08:35:37 UTC (rev 4377)
@@ -1,3 +1,25 @@
+2013-07-02 Romain Francois <romain at r-enthusiasts.com>
+
+ * include/Rcpp/vector/Vector.h: fill__dispatch was mispelled (as
+ fill_dispatch) for the non trivial case, so it did not work
+ * unitTests/runit.Matrix.R: using sourceCpp
+ * unitTests/runit.Vector.R: testing List( int, IntegerVector ) which
+ eventually uses fill__dispatch
+ * include/Rcpp/traits/r_type_traits.h: support for as<T&> and as<const T&>
+ when T is module exposed
+ * include/Rcpp/as.h: as<T&> and as<const T&> when T is module exposed
+ * include/Rcpp/module/Module_generated_CppFunction.h: removed the
+ remove_const_and_reference since as<T&> and as<const T&> is supported
+
+2013-07-01 Romain Francois <romain at r-enthusiasts.com>
+
+ * R/unit.test.R: added helper function Rcpp:::unit_test_setup to avoid
+ some boiler plate code in unit test files. See e.g. runit.Function.R for
+ an example
+ * unitTests/runit.as.R: using sourceCpp
+ * unitTests/runit.Function.R: using sourceCpp
+ * unitTests/runit.DataFrame.R: remove dependency on datasets
+
2013-06-25 Dirk Eddelbuettel <edd at debian.org>
* src/api.cpp: Also test for #defined(__sun) when checking for system
Modified: pkg/Rcpp/R/unit.tests.R
===================================================================
--- pkg/Rcpp/R/unit.tests.R 2013-06-30 20:12:33 UTC (rev 4376)
+++ pkg/Rcpp/R/unit.tests.R 2013-07-02 08:35:37 UTC (rev 4377)
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
+# Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
@@ -37,3 +37,16 @@
)
fun
}
+
+unit_test_setup <- function(file, packages = NULL) {
+ function(){
+ if( !is.null(packages) ){
+ for( p in packages ){
+ suppressMessages( require( p, character.only = TRUE ) )
+ }
+ }
+ if (!exists("pathRcppTests")) pathRcppTests <- getwd()
+ sourceCpp(file.path(pathRcppTests, "cpp", file ))
+ }
+}
+
Modified: pkg/Rcpp/inst/NEWS.Rd
===================================================================
--- pkg/Rcpp/inst/NEWS.Rd 2013-06-30 20:12:33 UTC (rev 4376)
+++ pkg/Rcpp/inst/NEWS.Rd 2013-07-02 08:35:37 UTC (rev 4377)
@@ -10,8 +10,17 @@
\item Add \code{#defined(__sun)} to lists of operating systems to
test for when checking for lack of \code{backtrace()} needed for
stack traces.
+ \item \code{as<T&>} and \code{as<const T&>} is now supported, when
+ T is a class exposed by modules, i.e. with \code{RCPP_EXPOSED_CLASS}
}
+ \item Changes in Modules:
+ \itemize{
+ \item We can now expose functions and methods that take
+ \code{T&} or \code{const T&} as arguments. In these situations
+ objects are no longer copied as they used to be.
+ }
+
\item Deprecation of \code{RCPP_FUNCTION_*}:
\itemize{
\item The macros from the \code{preprocessor_generated.h}
Modified: pkg/Rcpp/inst/include/Rcpp/as.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/as.h 2013-06-30 20:12:33 UTC (rev 4376)
+++ pkg/Rcpp/inst/include/Rcpp/as.h 2013-07-02 08:35:37 UTC (rev 4377)
@@ -99,6 +99,20 @@
return *obj ;
}
+ /** handling T such that T is a reference of a class handled by a module */
+ template <typename T> T as(SEXP x, ::Rcpp::traits::r_type_module_object_reference_tag ){
+ typedef typename traits::remove_reference<T>::type KLASS ;
+ KLASS* obj = as_module_object<KLASS>(x) ;
+ return *obj ;
+ }
+
+ /** handling T such that T is a reference of a class handled by a module */
+ template <typename T> T as(SEXP x, ::Rcpp::traits::r_type_module_object_const_reference_tag ){
+ typedef typename traits::remove_const_and_reference<T>::type KLASS ;
+ KLASS* obj = as_module_object<KLASS>(x) ;
+ return const_cast<T>( *obj ) ;
+ }
+
/** handling enums by converting to int first */
template <typename T> T as(SEXP x, ::Rcpp::traits::r_type_enum_tag ){
return T( primitive_as<int>(x) ) ;
Modified: pkg/Rcpp/inst/include/Rcpp/macros/module.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/macros/module.h 2013-06-30 20:12:33 UTC (rev 4376)
+++ pkg/Rcpp/inst/include/Rcpp/macros/module.h 2013-07-02 08:35:37 UTC (rev 4377)
@@ -2,7 +2,8 @@
//
// macros.h: Rcpp R/C++ interface class library -- helper macros for Rcpp modules
//
-// Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2012-2013 Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2013 Rice University
//
// This file is part of Rcpp.
//
@@ -26,7 +27,19 @@
* as a parameter of a function or method exposed by modules. This defines
* the necessary trait that makes the class as<>'able
*/
-#define RCPP_EXPOSED_AS(CLASS) namespace Rcpp{ namespace traits{ template<> struct r_type_traits< CLASS >{ typedef r_type_module_object_tag r_category ; } ; }}
+#define RCPP_EXPOSED_AS(CLASS) \
+ namespace Rcpp{ namespace traits{ \
+ template<> struct r_type_traits< CLASS >{ \
+ typedef r_type_module_object_tag r_category ; \
+ } ; \
+ template<> struct r_type_traits< CLASS& >{ \
+ typedef r_type_module_object_reference_tag r_category ; \
+ } ; \
+ template<> struct r_type_traits< const CLASS& >{ \
+ typedef r_type_module_object_const_reference_tag r_category ; \
+ } ; \
+ }}
+
#define RCPP_EXPOSED_WRAP(CLASS) namespace Rcpp{ namespace traits{ template<> struct wrap_type_traits< CLASS >{typedef wrap_type_module_object_tag wrap_category ; } ; }}
#define RCPP_EXPOSED_CLASS_NODECL(CLASS) \
Modified: pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h 2013-06-30 20:12:33 UTC (rev 4376)
+++ pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h 2013-07-02 08:35:37 UTC (rev 4377)
@@ -27,9 +27,7 @@
public:
CppFunction0(OUT (*fun)(void), const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP*) {
- BEGIN_RCPP
return Rcpp::module_wrap<OUT>( ptr_fun() ) ;
- END_RCPP
}
inline int nargs(){ return 0; }
@@ -47,9 +45,8 @@
CppFunction0(void (*fun)(void), const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){} ;
SEXP operator()(SEXP*) {
- BEGIN_RCPP
ptr_fun() ;
- END_RCPP
+ return R_NilValue ;
}
inline int nargs(){ return 0; }
@@ -67,9 +64,7 @@
public:
CppFunction_WithFormals0(OUT (*fun)(void), Rcpp::List, const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP*) {
- BEGIN_RCPP
return Rcpp::module_wrap<OUT>( ptr_fun() ) ;
- END_RCPP
}
inline int nargs(){ return 0; }
@@ -87,9 +82,8 @@
CppFunction_WithFormals0(void (*fun)(void), Rcpp::List, const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){} ;
SEXP operator()(SEXP*) {
- BEGIN_RCPP
ptr_fun() ;
- END_RCPP
+ return R_NilValue ;
}
inline int nargs(){ return 0; }
@@ -108,9 +102,7 @@
CppFunction1(OUT (*fun)(U0) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ) ) ) ;
}
inline int nargs(){ return 1; }
@@ -127,9 +119,8 @@
CppFunction1(void (*fun)(U0) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 1; }
@@ -151,9 +142,7 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ) ) ) ;
}
inline int nargs(){ return 1; }
@@ -173,9 +162,8 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 1; }
@@ -197,9 +185,7 @@
CppFunction2(OUT (*fun)(U0, U1) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ) ) ) ;
}
inline int nargs(){ return 2; }
@@ -216,9 +202,8 @@
CppFunction2(void (*fun)(U0, U1) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 2; }
@@ -240,9 +225,7 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ) ) ) ;
}
inline int nargs(){ return 2; }
@@ -262,9 +245,8 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 2; }
@@ -286,9 +268,7 @@
CppFunction3(OUT (*fun)(U0, U1, U2) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ) ) ) ;
}
inline int nargs(){ return 3; }
@@ -305,9 +285,8 @@
CppFunction3(void (*fun)(U0, U1, U2) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 3; }
@@ -329,9 +308,7 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ) ) ) ;
}
inline int nargs(){ return 3; }
@@ -351,9 +328,8 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 3; }
@@ -375,9 +351,7 @@
CppFunction4(OUT (*fun)(U0, U1, U2, U3) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ) ) ) ;
}
inline int nargs(){ return 4; }
@@ -394,9 +368,8 @@
CppFunction4(void (*fun)(U0, U1, U2, U3) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 4; }
@@ -418,9 +391,7 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ) ) ) ;
}
inline int nargs(){ return 4; }
@@ -440,9 +411,8 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 4; }
@@ -464,9 +434,7 @@
CppFunction5(OUT (*fun)(U0, U1, U2, U3, U4) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ) ) ) ;
}
inline int nargs(){ return 5; }
@@ -483,9 +451,8 @@
CppFunction5(void (*fun)(U0, U1, U2, U3, U4) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 5; }
@@ -507,9 +474,7 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ) ) ) ;
}
inline int nargs(){ return 5; }
@@ -529,9 +494,8 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 5; }
@@ -553,9 +517,7 @@
CppFunction6(OUT (*fun)(U0, U1, U2, U3, U4, U5) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ) ) ) ;
}
inline int nargs(){ return 6; }
@@ -572,9 +534,8 @@
CppFunction6(void (*fun)(U0, U1, U2, U3, U4, U5) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 6; }
@@ -596,9 +557,7 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ) ) ) ;
}
inline int nargs(){ return 6; }
@@ -618,9 +577,8 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 6; }
@@ -642,9 +600,7 @@
CppFunction7(OUT (*fun)(U0, U1, U2, U3, U4, U5, U6) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6 >::type >( args[6] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ), Rcpp::as< U6 >( args[6] ) ) ) ;
}
inline int nargs(){ return 7; }
@@ -661,9 +617,8 @@
CppFunction7(void (*fun)(U0, U1, U2, U3, U4, U5, U6) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6>::type >( args[6] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ), Rcpp::as< U6 >( args[6] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 7; }
@@ -685,9 +640,7 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6 >::type >( args[6] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ), Rcpp::as< U6 >( args[6] ) ) ) ;
}
inline int nargs(){ return 7; }
@@ -707,9 +660,8 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6>::type >( args[6] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ), Rcpp::as< U6 >( args[6] ) ) ;
+ return R_NilValue ;
}
inline int nargs(){ return 7; }
@@ -731,9 +683,7 @@
CppFunction8(OUT (*fun)(U0, U1, U2, U3, U4, U5, U6, U7) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6 >::type >( args[6] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U7 >::type >( args[7] ) ) ) ;
- END_RCPP
+ return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ), Rcpp::as< U6 >( args[6] ), Rcpp::as< U7 >( args[7] ) ) ) ;
}
inline int nargs(){ return 8; }
@@ -750,9 +700,8 @@
CppFunction8(void (*fun)(U0, U1, U2, U3, U4, U5, U6, U7) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- BEGIN_RCPP
- ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6>::type >( args[6] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U7>::type >( args[7] ) ) ;
- END_RCPP
+ ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ), Rcpp::as< U6 >( args[6] ), Rcpp::as< U7 >( args[7] ) ) ;
+ return R_NilValue ;
}
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/rcpp -r 4377
More information about the Rcpp-commits
mailing list