Automatic Differentiation
 
Loading...
Searching...
No Matches
check_positive_finite.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_CHECK_POSITIVE_FINITE_HPP
2#define STAN_MATH_PRIM_ERR_CHECK_POSITIVE_FINITE_HPP
3
6
7namespace stan {
8namespace math {
9
21template <typename T_y>
22inline void check_positive_finite(const char* function, const char* name,
23 const T_y& y) {
24 elementwise_check([](double x) { return x > 0 && std::isfinite(x); },
25 function, name, y, "positive finite");
26}
27
28} // namespace math
29} // namespace stan
30#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_positive_finite(const char *function, const char *name, const T_y &y)
Check if y is positive and finite.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...