[mlpack] 114/149: Handle setting seed properly for Armadillo RNGs past 3.930.

Barak A. Pearlmutter barak+git at pearlmutter.net
Sat May 2 09:11:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit 4d83888e94d7542852aa4b2f67e027fa67196696
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Wed Nov 19 18:52:57 2014 +0000

    Handle setting seed properly for Armadillo RNGs past 3.930.
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17395 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/core/math/random.hpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mlpack/core/math/random.hpp b/src/mlpack/core/math/random.hpp
index 1425959..bb4b1f1 100644
--- a/src/mlpack/core/math/random.hpp
+++ b/src/mlpack/core/math/random.hpp
@@ -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
 }
 
 /**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list