search for: type_free_iter

Displaying 5 results from an estimated 5 matches for "type_free_iter".

2019 Sep 23
2
What is the best way to loop over an ALTREP vector?
...first argument in the > macro, it seems redundant to define etype and vtype for they have to match > the type of the SEXP. I'm wondering if this is intentional? Will there be a > type-free macro in R in the future? Here is a simple type-free macro I'm > using. > > #define type_free_iter(sx, ptr, ind, nbatch,expr)\ > > switch(TYPEOF(sx)){\ > > case INTSXP:\ > > ITERATE_BY_REGION(sx, ptr, ind, nbatch, int, INTEGER, expr);\ > > break; \ > > case REALSXP:\ > > ITERATE_BY_REGION(sx, ptr, ind, nbatch, double, REAL, expr);\ > &g...
2019 Sep 23
0
What is the best way to loop over an ALTREP vector?
...macro. Since the SEXP is the first argument in the macro, it seems redundant to define etype and vtype for they have to match the type of the SEXP. I'm wondering if this is intentional? Will there be a type-free macro in R in the future? Here is a simple type-free macro I'm using. #define type_free_iter(sx, ptr, ind, nbatch,expr)\ switch(TYPEOF(sx)){\ case INTSXP:\ ITERATE_BY_REGION(sx, ptr, ind, nbatch, int, INTEGER, expr);\ break; \ case REALSXP:\ ITERATE_BY_REGION(sx, ptr, ind, nbatch, double, REAL, expr);\ break; \ case LGLSXP:\ ITERATE_BY_REGION(sx,...
2019 Sep 24
2
What is the best way to loop over an ALTREP vector?
...o define etype and vtype for they have to > match > >> the type of the SEXP. I'm wondering if this is intentional? Will there > be a > >> type-free macro in R in the future? Here is a simple type-free macro I'm > >> using. > >> > >> #define type_free_iter(sx, ptr, ind, nbatch,expr)\ > >> > >> switch(TYPEOF(sx)){\ > >> > >> case INTSXP:\ > >> > >> ITERATE_BY_REGION(sx, ptr, ind, nbatch, int, INTEGER, expr);\ > >> > >> break; \ > >> > >> case REALSXP:...
2019 Aug 28
3
What is the best way to loop over an ALTREP vector?
Hi devel team, I'm working on C/C++ level ALTREP compatibility for a package. The package previously used pointers to access the data of a SEXP, so it would not work for some ALTREP objects which do not have a pointer. I plan to rewrite the code and use functions like get_elt, get_region, and get_subset to access the values of a vector, so I have a few questions for ALTREP: 1. Since an
2019 Sep 24
0
What is the best way to loop over an ALTREP vector?
...t;> macro, it seems redundant to define etype and vtype for they have to match >> the type of the SEXP. I'm wondering if this is intentional? Will there be a >> type-free macro in R in the future? Here is a simple type-free macro I'm >> using. >> >> #define type_free_iter(sx, ptr, ind, nbatch,expr)\ >> >> switch(TYPEOF(sx)){\ >> >> case INTSXP:\ >> >> ITERATE_BY_REGION(sx, ptr, ind, nbatch, int, INTEGER, expr);\ >> >> break; \ >> >> case REALSXP:\ >> >> ITERATE_BY_REGION(...