[Rcpp-commits] r817 - pkg/RcppArmadillo/inst/include

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 2 08:43:43 CET 2010


Author: romain
Date: 2010-03-02 08:43:42 +0100 (Tue, 02 Mar 2010)
New Revision: 817

Modified:
   pkg/RcppArmadillo/inst/include/RcppArmadillo.h
Log:
blind attempt at supporting armadillo 0.9.0 eGlue

Modified: pkg/RcppArmadillo/inst/include/RcppArmadillo.h
===================================================================
--- pkg/RcppArmadillo/inst/include/RcppArmadillo.h	2010-03-02 02:10:54 UTC (rev 816)
+++ pkg/RcppArmadillo/inst/include/RcppArmadillo.h	2010-03-02 07:43:42 UTC (rev 817)
@@ -44,6 +44,14 @@
     template <typename T1, typename op_type>
     SEXP wrap(const arma::Op<T1, op_type>& X ) ;
     
+    #if ARMA_VERSION_GE_090
+    template <typename T1, typename T2, typename glue_type> 
+    SEXP wrap(const arma::eGlue<T1, T2, glue_type>& X ) ;
+    
+    template <typename T1, typename op_type>
+    SEXP wrap(const arma::eOp<T1, op_type>& X ) ;
+    #endif 
+    
     namespace traits {
 
 	/* support for as */
@@ -133,7 +141,20 @@
     SEXP wrap(const arma::Op<T1, op_type>& X ){
     	    return wrap( arma::Mat<typename T1::elem_type>(X) ) ;
     }
+    
+    /* TODO: will do better when I can use 0.9.0 */
+    #if ARMA_VERSION_GE_090
+    template <typename T1, typename T2, typename glue_type>
+    SEXP wrap(const arma::eGlue<T1, T2, glue_type>& X ){
+    	    return wrap( arma::Mat<typename T1::elem_type>(X) ) ;
+    }
 
+    template <typename T1, typename op_type>
+    SEXP wrap(const arma::eOp<T1, op_type>& X ){
+    	    return wrap( arma::Mat<typename T1::elem_type>(X) ) ;
+    }
+    #endif
+
     /* support for Rcpp::as */
 
     namespace traits {



More information about the Rcpp-commits mailing list