Changeset 6879
- Timestamp:
- 10/06/11 11:03:34 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Random/3.3/MersenneTwister.cs
r5445 r6879 75 75 /// </summary> 76 76 public MersenneTwister() { 77 if (!init) seed((uint)DateTime.Now.Ticks);77 if (!init) Seed((uint)DateTime.Now.Ticks); 78 78 init = true; 79 79 } … … 84 84 /// <param name="s">The seed with which to initialize the random number generator.</param> 85 85 public MersenneTwister(uint s) { 86 seed(s);86 Seed(s); 87 87 init = true; 88 88 } … … 92 92 /// <param name="array">The seed array with which to initialize the random number generator.</param> 93 93 public MersenneTwister(uint[] array) { 94 seed(array);94 Seed(array); 95 95 init = true; 96 96 } … … 110 110 public void Reset() { 111 111 lock (locker) 112 seed((uint)DateTime.Now.Ticks);112 Seed((uint)DateTime.Now.Ticks); 113 113 } 114 114 /// <summary> … … 118 118 public void Reset(int s) { 119 119 lock (locker) 120 seed((uint)s);120 Seed((uint)s); 121 121 } 122 122 … … 176 176 /// </summary> 177 177 /// <param name="s">A starting seed.</param> 178 public void seed(uint s) {178 public void Seed(uint s) { 179 179 state[0] = s & 0xFFFFFFFFU; 180 180 for (int i = 1; i < n; ++i) { … … 188 188 /// </summary> 189 189 /// <param name="array">A starting seed array.</param> 190 public void seed(uint[] array) {191 seed(19650218U);190 public void Seed(uint[] array) { 191 Seed(19650218U); 192 192 int i = 1, j = 0; 193 193 for (int k = ((n > array.Length) ? n : array.Length); k > 0; --k) {
Note: See TracChangeset
for help on using the changeset viewer.