Changeset 580 for library/bdm/itpp_ext.cpp
- Timestamp:
- 08/22/09 15:36:24 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/itpp_ext.cpp
r579 r580 378 378 379 379 class RandunStorage{ 380 const doubleA;381 const doubleM;380 const int A; 381 const int M; 382 382 static double seed; 383 383 static int counter; … … 385 385 RandunStorage(): A(16807), M(2147483647) {}; 386 386 void set_seed(double seed0){seed=seed0;} 387 double get(){seed=mod(A*seed,M); counter++; return seed/M;} 387 double get(){ 388 int tmp=mod(A*seed,M); 389 seed =tmp; 390 counter++; 391 return seed/M;} 388 392 }; 389 393 static RandunStorage randun_global_storage;