1 #ifndef STAN_MATH_PRIM_FUN_DOT_HPP
2 #define STAN_MATH_PRIM_FUN_DOT_HPP
3 
4 #include <stan/math/prim/meta.hpp>
5 #include <vector>
6 #include <cstddef>
7 
8 namespace stan {
9 namespace math {
10 
dot(const std::vector<double> & x,const std::vector<double> & y)11 inline double dot(const std::vector<double>& x, const std::vector<double>& y) {
12   double sum = 0.0;
13   for (size_t i = 0; i < x.size(); ++i) {
14     sum += x[i] * y[i];
15   }
16   return sum;
17 }
18 
19 }  // namespace math
20 }  // namespace stan
21 #endif
22