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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 2 14:32:36 CEST 2010


Author: romain
Date: 2010-06-02 14:32:34 +0200 (Wed, 02 Jun 2010)
New Revision: 1399

Modified:
   pkg/RcppArmadillo/inst/include/RcppArmadillo.h
Log:
minor update 

Modified: pkg/RcppArmadillo/inst/include/RcppArmadillo.h
===================================================================
--- pkg/RcppArmadillo/inst/include/RcppArmadillo.h	2010-06-02 11:49:29 UTC (rev 1398)
+++ pkg/RcppArmadillo/inst/include/RcppArmadillo.h	2010-06-02 12:32:34 UTC (rev 1399)
@@ -137,42 +137,42 @@
     		return ::Rcpp::wrap( arma::Mat<typename T1::elem_type>(X) ) ;
     	}
     	
-    	template<typename out_eT, typename T1, typename op_type>
-    	SEXP wrap_mtop( const arma::mtOp<out_eT,T1,op_type>& X, ::Rcpp::traits::false_type ){
-    		// int n_rows = X.P.n_rows ;
-    		// int n_cols = X.P.n_cols ;
-    		// typedef typename ::Rcpp::Vector< ::Rcpp::traits::r_sexptype_traits< typename T1::elem_type>::rtype > VECTOR ;
-    		// VECTOR res(::Rcpp::Dimension( n_rows , n_cols )) ;
-    		// ::arma::Mat<typename T1::elem_type> result( res.begin(), n_rows, n_cols, false ) ;
-    		// result = X ;
-    		// return res ;
-    		return ::Rcpp::wrap( arma::Mat<out_eT>(X) ) ;
-    	}
+    	// template<typename out_eT, typename T1, typename op_type>
+    	// SEXP wrap_mtop( const arma::mtOp<out_eT,T1,op_type>& X, ::Rcpp::traits::false_type ){
+    	// 	// int n_rows = X.P.n_rows ;
+    	// 	// int n_cols = X.P.n_cols ;
+    	// 	// typedef typename ::Rcpp::Vector< ::Rcpp::traits::r_sexptype_traits< typename T1::elem_type>::rtype > VECTOR ;
+    	// 	// VECTOR res(::Rcpp::Dimension( n_rows , n_cols )) ;
+    	// 	// ::arma::Mat<typename T1::elem_type> result( res.begin(), n_rows, n_cols, false ) ;
+    	// 	// result = X ;
+    	// 	// return res ;
+    	// 	return ::Rcpp::wrap( arma::Mat<out_eT>(X) ) ;
+    	// }
+    	// 
+    	// template<typename out_eT, typename T1, typename op_type>
+    	// SEXP wrap_mtop( const arma::mtOp<out_eT,T1,op_type>& X, ::Rcpp::traits::true_type ){
+    	// 	return ::Rcpp::wrap( arma::Mat<out_eT>(X) ) ;
+    	// }
+    	// 
+    	// template<typename out_eT, typename T1, typename T2, typename glue_type>
+    	// SEXP wrap_mtglue( const arma::mtGlue<out_eT,T1,T2,glue_type>& X, ::Rcpp::traits::false_type ){
+    	// 	// int n_rows = X.P1.n_rows ;
+    	// 	// int n_cols = X.P1.n_cols ;
+    	// 	// typedef typename ::Rcpp::Vector< ::Rcpp::traits::r_sexptype_traits< typename T1::elem_type>::rtype > VECTOR ;
+    	// 	// VECTOR res(::Rcpp::Dimension( n_rows , n_cols )) ;
+    	// 	// ::arma::Mat<typename T1::elem_type> result( res.begin(), n_rows, n_cols, false ) ;
+    	// 	// result = X ;
+    	// 	// return res ;
+    	// 	return ::Rcpp::wrap( arma::Mat<out_eT>(X) ) ; 
+    	// }
+    	// 
+    	// template<typename out_eT, typename T1, typename T2, typename glue_type>
+    	// SEXP wrap_mtglue( const arma::mtGlue<out_eT,T1,T2,glue_type>& X , ::Rcpp::traits::true_type ){
+    	// 	return ::Rcpp::wrap( arma::Mat<out_eT>(X) ) ; 
+    	// }
     	
-    	template<typename out_eT, typename T1, typename op_type>
-    	SEXP wrap_mtop( const arma::mtOp<out_eT,T1,op_type>& X, ::Rcpp::traits::true_type ){
-    		return ::Rcpp::wrap( arma::Mat<out_eT>(X) ) ;
-    	}
     	
-    	template<typename out_eT, typename T1, typename T2, typename glue_type>
-    	SEXP wrap_mtglue( const arma::mtGlue<out_eT,T1,T2,glue_type>& X, ::Rcpp::traits::false_type ){
-    		// int n_rows = X.P1.n_rows ;
-    		// int n_cols = X.P1.n_cols ;
-    		// typedef typename ::Rcpp::Vector< ::Rcpp::traits::r_sexptype_traits< typename T1::elem_type>::rtype > VECTOR ;
-    		// VECTOR res(::Rcpp::Dimension( n_rows , n_cols )) ;
-    		// ::arma::Mat<typename T1::elem_type> result( res.begin(), n_rows, n_cols, false ) ;
-    		// result = X ;
-    		// return res ;
-    		return ::Rcpp::wrap( arma::Mat<out_eT>(X) ) ; 
-    	}
     	
-    	template<typename out_eT, typename T1, typename T2, typename glue_type>
-    	SEXP wrap_mtglue( const arma::mtGlue<out_eT,T1,T2,glue_type>& X , ::Rcpp::traits::true_type ){
-    		return ::Rcpp::wrap( arma::Mat<out_eT>(X) ) ; 
-    	}
-    	
-    	
-    	
     } // namespace RcppArmadillo
     
     template <typename T1, typename T2, typename glue_type>
@@ -197,12 +197,14 @@
     
     template<typename out_eT, typename T1, typename op_type>
     SEXP wrap( const arma::mtOp<out_eT,T1,op_type>& X ){
-    	return RcppArmadillo::wrap_mtop( X, typename traits::r_sexptype_needscast<out_eT>::type() ) ;
+    	// return RcppArmadillo::wrap_mtop( X, typename traits::r_sexptype_needscast<out_eT>::type() ) ;
+    	return wrap( arma::Mat<out_eT>( X ) ) ;
     }
 
     template<typename out_eT, typename T1, typename T2, typename glue_type>
     SEXP wrap( const arma::mtGlue<out_eT,T1,T2,glue_type>& X ){
-    	return RcppArmadillo::wrap_mtglue( X, typename traits::r_sexptype_needscast<out_eT>::type() ) ;
+    	// return RcppArmadillo::wrap_mtglue( X, typename traits::r_sexptype_needscast<out_eT>::type() ) ;
+    	return wrap( arma::Mat<out_eT>( X ) ) ;
     }
 
     /* support for Rcpp::as */



More information about the Rcpp-commits mailing list