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

Function wrap_dispatch_matrix_logical

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

Source from the content-addressed store, hash-verified

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) {

Calls 3

objectClass · 0.50
nrowMethod · 0.45
ncolMethod · 0.45

Tested by

no test coverage detected