[Rcpp-commits] r4487 - in pkg/RcppArmadillo: . inst/include

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 15 15:01:18 CEST 2013


Author: romain
Date: 2013-09-15 15:01:18 +0200 (Sun, 15 Sep 2013)
New Revision: 4487

Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/inst/include/RcppArmadilloAs.h
   pkg/RcppArmadillo/inst/include/RcppArmadilloForward.h
Log:
adapt to Rcpp changes

Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2013-09-15 12:59:41 UTC (rev 4486)
+++ pkg/RcppArmadillo/ChangeLog	2013-09-15 13:01:18 UTC (rev 4487)
@@ -1,3 +1,9 @@
+2013-09-15 Romain Francois <romain at r-enthusiasts.com>
+        
+        * include/RcppArmadilloForward.h : declaration of specializations of
+	ConstReferenceInputParameter and ReferenceInputParameter
+        * include/RcppArmadilloAs.h : definitions of the above
+
 2013-09-13  Romain Francois <romain at r-enthusiasts.com>
 
         * DESCRIPTION : require Rcpp 0.10.4.4

Modified: pkg/RcppArmadillo/inst/include/RcppArmadilloAs.h
===================================================================
--- pkg/RcppArmadillo/inst/include/RcppArmadilloAs.h	2013-09-15 12:59:41 UTC (rev 4486)
+++ pkg/RcppArmadillo/inst/include/RcppArmadilloAs.h	2013-09-15 13:01:18 UTC (rev 4487)
@@ -101,14 +101,14 @@
 }       
         
     template <typename T>
-    class InputParameter< const arma::Mat<T>& > {
+    class ConstReferenceInputParameter< arma::Mat<T> > {
     public:
         typedef const typename arma::Mat<T>& const_reference ;
                         
-        InputParameter( SEXP x_ ) : m(x_), mat( m.begin(), m.nrow(), m.ncol(), false ){}
+        ConstReferenceInputParameter( SEXP x_ ) : m(x_), mat( m.begin(), m.nrow(), m.ncol(), false ){}
                         
         inline operator const_reference(){
-            return mat ;        
+        		return mat ;        
         }
                         
     private:
@@ -117,11 +117,11 @@
     } ;
     
     template <typename T>
-    class InputParameter< arma::Mat<T>& > {
+    class ReferenceInputParameter< arma::Mat<T> > {
     public:
         typedef typename arma::Mat<T>& reference ;
                         
-        InputParameter( SEXP x_ ) : m(x_), mat( m.begin(), m.nrow(), m.ncol(), false ){}
+        ReferenceInputParameter( SEXP x_ ) : m(x_), mat( m.begin(), m.nrow(), m.ncol(), false ){}
                         
         inline operator reference(){
             return mat ;        
@@ -146,17 +146,17 @@
         VEC vec ;
     } ;
     
-#define MAKE_INPUT_PARAMETER(TYPE,REF)                                  \
+#define MAKE_INPUT_PARAMETER(INPUT_TYPE,TYPE,REF)                       \
     template <typename T>                                               \
-    class InputParameter<REF> : public ArmaVec_InputParameter<T, TYPE, REF >{ \
+    class INPUT_TYPE<TYPE> : public ArmaVec_InputParameter<T, TYPE, REF >{ \
     public:                                                             \
-    InputParameter( SEXP x) : ArmaVec_InputParameter<T, TYPE, REF >(x){} \
+    INPUT_TYPE( SEXP x) : ArmaVec_InputParameter<T, TYPE, REF >(x){} \
     } ;                                                                                                                  
     
-    MAKE_INPUT_PARAMETER(arma::Col<T>, const arma::Col<T>& )
-    MAKE_INPUT_PARAMETER(arma::Col<T>, arma::Col<T>& )
-    MAKE_INPUT_PARAMETER(arma::Row<T>, const arma::Row<T>& )
-    MAKE_INPUT_PARAMETER(arma::Row<T>, arma::Row<T>& )
+    MAKE_INPUT_PARAMETER(ConstReferenceInputParameter, arma::Col<T>, const arma::Col<T>& )
+    MAKE_INPUT_PARAMETER(ReferenceInputParameter     , arma::Col<T>, arma::Col<T>&       )
+    MAKE_INPUT_PARAMETER(ConstReferenceInputParameter, arma::Row<T>, const arma::Row<T>& )
+    MAKE_INPUT_PARAMETER(ReferenceInputParameter     , arma::Row<T>, arma::Row<T>&       )
 #undef MAKE_INPUT_PARAMETER
 }
 

Modified: pkg/RcppArmadillo/inst/include/RcppArmadilloForward.h
===================================================================
--- pkg/RcppArmadillo/inst/include/RcppArmadilloForward.h	2013-09-15 12:59:41 UTC (rev 4486)
+++ pkg/RcppArmadillo/inst/include/RcppArmadilloForward.h	2013-09-15 13:01:18 UTC (rev 4487)
@@ -96,14 +96,14 @@
 
     } // namespace traits 
 
-    template <typename T> class InputParameter< const arma::Mat<T>& > ;
-    template <typename T> class InputParameter< arma::Mat<T>& > ;
+    template <typename T> class ConstReferenceInputParameter< arma::Mat<T> > ;
+    template <typename T> class ReferenceInputParameter< arma::Mat<T> > ;
     
-    template <typename T> class InputParameter< const arma::Col<T>& > ;
-    template <typename T> class InputParameter< arma::Col<T>& > ;
+    template <typename T> class ConstReferenceInputParameter< arma::Col<T> > ;
+    template <typename T> class ReferenceInputParameter< arma::Col<T> > ;
     
-    template <typename T> class InputParameter< const arma::Row<T>& > ;
-    template <typename T> class InputParameter< arma::Row<T>& > ;
+    template <typename T> class ConstReferenceInputParameter< arma::Row<T> > ;
+    template <typename T> class ReferenceInputParameter< arma::Row<T> > ;
     
 }
 



More information about the Rcpp-commits mailing list