Last active
June 21, 2017 10:15
-
-
Save vigsterkr/9fcf6e76b52e96e339246bec65bb2ddf to your computer and use it in GitHub Desktop.
new random in shogun prototype
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
template <typename RandomEngine = std::mt19937> class CRandom { | |
public: | |
CRandom() { | |
} | |
CRandom(uint32_t seed); | |
~CRandom(); | |
int32_t random(int32_t from, int32_t to) const | |
{ | |
std::uniform_int_distribution<int> uniform_dist(from, to); | |
return uniform_dist(m_engine); | |
} | |
private: | |
RandomEngine m_engine; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment