Stan Math Library
4.9.0
Automatic Differentiation
Loading...
Searching...
No Matches
check_nonzero_size.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_ERR_CHECK_NONZERO_SIZE_HPP
2
#define STAN_MATH_PRIM_ERR_CHECK_NONZERO_SIZE_HPP
3
4
#include <
stan/math/prim/meta.hpp
>
5
#include <
stan/math/prim/err/invalid_argument.hpp
>
6
7
namespace
stan
{
8
namespace
math {
9
21
template
<
typename
T_y>
22
inline
void
check_nonzero_size
(
const
char
* function,
const
char
* name,
23
const
T_y& y) {
24
if
(y.size() == 0) {
25
[&]()
STAN_COLD_PATH
{
26
invalid_argument
(function, name, 0,
"has size "
,
27
", but must have a non-zero size"
);
28
}();
29
}
30
}
31
32
}
// namespace math
33
}
// namespace stan
34
#endif
STAN_COLD_PATH
#define STAN_COLD_PATH
Definition
compiler_attributes.hpp:25
invalid_argument.hpp
stan::math::invalid_argument
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.
Definition
invalid_argument.hpp:27
stan::math::check_nonzero_size
void check_nonzero_size(const char *function, const char *name, const T_y &y)
Check if the specified matrix/vector is of non-zero size.
Definition
check_nonzero_size.hpp:22
stan
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition
unit_vector_constrain.hpp:15
meta.hpp
stan
math
prim
err
check_nonzero_size.hpp
[
Stan Home Page
]
© 2011–2019, Stan Development Team.