/* rng-omp.cpp */ #include "rng-omp.h" /* constructor */ RNG::RNG(unsigned int threads): _engines(), _distribution( 0.0 , 1.0 ) { for(unsigned int i = 0; i < threads; ++i) _engines.push_back( std::mt19937( i + 1 ) ); } /* get uniform distributed random number in (0,1) */ auto RNG::operator()() -> double { return _distribution( _engines[ omp_get_thread_num() ] ); } /* End of File */