Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
check_matching_sizes.hpp
Go to the documentation of this file.
1 #ifndef STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_MATCHING_SIZES_HPP
2 #define STAN__MATH__ERROR_HANDLING__MATRIX__CHECK_MATCHING_SIZES_HPP
3 
4 #include <stan/meta/traits.hpp>
6 #include <string>
7 #include <typeinfo>
9 
10 namespace stan {
11  namespace math {
12 
13  // NOTE: this will not throw if y1 or y2 contains nan values.
14  template <typename T_y1, typename T_y2, typename T_result>
15  inline bool check_matching_sizes(const char* function,
16  const T_y1& y1,
17  const char* name1,
18  const T_y2& y2,
19  const char* name2,
20  T_result* result) {
21  stan::math::check_size_match(function,y1.size(), "size of y1",
22  y2.size(), "size of y2",result);
23  return true;
24  }
25 
26  }
27 }
28 #endif
bool check_size_match(const char *function, T_size1 i, const char *name_i, T_size2 j, const char *name_j, T_result *result)
bool check_matching_sizes(const char *function, const T_y1 &y1, const char *name1, const T_y2 &y2, const char *name2, T_result *result)

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