Skip to content

Instantly share code, notes, and snippets.

@vigsterkr
Last active June 21, 2017 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vigsterkr/9fcf6e76b52e96e339246bec65bb2ddf to your computer and use it in GitHub Desktop.
Save vigsterkr/9fcf6e76b52e96e339246bec65bb2ddf to your computer and use it in GitHub Desktop.
new random in shogun prototype
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