[mlpack-svn] r17395 - mlpack/trunk/src/mlpack/core/math
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Nov 19 13:52:57 EST 2014
Author: rcurtin
Date: Wed Nov 19 13:52:57 2014
New Revision: 17395
Log:
Handle setting seed properly for Armadillo RNGs past 3.930.
Modified:
mlpack/trunk/src/mlpack/core/math/random.hpp
Modified: mlpack/trunk/src/mlpack/core/math/random.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/math/random.hpp (original)
+++ mlpack/trunk/src/mlpack/core/math/random.hpp Wed Nov 19 13:52:57 2014
@@ -49,6 +49,12 @@
{
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
}
/**
More information about the mlpack-svn
mailing list