Stan Math Library  2.12.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 
7 
8 namespace stan {
9  namespace math {
10 
31  template <typename T1, typename T2>
32  inline bool check_multiplicable(const char* function,
33  const char* name1,
34  const T1& y1,
35  const char* name2,
36  const T2& y2) {
37  check_positive_size(function, name1, "rows()", y1.rows());
38  check_positive_size(function, name2, "cols()", y2.cols());
39  check_size_match(function,
40  "Columns of ", name1, y1.cols(),
41  "Rows of ", name2, y2.rows());
42  check_positive_size(function, name1, "cols()", y1.cols());
43  return true;
44  }
45  }
46 }
47 #endif
bool check_positive_size(const char *function, const char *name, const char *expr, const int size)
Return true if size is positive.
bool check_multiplicable(const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2)
Return true if the matrices can be multiplied.
bool check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Return true if the provided sizes match.

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