| 27 | |
| 28 | template <int RTYPE, bool NA, typename T> |
| 29 | inline Rcpp::Vector<RTYPE> |
| 30 | as_vector__impl( MatrixBase<RTYPE,NA,T>& t, Rcpp::traits::false_type ){ |
| 31 | T& ref = t.get_ref() ; |
| 32 | int nc = ref.ncol(), nr = ref.nrow() ; |
| 33 | Vector<RTYPE> out (static_cast<R_xlen_t>(nr) * nc) ; |
| 34 | R_xlen_t k =0; |
| 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 ) ; |
| 38 | |
| 39 | return out ; |
| 40 | } |
| 41 | |
| 42 | template <int RTYPE, bool NA, typename T> |
| 43 | inline Rcpp::Vector<RTYPE> |