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