Created
December 13, 2017 03:03
-
-
Save slwu89/92e391cc197c543de75b950de4f930ce to your computer and use it in GitHub Desktop.
quick & dirty prng
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef test_rng_hpp | |
#define test_rng_hpp | |
#include <random> | |
#include <stdio.h> | |
class rng_test { | |
public: | |
rng_test(const uint_least32_t &seed) : rng(seed) { | |
runif = std::uniform_real_distribution<double>(0,1); | |
}; | |
~rng_test(){}; | |
double get_runif(){ | |
return runif(rng); | |
}; | |
private: | |
std::mt19937 rng; | |
std::uniform_real_distribution<double> runif; | |
}; | |
#endif /* test_rng_hpp */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment