Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
columns_dot_product.hpp
Go to the documentation of this file.
1 #ifndef __STAN__MATH__MATRIX__COLUMNS_DOT_PRODUCT_HPP__
2 #define __STAN__MATH__MATRIX__COLUMNS_DOT_PRODUCT_HPP__
3 
7 
8 namespace stan {
9  namespace math {
10 
20  template<int R1,int C1,int R2, int C2>
21  inline Eigen::Matrix<double, 1, C1>
22  columns_dot_product(const Eigen::Matrix<double, R1, C1>& v1,
23  const Eigen::Matrix<double, R2, C2>& v2) {
24  validate_matching_sizes(v1,v2,"columns_dot_product");
25  Eigen::Matrix<double, 1, C1> ret(1,v1.cols());
26  for (size_type j = 0; j < v1.cols(); ++j) {
27  ret(j) = v1.col(j).dot(v2.col(j));
28  }
29  return ret;
30  }
31 
32  }
33 }
34 #endif

     [ Stan Home Page ] © 2011–2013, Stan Development Team.