Stan Math Library  2.9.0
reverse mode automatic differentiation
check_square.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_SQUARE_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_SQUARE_HPP
3 
6 #include <sstream>
7 
8 namespace stan {
9  namespace math {
10 
26  template <typename T_y>
27  inline bool
28  check_square(const char* function,
29  const char* name,
30  const Eigen::Matrix<T_y, Eigen::Dynamic, Eigen::Dynamic>& y) {
31  check_size_match(function,
32  "Expecting a square matrix; rows of ", name, y.rows(),
33  "columns of ", name, y.cols());
34  return true;
35  }
36 
37  }
38 }
39 #endif
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.
bool check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is square.

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