Author: thiago
Date: Tue Dec 11 20:22:04 2007
New Revision: 1918
Modified:
trunk/Core/Math/CheapRNG.h
Log:
seed wasn't being called which resulted in an uninitialized value
for val. This caused tons of warnings in valgrind. It also meant
that val_see remained uninitialized and possibly contained the same
4 values. If you don't want create() to call seed, then make sure
seed is called somewhere else!
Modified: trunk/Core/Math/CheapRNG.h
====================================================================== ========
--- trunk/Core/Math/CheapRNG.h (original)
+++ trunk/Core/Math/CheapRNG.h Tue Dec 11 20:22:04 2007
@@ -79,7 +79,10 @@
public:
// Your seed value is up to the fates. You should call seed.
CheapRNG() {}
- static void create(RandomNumberGenerator*& rng ) { rng = new CheapRNG(); }
+ static void create(RandomNumberGenerator*& rng ) {
+ rng = new CheapRNG();
+ rng->seed(0);
+ }
virtual void seed(unsigned int seed_val) {
val = seed_val;
Archive powered by MHonArc 2.6.16.