Text archives Help
- From: thiago@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1918 - trunk/Core/Math
- Date: Tue, 11 Dec 2007 20:22:04 -0700 (MST)
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;
- [Manta] r1918 - trunk/Core/Math, thiago, 12/11/2007
Archive powered by MHonArc 2.6.16.