Changeset 4258 for trunk/sources/HeuristicLab.Random/3.3/FastRandom.cs
- Timestamp:
- 08/19/10 05:38:47 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Random/3.3/FastRandom.cs
r4243 r4258 1 1 using System; 2 using HeuristicLab.Common; 2 3 using HeuristicLab.Core; 3 4 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 43 44 /// </summary> 44 45 [StorableClass] 45 public class FastRandom : Item, IRandom {46 public sealed class FastRandom : Item, IRandom { 46 47 // The +1 ensures NextDouble doesn't generate 1.0 47 48 private const double REAL_UNIT_INT = 1.0 / ((double)int.MaxValue + 1.0); … … 70 71 Reinitialise(seed); 71 72 } 73 74 /// <summary> 75 /// Used by HeuristicLab.Persistence to initialize new instances during deserialization. 76 /// </summary> 77 /// <param name="deserializing">true, if the constructor is called during deserialization.</param> 78 [StorableConstructor] 79 private FastRandom(bool deserializing) : base(deserializing) { } 72 80 73 81 #endregion … … 319 327 } 320 328 return (bitBuffer & (bitMask >>= 1)) == 0; 321 } 329 } 322 330 // Buffer 32 bits in bitBuffer, return 1 at a time, keep track of how many have been returned 323 331 // with bitBufferIdx. … … 328 336 329 337 330 #endregion 338 #endregion 331 339 332 340 #region IRandom Members … … 340 348 } 341 349 342 #endregion 343 344 public override Common.IDeepCloneable Clone(Common.Cloner cloner) {350 #endregion 351 352 public override IDeepCloneable Clone(Cloner cloner) { 345 353 FastRandom clone = (FastRandom)base.Clone(cloner); 346 354 clone.x = x;
Note: See TracChangeset
for help on using the changeset viewer.