-
-
Notifications
You must be signed in to change notification settings - Fork 378
Closed
Description
Description:
Not sure if this is a bug or just me doing things wrong, but it looks like the new RNG doesn't interact with the Math library in the same way - the return is always constant:
#include <iostream>
#include <stan/services/util/create_rng.hpp>
#include <stan/math.hpp>
int main() {
using stan::math::normal_rng;
stan::rng_t rng(0);
std::cout << "stan::rng_t: "
<< normal_rng(5, 10, rng) << ", "
<< normal_rng(5, 10, rng) << ", "
<< normal_rng(5, 10, rng) << ", "
<< normal_rng(5, 10, rng)
<< std::endl;
boost::ecuyer1988 rng2(0);
std::cout << "boost::ecuyer1988: "
<< normal_rng(5, 10, rng2) << ", "
<< normal_rng(5, 10, rng2) << ", "
<< normal_rng(5, 10, rng2) << ", "
<< normal_rng(5, 10, rng2)
<< std::endl;
return 0;
}Gives:
stan::rng_t: 5, 5, 5, 5
boost::ecuyer1988: -4.52988, 8.12959, 2.12997, 5.78816
Current Version:
v2.35.0
Metadata
Metadata
Assignees
Labels
No labels