1 #ifndef STAN_MATH_FWD_MAT_FUN_DOT_PRODUCT_HPP 2 #define STAN_MATH_FWD_MAT_FUN_DOT_PRODUCT_HPP 13 template <
typename T,
int R1,
int C1,
int R2,
int C2>
15 const Eigen::Matrix<
fvar<T>, R2, C2>& v2) {
26 template <
typename T,
int R1,
int C1,
int R2,
int C2>
28 const Eigen::Matrix<double, R2, C2>& v2) {
39 template <
typename T,
int R1,
int C1,
int R2,
int C2>
41 const Eigen::Matrix<
fvar<T>, R2, C2>& v2) {
52 template <
typename T,
int R1,
int C1,
int R2,
int C2>
54 const Eigen::Matrix<
fvar<T>, R2, C2>& v2,
65 template <
typename T,
int R1,
int C1,
int R2,
int C2>
67 const Eigen::Matrix<double, R2, C2>& v2,
78 template <
typename T,
int R1,
int C1,
int R2,
int C2>
80 const Eigen::Matrix<
fvar<T>, R2, C2>& v2,
93 const std::vector<
fvar<T> >& v2) {
96 for (
size_t i = 0; i < v1.size(); i++)
97 ret += v1.at(i) * v2.at(i);
101 template <
typename T>
103 const std::vector<
fvar<T> >& v2) {
106 for (
size_t i = 0; i < v1.size(); i++)
107 ret += v1.at(i) * v2.at(i);
111 template <
typename T>
113 const std::vector<double>& v2) {
116 for (
size_t i = 0; i < v1.size(); i++)
117 ret += v1.at(i) * v2.at(i);
121 template <
typename T>
126 ret += v1.at(i) * v2.at(i);
130 template <
typename T>
135 ret += v1.at(i) * v2.at(i);
139 template <
typename T>
144 ret += v1.at(i) * v2.at(i);
void check_vector(const char *function, const char *name, const Eigen::Matrix< T, R, C > &x)
Check if the matrix is either a row vector or column vector.
size_t length(const std::vector< T > &x)
Returns the length of the provided std::vector.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Type for sizes and indexes in an Eigen matrix with double e.
fvar< T > dot_product(const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2)
void check_matching_sizes(const char *function, const char *name1, const T_y1 &y1, const char *name2, const T_y2 &y2)
Check if two structures at the same size.
This template class represents scalars used in forward-mode automatic differentiation, which consist of values and directional derivatives of the specified template type.