Automatic Differentiation
 
Loading...
Searching...
No Matches
columns_dot_product.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_COLUMNS_DOT_PRODUCT_HPP
2#define STAN_MATH_PRIM_FUN_COLUMNS_DOT_PRODUCT_HPP
3
6
7namespace stan {
8namespace math {
9
24template <typename Mat1, typename Mat2,
25 require_all_eigen_t<Mat1, Mat2>* = nullptr,
26 require_all_not_eigen_vt<is_var, Mat1, Mat2>* = nullptr>
27inline Eigen::Matrix<return_type_t<Mat1, Mat2>, 1, Mat1::ColsAtCompileTime>
28columns_dot_product(const Mat1& v1, const Mat2& v2) {
29 check_matching_sizes("columns_dot_product", "v1", v1, "v2", v2);
30 return v1.cwiseProduct(v2).colwise().sum();
31}
32
33} // namespace math
34} // namespace stan
35
36#endif
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.
auto columns_dot_product(const T_a &a, const T_b &b)
Returns the dot product of columns of the specified matrices.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9