1 #ifndef STAN_MATH_PRIM_MAT_FUN_DOT_PRODUCT_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_DOT_PRODUCT_HPP
21 template<
int R1,
int C1,
int R2,
int C2>
22 inline double dot_product(
const Eigen::Matrix<double, R1, C1>& v1,
23 const Eigen::Matrix<double, R2, C2>& v2) {
38 for (
size_t i = 0; i <
length; i++)
39 result += v1[i] * v2[i];
49 const std::vector<double>& v2) {
bool check_vector(const char *function, const char *name, const Eigen::Matrix< T, R, C > &x)
Return true if the matrix is either a row vector or column vector.
size_t length(const std::vector< T > &x)
bool check_matching_sizes(const char *function, const char *name1, const T_y1 &y1, const char *name2, const T_y2 &y2)
Return true if two structures at the same size.
fvar< T > dot_product(const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2)