1#ifndef STAN_MATH_PRIM_ERR_CHECK_CONSISTENT_SIZES_HPP
2#define STAN_MATH_PRIM_ERR_CHECK_CONSISTENT_SIZES_HPP
47template <
typename T1,
typename T2,
typename... Ts>
49 const T1& x1,
const char* name2,
50 const T2& x2,
const Ts&... names_and_xs) {
61 std::stringstream msg;
62 msg <<
", but " << name2 <<
" has size " << size_x2
63 <<
"; and they must be the same size.";
64 std::string msg_str(msg.str());
66 "has size = ", msg_str.c_str());
82template <
typename T,
typename... Types,
85 std::size_t arg_idx = 2;
88 if (x.size() != y.size()) {
90 const std::string name =
"arg" + std::to_string(arg_idx);
require_all_t< is_container< std::decay_t< Types > >... > require_all_container_t
Require all of the types satisfy is_container.
int64_t size(const T &m)
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
void check_matching_sizes(const char *function, const char *name1, const T_y1 &y1, const char *name2, const T_y2 &y2)
Check if two structures at the same size.
void check_consistent_sizes(const char *)
Trivial no input case, this function is a no-op.
void invalid_argument(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw an invalid_argument exception with a consistently formatted message.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
If the input type T is either an eigen matrix with 1 column or 1 row at compile time or a standard ve...