1 #ifndef STAN__MATH__MATRIX__ELT_DIVIDE_HPP
2 #define STAN__MATH__MATRIX__ELT_DIVIDE_HPP
4 #include <boost/math/tools/promotion.hpp>
22 template <
typename T1,
typename T2,
int R,
int C>
23 Eigen::Matrix<typename boost::math::tools::promote_args<T1,T2>::type, R, C>
25 const Eigen::Matrix<T2,R,C>& m2) {
28 Eigen::Matrix<typename boost::math::tools::promote_args<T1,T2>::type, R, C>
29 result(m1.rows(),m2.cols());
30 for (
int i = 0; i < m1.size(); ++i)
31 result(i) = m1(i) / m2(i);
47 template <
typename T1,
typename T2,
int R,
int C>
48 Eigen::Matrix<typename boost::math::tools::promote_args<T1,T2>::type, R, C>
65 template <
typename T1,
typename T2,
int R,
int C>
66 Eigen::Matrix<typename boost::math::tools::promote_args<T1,T2>::type, R, C>
68 const Eigen::Matrix<T2,R,C>& m) {
69 Eigen::Matrix<typename boost::math::tools::promote_args<T1,T2>::type, R, C>
70 result(m.rows(),m.cols());
71 for (
int i = 0; i < m.size(); ++i)
Eigen::Matrix< typename boost::math::tools::promote_args< T1, T2 >::type, R, C > elt_divide(const Eigen::Matrix< T1, R, C > &m1, const Eigen::Matrix< T2, R, C > &m2)
Return the elementwise division of the specified matrices.
bool check_matching_dims(const char *function, const Eigen::Matrix< T1, R1, C1 > &y1, const char *name1, const Eigen::Matrix< T2, R2, C2 > &y2, const char *name2, T_result *result)