Stan Math Library  2.20.0
reverse mode automatic differentiation
check_consistent_sizes_mvt.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_CONSISTENT_SIZES_MVT_HPP
2 #define STAN_MATH_PRIM_MAT_ERR_CHECK_CONSISTENT_SIZES_MVT_HPP
3 
6 #include <algorithm>
7 
8 namespace stan {
9 namespace math {
10 
24 template <typename T1, typename T2>
25 inline void check_consistent_sizes_mvt(const char* function, const char* name1,
26  const T1& x1, const char* name2,
27  const T2& x2) {
28  using stan::length_mvt;
29  size_t max_size = std::max(length_mvt(x1), length_mvt(x2));
30  check_consistent_size_mvt(function, name1, x1, max_size);
31  check_consistent_size_mvt(function, name2, x2, max_size);
32 }
33 
34 } // namespace math
35 } // namespace stan
36 #endif
void check_consistent_size_mvt(const char *function, const char *name, const T &x, size_t expected_size)
Check if the dimension of x is consistent, which is defined to be expected_size if x is a vector of v...
size_t max_size(const T1 &x1, const T2 &x2)
Definition: max_size.hpp:9
int max(const std::vector< int > &x)
Returns the maximum coefficient in the specified column vector.
Definition: max.hpp:21
void check_consistent_sizes_mvt(const char *function, const char *name1, const T1 &x1, const char *name2, const T2 &x2)
Check if the dimension of x1 is consistent with x2.
size_t length_mvt(const Eigen::Matrix< T, R, C > &)
Definition: length_mvt.hpp:12

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