Function vector_mean (o2scl)

O2scl : Function List

template<class vec_t>
double o2scl::vector_mean(size_t n, const vec_t &data)

Compute the mean of the first n elements of a vector.

This function produces the same results as gsl_stats_mean().

If n is zero, this function will return zero.

template<class vec_t>
double o2scl::vector_mean(const vec_t &data)

Compute the mean of all of the vector elements.

This function uses size() to determine the vector size and produces the same results as gsl_stats_mean().

If the vector size is zero, this function will return zero.