MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / rowmajor_wrap__dispatch

Function rowmajor_wrap__dispatch

inst/include/Rcpp/internal/wrap.h:813–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

811 // {{{ wrap a container that is structured in row major order
812 template <typename value_type, typename InputIterator>
813 inline SEXP rowmajor_wrap__dispatch(InputIterator first, int nrow, int ncol, ::Rcpp::traits::r_type_generic_tag) {
814 Shield<SEXP> out(::Rf_allocVector(VECSXP, nrow * ncol));
815 int i=0, j=0;
816 for (j=0; j<ncol; j++) {
817 for (i=0; i<nrow; i++, ++first) {
818 SET_VECTOR_ELT(out, j + ncol*i, ::Rcpp::wrap(*first));
819 }
820 }
821 Shield<SEXP> dims(::Rf_allocVector(INTSXP, 2));
822 INTEGER(dims)[0] = nrow;
823 INTEGER(dims)[1] = ncol;
824 ::Rf_setAttrib(out, R_DimSymbol, dims);
825 return out;
826 }
827
828 template <typename value_type, typename InputIterator>
829 inline SEXP rowmajor_wrap__dispatch(InputIterator first, int nrow, int ncol, ::Rcpp::traits::r_type_string_tag) {

Callers

nothing calls this directly

Calls 2

make_charsexpFunction · 0.85
wrapFunction · 0.70

Tested by

no test coverage detected