Changeset 8805
- Timestamp:
- 10/15/12 09:35:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ALGLIB/3.6.0/ALGLIB-3.6.0/ap.cs
r8803 r8805 493 493 //public static System.Random RndObject = new System.Random(System.DateTime.Now.Millisecond); 494 494 [ThreadStatic] //mkommend: added thread static attribute to RNG to have a separate instance per thread and allow modification of the seed 495 public static System.Random rndobject = new System.Random(System.DateTime.Now.Millisecond + 1000 * System.DateTime.Now.Second + 60 * 1000 * System.DateTime.Now.Minute);495 public static System.Random rndobject; 496 496 497 497 public const double machineepsilon = 5E-16; … … 505 505 public static double randomreal() { 506 506 double r = 0; 507 if (rndobject == null) rndobject = new System.Random(System.DateTime.Now.Millisecond + 1000 * System.DateTime.Now.Second + 60 * 1000 * System.DateTime.Now.Minute); 507 508 lock (rndobject) { r = rndobject.NextDouble(); } 508 509 return r; … … 510 511 public static int randominteger(int N) { 511 512 int r = 0; 513 if (rndobject == null) rndobject = new System.Random(System.DateTime.Now.Millisecond + 1000 * System.DateTime.Now.Second + 60 * 1000 * System.DateTime.Now.Minute); 512 514 lock (rndobject) { r = rndobject.Next(N); } 513 515 return r;
Note: See TracChangeset
for help on using the changeset viewer.