| Stan Math Library 2.11.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

check_matching_dims.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_MATCHING_DIMS_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_MATCHING_DIMS_HPP
3
4 #include <stan/math/prim/scal/err/domain_error.hpp>
5 #include <stan/math/prim/mat/fun/Eigen.hpp>
6 #include <stan/math/prim/scal/err/check_size_match.hpp>
7 #include <sstream>
8
9 namespace stan {
10 namespace math {
11
36 template <typename T1, typename T2, int R1, int C1, int R2, int C2>
37 inline bool check_matching_dims(const char* function,
38 const char* name1,
39 const Eigen::Matrix<T1, R1, C1>& y1,
40 const char* name2,
41 const Eigen::Matrix<T2, R2, C2>& y2) {
42 check_size_match(function,
43 "Rows of ", name1, y1.rows(),
44 "rows of ", name2, y2.rows());
45 check_size_match(function,
46 "Columns of ", name1, y1.cols(),
47 "columns of ", name2, y2.cols());
48 return true;
49 }
50
51 }
52 }
53 #endif
check_size_match.hpp
stan
Definition: log_sum_exp.hpp:8
stan::math::check_matching_dims
bool check_matching_dims(const char *function, const char *name1, const Eigen::Matrix< T1, R1, C1 > &y1, const char *name2, const Eigen::Matrix< T2, R2, C2 > &y2)
Return true if the two matrices are of the same size.
Definition: check_matching_dims.hpp:37
stan::math::check_size_match
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.
Definition: check_size_match.hpp:30
Eigen.hpp
domain_error.hpp

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