1 #ifndef STAN_MATH_REV_MAT_FUN_ROWS_DOT_PRODUCT_HPP 2 #define STAN_MATH_REV_MAT_FUN_ROWS_DOT_PRODUCT_HPP 13 #include <boost/utility/enable_if.hpp> 14 #include <boost/type_traits.hpp> 20 template<
typename T1,
int R1,
int C1,
typename T2,
int R2,
int C2>
22 typename boost::enable_if_c<boost::is_same<T1, var>::value ||
23 boost::is_same<T2, var>::value,
24 Eigen::Matrix<var, R1, 1> >::type
26 const Eigen::Matrix<T2, R2, C2>& v2) {
30 Eigen::Matrix<var, R1, 1> ret(v1.rows(), 1);
31 for (
size_type j = 0; j < v1.rows(); ++j) {
32 ret(j) =
var(
new dot_product_vari<T1, T2>(v1.row(j), v2.row(j)));
Independent (input) and dependent (output) variables for gradients.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Type for sizes and indexes in an Eigen matrix with double e.
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.
Eigen::Matrix< fvar< T >, R1, 1 > rows_dot_product(const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2)