20#ifndef Rcpp__sugar__mean_h
21#define Rcpp__sugar__mean_h
26template <
int RTYPE,
bool NA,
typename T>
27class Mean :
public Lazy<double, Mean<RTYPE,NA,T> > {
37 long double s = std::accumulate(
input.begin(),
input.end(), 0.0L);
52template <
bool NA,
typename T>
62 long double s = 0.0,
si = 0.0;
71 long double t = 0.0,
ti = 0.0;
81 z.r =
static_cast<double>(
s);
82 z.i =
static_cast<double>(
si);
89template <
bool NA,
typename T>
111template <
bool NA,
typename T>
121 long double s = std::accumulate(
input.begin(),
input.end(), 0.0L);
137template <
bool NA,
typename T>
142template <
bool NA,
typename T>
147template <
bool NA,
typename T>
152template <
bool NA,
typename T>
Mean(const VEC_TYPE &object_)
Rcpp::VectorBase< CPLXSXP, NA, T > VEC_TYPE
Mean(const VEC_TYPE &object_)
Rcpp::VectorBase< INTSXP, NA, T > VEC_TYPE
Mean(const VEC_TYPE &object_)
Rcpp::VectorBase< LGLSXP, NA, T > VEC_TYPE
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Rcpp::Vector< RTYPE > VECTOR
Mean(const VEC_TYPE &object_)
sugar::Mean< REALSXP, NA, T > mean(const VectorBase< REALSXP, NA, T > &t)