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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 17 15:04:08 CET 2011


Author: romain
Date: 2011-11-17 15:04:07 +0100 (Thu, 17 Nov 2011)
New Revision: 3380

Modified:
   pkg/RcppArmadillo/inst/include/RcppArmadillo/Mat_meat.h
Log:
finish fix

Modified: pkg/RcppArmadillo/inst/include/RcppArmadillo/Mat_meat.h
===================================================================
--- pkg/RcppArmadillo/inst/include/RcppArmadillo/Mat_meat.h	2011-11-17 11:14:49 UTC (rev 3379)
+++ pkg/RcppArmadillo/inst/include/RcppArmadillo/Mat_meat.h	2011-11-17 14:04:07 UTC (rev 3380)
@@ -64,8 +64,8 @@
     
     
     template <typename eT, int RTYPE, bool NA, typename MATRIX>
-    inline void fill_ptr_matrix__impl( eT* ptr, const Rcpp::MatrixBase<RTYPE,NA,MATRIX>& X, int nr, int nc, ::Rcpp::traits::true_type ){
-        int k, i_col, i_row ;
+    inline void fill_ptr_matrix__impl( eT* ptr, const Rcpp::MatrixBase<RTYPE,NA,MATRIX>& X, u32 nr, u32 nc, ::Rcpp::traits::true_type ){
+        u32 k, i_col, i_row ;
         for( i_col=0, k=0 ; i_col < nc; ++i_col){
 	    	for( i_row = 0; i_row < nr ; ++i_row, ++k ){
 	    		ptr[k] = Rcpp::internal::caster< typename Rcpp::traits::storage_type<RTYPE>::type, eT>( X(i_row,i_col)) ;
@@ -74,8 +74,8 @@
 	}
     
     template <typename eT, int RTYPE, bool NA, typename MATRIX>
-    inline void fill_ptr_matrix__impl( eT* ptr, const Rcpp::MatrixBase<RTYPE,NA,MATRIX>& X, int nr, int nc, ::Rcpp::traits::false_type ){
-        int k, i_col, i_row ;
+    inline void fill_ptr_matrix__impl( eT* ptr, const Rcpp::MatrixBase<RTYPE,NA,MATRIX>& X, u32 nr, u32 nc, ::Rcpp::traits::false_type ){
+        u32 k, i_col, i_row ;
         for( i_col=0, k=0 ; i_col < nc; ++i_col){
 	    	for( i_row = 0; i_row < nr ; ++i_row, ++k ){
 	    		ptr[k] = X(i_row,i_col) ;
@@ -86,7 +86,7 @@
     
     
     template <typename eT, int RTYPE, bool NA, typename MATRIX>
-    inline void fill_ptr_matrix( eT* ptr, const Rcpp::MatrixBase<RTYPE,NA,MATRIX>& X, int nr, int nc){
+    inline void fill_ptr_matrix( eT* ptr, const Rcpp::MatrixBase<RTYPE,NA,MATRIX>& X, u32 nr, u32 nc){
         return fill_ptr_matrix__impl<eT, RTYPE, NA, MATRIX>( ptr, X, nr, nc, 
             typename ::Rcpp::traits::r_sexptype_needscast<eT>()
             ) ;
@@ -131,7 +131,7 @@
 	u32 nr = X.nrow(), nc = X.ncol() ;
 	set_size( nr, nc ) ;
 		
-	RcppArmadillo::fill_ptr_matrix( memptr(), nr, nc ); 
+	RcppArmadillo::fill_ptr_matrix( memptr(), X, nr, nc ); 
 	
 }
 



More information about the Rcpp-commits mailing list