1 #ifndef STAN_MATH_PRIM_MAT_FUN_MEAN_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_MEAN_HPP 6 #include <boost/math/tools/promotion.hpp> 21 inline typename boost::math::tools::promote_args<T>::type
mean(
22 const std::vector<T>& v) {
24 Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1>> m(&v[0], v.size());
34 template <
typename T,
int R,
int C>
35 inline typename boost::math::tools::promote_args<T>::type
mean(
36 const Eigen::Matrix<T, R, C>& m) {
void check_nonzero_size(const char *function, const char *name, const T_y &y)
Check if the specified matrix/vector is of non-zero size.
boost::math::tools::promote_args< T >::type mean(const std::vector< T > &v)
Returns the sample mean (i.e., average) of the coefficients in the specified standard vector...