Automatic Differentiation
 
Loading...
Searching...
No Matches
dot.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_DOT_HPP
2#define STAN_MATH_PRIM_FUN_DOT_HPP
3
5#include <vector>
6#include <cstddef>
7
8namespace stan {
9namespace math {
10
11inline 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
fvar< T > sum(const std::vector< fvar< T > > &m)
Return the sum of the entries of the specified standard vector.
Definition sum.hpp:22
double dot(const std::vector< double > &x, const std::vector< double > &y)
Definition dot.hpp:11
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9