22 #ifndef Rcpp__sugar__matrix_as_vector_h
23 #define Rcpp__sugar__matrix_as_vector_h
28 template <
int RTYPE,
bool NA,
typename T>
32 int nc = ref.ncol(), nr = ref.nrow() ;
35 for(
int col_index=0; col_index<nc; col_index++)
36 for(
int row_index=0; row_index<nr; row_index++, k++)
37 out[k] = ref( row_index, col_index ) ;
42 template <
int RTYPE,
bool NA,
typename T>
46 R_xlen_t size =
static_cast<R_xlen_t
>(ref.
ncol())*ref.
nrow() ;
53 template <
int RTYPE,
bool NA,
typename T>
traits::r_vector_const_iterator< RTYPE, StoragePolicy >::type const_iterator
Rcpp::Vector< RTYPE > as_vector__impl(MatrixBase< RTYPE, NA, T > &t, Rcpp::traits::false_type)
Rcpp::Vector< RTYPE > as_vector(const MatrixBase< RTYPE, NA, T > &t)