22 #ifndef Rcpp__sugar__cumsum_h
23 #define Rcpp__sugar__cumsum_h
28 template <
int RTYPE,
bool NA,
typename T>
29 class Cumsum :
public Lazy< Rcpp::Vector<RTYPE> , Cumsum<RTYPE,NA,T> > {
38 R_xlen_t n =
object.
size() ;
41 if( Rcpp::traits::is_na<RTYPE>(current) )
44 for( R_xlen_t i=1; i<n; i++){
46 if( Rcpp::traits::is_na<RTYPE>(current) )
58 template <
bool NA,
typename T>
63 template <
bool NA,
typename T>
Cumsum(const VEC_TYPE &object_)
Rcpp::traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Rcpp::Vector< RTYPE > VECTOR
sugar::Cumsum< INTSXP, NA, T > cumsum(const VectorBase< INTSXP, NA, T > &t)