Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
dot.hpp
Go to the documentation of this file.
1 #ifndef __STAN__MATH__FUNCTIONS__DOT_HPP__
2 #define __STAN__MATH__FUNCTIONS__DOT_HPP__
3 
4 #include <vector>
5 
6 namespace stan {
7  namespace math {
8 
9  // x' * y
10  inline double dot(const std::vector<double>& x,
11  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  return sum;
16  }
17 
18  }
19 }
20 
21 #endif

     [ Stan Home Page ] © 2011–2013, Stan Development Team.