All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
dot.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_ARR_FUN_DOT_HPP
#define STAN_MATH_PRIM_ARR_FUN_DOT_HPP
#include <vector>
#include <cstddef>
namespace stan {
namespace math {
// x' * y
inline double dot(const std::vector<double>& x,
const std::vector<double>& y) {
double sum = 0.0;
for (size_t i = 0; i < x.size(); ++i)
sum += x[i] * y[i];
return sum;
}
}
}
#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.