Skip to content

Commit 6c6063d

Browse files
committed
rng expressions
1 parent f012394 commit 6c6063d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

stan/math/prim/prob/poisson_binomial_rng.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ namespace math {
2121
* @return a Poisson binomial distribution random variable
2222
* @throw std::domain_error if theta is not a valid probability
2323
*/
24-
template <typename T_theta, typename RNG,
25-
require_eigen_vt<std::is_arithmetic, T_theta>* = nullptr>
24+
template <typename T_theta, typename RNG>
2625
inline int poisson_binomial_rng(const T_theta& theta, RNG& rng) {
2726
static constexpr const char* function = "poisson_binomial_rng";
2827
check_finite(function, "Probability parameters", theta);
2928
check_bounded(function, "Probability parameters", value_of(theta), 0.0, 1.0);
29+
ref_type_t<T_theta> theta_ref = theta;
3030

3131
int y = 0;
3232
for (size_t i = 0; i < theta.size(); ++i) {
3333
boost::variate_generator<RNG&, boost::bernoulli_distribution<> >
34-
bernoulli_rng(rng, boost::bernoulli_distribution<>(theta(i)));
34+
bernoulli_rng(rng, boost::bernoulli_distribution<>(theta[i]));
3535
y += bernoulli_rng();
3636
}
3737

0 commit comments

Comments
 (0)