Handle setting seed properly for Armadillo RNGs past 3.930.

This commit is contained in:
Ryan Curtin
2014-11-19 18:52:57 +00:00
parent 00808b7fb5
commit 529a28152f
+6
View File
@@ -49,6 +49,12 @@ inline void RandomSeed(const size_t seed)
{
randGen.seed((uint32_t) seed);
srand((unsigned int) seed);
#if ARMA_VERSION_MAJOR > 3 || \
(ARMA_VERSION_MAJOR == 3 && ARMA_VERSION_MINOR >= 930)
// Armadillo >= 3.930 has its own random number generator internally that we
// need to set the seed for also.
arma::arma_rng::set_seed(seed);
#endif
}
/**