6 SEXP direct__( SEXP x_, SEXP y_ ){
7 NumericVector x( x_ ), y( y_ ), z( x.size() ) ;
9 for( int i=0; i<n; i++)
14 SEXP extractors__( SEXP x_, SEXP y_){
15 NumericVector x( x_ ), y( y_ ), z( x.size() ) ;
16 Fast<NumericVector> fx(x), fy(y), fz(z) ;
18 for( int i=0; i<n; i++)
19 fz[i] = fx[i] * fy[i] ;
23 SEXP sugar_nona__( SEXP x_, SEXP y_){
24 NumericVector x( x_ ), y( y_ ) ;
25 sugar::Nona< REALSXP, true, NumericVector > nx(x), ny(y) ;
26 NumericVector z = nx * ny ;
34 direct = signature( x_ = "numeric", y_ = "numeric" ),
35 extractor = signature( x_ = "numeric", y_ = "numeric" ),
36 sugar_nona = signature( x_ = "numeric", y_ = "numeric" ),
38 assign_direct = signature( x_ = "numeric", y_ = "numeric" ),
39 assign_extractor = signature( x_ = "numeric", y_ = "numeric" ),
40 assign_sugar_nona = signature( x_ = "numeric", y_ = "numeric" )
45 SEXP res = R_NilValue ;
46 for( int j=0; j<1000; j++)
47 res = direct__( x_, y_ ) ;
51 SEXP res = R_NilValue ;
52 for( int j=0; j<1000; j++)
53 res = extractors__( x_, y_ ) ;
57 SEXP res = R_NilValue ;
58 for( int j=0; j<1000; j++)
59 res = sugar_nona__( x_, y_ ) ;
64 NumericVector x( x_ ), y( y_ ), z( x.size() ) ;
66 for( int j=0; j<1000; j++)
67 for( int i=0; i<n; i++)
73 NumericVector x( x_ ), y( y_ ), z( x.size() ) ;
74 Fast<NumericVector> fx(x), fy(y), fz(z) ;
76 for( int j=0; j<1000; j++)
77 for( int i=0; i<n; i++)
78 fz[i] = fx[i] * fy[i] ;
83 NumericVector x( x_ ), y( y_ ), z( x.size() ) ;
84 sugar::Nona< REALSXP, true, NumericVector > nx(x), ny(y) ;
85 for( int j=0; j<1000; j++)
89 ) , plugin = "Rcpp", includes = inc )
95 invisible( getDynLib( fx ) )
101 fx$extractor( x, y ),
102 fx$sugar_nona( x, y ),
105 columns=c("test", "elapsed", "relative", "user.self", "sys.self"),
110 fx$assign_direct( x, y ),
111 fx$assign_extractor( x, y ),
112 fx$assign_sugar_nona( x, y ),
115 columns=c("test", "elapsed", "relative", "user.self", "sys.self"),