1#ifndef STAN_MATH_PRIM_PROB_HYPERGEOMETRIC_RNG_HPP
2#define STAN_MATH_PRIM_PROB_HYPERGEOMETRIC_RNG_HPP
5#include <boost/math/distributions/hypergeometric.hpp>
15 using boost::variate_generator;
16 using boost::math::hypergeometric_distribution;
17 static constexpr const char* function =
"hypergeometric_rng";
23 hypergeometric_distribution<> dist(b, N, a + b);
30 if (cdf(dist, mid + 1) > u) {
VectorBuilder< true, double, T_alpha, T_beta >::type uniform_rng(const T_alpha &alpha, const T_beta &beta, RNG &rng)
Return a uniform random variate for the given upper and lower bounds using the specified random numbe...
void check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Check if the value is between the low and high values, inclusively.
int hypergeometric_rng(int N, int a, int b, RNG &rng)
auto min(T1 x, T2 y)
Returns the minimum coefficient of the two specified scalar arguments.
T value_of(const fvar< T > &v)
Return the value of the specified variable.
auto max(T1 x, T2 y)
Returns the maximum value of the two specified scalar arguments.
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...