[Rcpp-commits] r3093 - pkg/RcppEigen/inst/include

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 17 20:32:58 CEST 2011


Author: dmbates
Date: 2011-06-17 20:32:54 +0200 (Fri, 17 Jun 2011)
New Revision: 3093

Modified:
   pkg/RcppEigen/inst/include/RcppEigenForward.h
   pkg/RcppEigen/inst/include/RcppEigenWrap.h
Log:
Add wrap instantiations for ArrayXd, ArrayXXd classes in Eigen


Modified: pkg/RcppEigen/inst/include/RcppEigenForward.h
===================================================================
--- pkg/RcppEigen/inst/include/RcppEigenForward.h	2011-06-17 02:13:13 UTC (rev 3092)
+++ pkg/RcppEigen/inst/include/RcppEigenForward.h	2011-06-17 18:32:54 UTC (rev 3093)
@@ -32,6 +32,8 @@
     template<typename T> SEXP wrap( const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& ) ;
     template<typename T> SEXP wrap( const Eigen::Matrix<T, Eigen::Dynamic, 1>& ) ;
     template<typename T> SEXP wrap( const Eigen::Matrix<T, 1, Eigen::Dynamic>& ) ;
+    template<typename T> SEXP wrap( const Eigen::Array<T, Eigen::Dynamic, Eigen::Dynamic>& ) ;
+    template<typename T> SEXP wrap( const Eigen::Array<T, Eigen::Dynamic, 1>& ) ;
     
     namespace traits {
 

Modified: pkg/RcppEigen/inst/include/RcppEigenWrap.h
===================================================================
--- pkg/RcppEigen/inst/include/RcppEigenWrap.h	2011-06-17 02:13:13 UTC (rev 3092)
+++ pkg/RcppEigen/inst/include/RcppEigenWrap.h	2011-06-17 18:32:54 UTC (rev 3093)
@@ -51,6 +51,17 @@
 	SEXP wrap( const Eigen::Matrix<T, 1, Eigen::Dynamic>& data ){
 		return RcppEigen::Eigen_wrap(data, Dimension(1, data.size()));
     }
+
+    template <typename T>
+	SEXP wrap(const Eigen::Array<T, Eigen::Dynamic, Eigen::Dynamic>& data) {
+		return RcppEigen::Eigen_wrap(data, Dimension(data.rows(), data.cols()));
+	}
+    
+	template <typename T>
+	SEXP wrap(const Eigen::Array<T, Eigen::Dynamic, 1>& object ){
+		return ::Rcpp::wrap(object.data(), object.data() + object.size());
+    }
+
     /* support for Rcpp::as */
 
     namespace traits {



More information about the Rcpp-commits mailing list