| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
dot.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_FUN_DOT_HPP
2 #define STAN_MATH_PRIM_ARR_FUN_DOT_HPP
3
4 #include <vector>
5 #include <cstddef>
6
7 namespace stan {
8 namespace math {
9
10 // x' * y
11 inline double dot(const std::vector<double>& x,
12 const std::vector<double>& y) {
13 double sum = 0.0;
14 for (size_t i = 0; i < x.size(); ++i)
15 sum += x[i] * y[i];
16 return sum;
17 }
18
19 }
20 }
21
22 #endif
stan::math::sum
fvar< T > sum(const std::vector< fvar< T > > &m)
Return the sum of the entries of the specified standard vector.
Definition: sum.hpp:20
stan::math::dot
double dot(const std::vector< double > &x, const std::vector< double > &y)
Definition: dot.hpp:11

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