1#ifndef STAN_MATH_PRIM_PROB_DISCRETE_RANGE_RNG_HPP
2#define STAN_MATH_PRIM_PROB_DISCRETE_RANGE_RNG_HPP
8#include <boost/random/uniform_int_distribution.hpp>
9#include <boost/random/variate_generator.hpp>
34template <
typename T_lower,
typename T_upper,
class RNG>
37 static constexpr const char* function =
"discrete_range_rng";
38 using boost::variate_generator;
39 using boost::random::uniform_int_distribution;
41 "Upper bound parameter", upper);
49 for (
size_t n = 0; n < N; ++n) {
51 rng, uniform_int_distribution<>(lower_vec[n], upper_vec[n]));
typename helper::type type
VectorBuilder allocates type T1 values to be used as intermediate values.
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
VectorBuilder< true, int, T_lower, T_upper >::type discrete_range_rng(const T_lower &lower, const T_upper &upper, RNG &rng)
Return an integer random variate between the given lower and upper bounds (inclusive) using the speci...
void check_greater_or_equal(const char *function, const char *name, const T_y &y, const T_low &low, Idxs... idxs)
Throw an exception if y is not greater or equal than low.
void check_consistent_sizes(const char *)
Trivial no input case, this function is a no-op.
int64_t max_size(const T1 &x1, const Ts &... xs)
Calculate the size of the largest input.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...