22#ifndef Rcpp__sugar__matrix_as_vector_h
23#define Rcpp__sugar__matrix_as_vector_h
28template <
int RTYPE,
bool NA,
typename T>
29inline Rcpp::Vector<RTYPE>
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 ) ;
42template <
int RTYPE,
bool NA,
typename T>
46 R_xlen_t size =
static_cast<R_xlen_t
>(ref.
ncol())*ref.
nrow() ;
53template <
int RTYPE,
bool NA,
typename T>
traits::r_vector_const_iterator< RTYPE, StoragePolicy >::type const_iterator
internal implementation details
Rcpp::Vector< RTYPE > as_vector__impl(MatrixBase< RTYPE, NA, T > &t, Rcpp::traits::false_type)
integral_constant< bool, true > true_type
integral_constant< bool, false > false_type
Rcpp::Vector< RTYPE > as_vector(const MatrixBase< RTYPE, NA, T > &t)