ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/math/MersenneTwister.hpp
(Generate patch)

Comparing trunk/OOPSE-4/src/math/MersenneTwister.hpp (file contents):
Revision 2066 by gezelter, Tue Mar 1 15:26:13 2005 UTC vs.
Revision 2068 by tim, Tue Mar 1 19:11:47 2005 UTC

# Line 66 | Line 66
66   #include <stdio.h>
67   #include <time.h>
68   #include <math.h>
69 + #include <vector>
70 + namespace oopse {
71  
72   class MTRand {
73   // Data
# Line 116 | Line 118 | class MTRand { (public)
118          void seed( const uint32 oneSeed );
119          void seed( uint32 *const bigSeed, const uint32 seedLength = N );
120          void seed();
121 <        
121 >
122 >        std::vector<uint32>generateSeeds();    
123 >        
124          // Saving and loading generator state
125          void save( uint32* saveArray ) const;  // to array of size SAVE
126          void load( uint32 *const loadArray );  // from such array
# Line 289 | Line 293 | inline void MTRand::seed()
293  
294   inline void MTRand::seed()
295   {
296 <  vector<uint32> seeds;
296 >  std::vector<uint32> seeds;
297  
298    seeds = generateSeeds();
299  
# Line 301 | Line 305 | inline vector<uint32> MTRand::generateSeeds() {
305   }
306  
307  
308 < inline vector<uint32> MTRand::generateSeeds() {
308 > inline std::vector<MTRand::uint32> MTRand::generateSeeds() {
309    // Seed the generator with an array from /dev/urandom if available
310    // Otherwise use a hash of time() and clock() values
311  
312 <  vector<uint32> bigSeed;
312 >  std::vector<uint32> bigSeed;
313  
314    // First try getting an array from /dev/urandom
315    FILE* urandom = fopen( "/dev/urandom", "rb" );
# Line 428 | Line 432 | inline std::istream& operator>>( std::istream& is, MTR
432          return is;
433   }
434  
435 + }
436   #endif  // MERSENNETWISTER_H
437  
438   // Change log:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines