Automatic Differentiation
 
Loading...
Searching...
No Matches
check_nonnegative.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_CHECK_NONNEGATIVE_HPP
2#define STAN_MATH_PRIM_ERR_CHECK_NONNEGATIVE_HPP
3
8#include <type_traits>
9
10namespace stan {
11namespace math {
12
23template <typename T_y>
24inline void check_nonnegative(const char* function, const char* name,
25 const T_y& y) {
26 elementwise_check([](double x) { return x >= 0; }, function, name, y,
27 "nonnegative");
28}
29} // namespace math
30} // namespace stan
31#endif
void elementwise_check(const F &is_good, const char *function, const char *name, const T &x, const char *must_be, const Indexings &... indexings)
Check that the predicate holds for the value of x.
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...