-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSugarVectorExpression.h
More file actions
40 lines (29 loc) · 1.05 KB
/
SugarVectorExpression.h
File metadata and controls
40 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef Rcpp__vector__SugarVectorExpression_h
#define Rcpp__vector__SugarVectorExpression_h
namespace Rcpp{
namespace sugar{
struct custom_sugar_vector_expression{} ;
}
template <typename eT, typename Expr>
struct SugarVectorExpression :
public SugarVectorExpressionBase,
public CRTP<Expr>
{
using CRTP<Expr>::get_ref ;
typedef Expr expr_type ;
typedef eT value_type ;
typedef typename std::integral_constant<int, traits::r_sexptype_traits<eT>::rtype >::type r_type ;
inline R_xlen_t size() const {
return get_ref().size() ;
}
template <typename Target>
void apply( Target& target ) const ;
template <typename Target>
void apply_serial( Target& target ) const ;
template <typename Target>
void apply_parallel( Target& target ) const ;
} ;
template <typename eT, typename Expr>
inline SEXP materialize( const SugarVectorExpression<eT, Expr>& ) ;
}
#endif