| 562 | |
| 563 | template <typename T> |
| 564 | inline SEXP wrap_dispatch_matrix_logical(const T& object, ::Rcpp::traits::true_type) { |
| 565 | int nr = object.nrow(), nc = object.ncol(); |
| 566 | Shield<SEXP> res(Rf_allocVector(LGLSXP, nr * nc)); |
| 567 | int k=0; |
| 568 | int* p = LOGICAL(res); |
| 569 | for (int j=0; j<nc; j++) |
| 570 | for (int i=0; i<nr; i++, k++) |
| 571 | p[k] = object(i,j); |
| 572 | Shield<SEXP> dim(Rf_allocVector(INTSXP, 2)); |
| 573 | INTEGER(dim)[0] = nr; |
| 574 | INTEGER(dim)[1] = nc; |
| 575 | Rf_setAttrib(res, R_DimSymbol , dim); |
| 576 | return res; |
| 577 | } |
| 578 | |
| 579 | template <typename T, typename STORAGE> |
| 580 | inline SEXP wrap_dispatch_matrix_primitive(const T& object) { |
no test coverage detected