File: loopmacro.h

package info (click to toggle)
rcpp 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,480 kB
  • sloc: cpp: 27,436; ansic: 7,778; sh: 53; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13

#define LOOPMACRO_C(name)                   \
SEXP name##__loop(SEXP n_, SEXP a, SEXP b){ \
    int n = INTEGER(n_)[0] ;                \
    SEXP res  = R_NilValue ;                \
    for( int i=0; i<n; i++){                \
       res = name( a, b ) ;                 \
    }                                       \
    return res ;                            \
}

#define LOOPMACRO_CPP(name) RcppExport LOOPMACRO_C(name)