Stan Math Library  2.20.0
reverse mode automatic differentiation
check_multiplicable.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_MULTIPLICABLE_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_MULTIPLICABLE_HPP
3 
8 
9 namespace stan {
10 namespace math {
11 
29 template <typename T1, typename T2>
30 inline void check_multiplicable(const char* function, const char* name1,
31  const T1& y1, const char* name2, const T2& y2) {
32  check_positive(function, name1, "rows()", y1.rows());
33  check_positive(function, name2, "cols()", y2.cols());
34  check_size_match(function, "Columns of ", name1, y1.cols(), "Rows of ", name2,
35  y2.rows());
36  check_positive(function, name1, "cols()", y1.cols());
37 }
38 } // namespace math
39 } // namespace stan
40 #endif
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
void check_multiplicable(const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2)
Check if the matrices can be multiplied.
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.

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