Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/19/10 05:38:47 (14 years ago)
Author:
swagner
Message:

Worked in integration of FastRandom PRNG (#1114)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Random/3.3/FastRandom.cs

    r4243 r4258  
    11using System;
     2using HeuristicLab.Common;
    23using HeuristicLab.Core;
    34using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    4344  /// </summary>
    4445  [StorableClass]
    45   public class FastRandom : Item, IRandom {
     46  public sealed class FastRandom : Item, IRandom {
    4647    // The +1 ensures NextDouble doesn't generate 1.0
    4748    private const double REAL_UNIT_INT = 1.0 / ((double)int.MaxValue + 1.0);
     
    7071      Reinitialise(seed);
    7172    }
     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) { }
    7280
    7381    #endregion
     
    319327      }
    320328      return (bitBuffer & (bitMask >>= 1)) == 0;
    321     }           
     329    }
    322330    // Buffer 32 bits in bitBuffer, return 1 at a time, keep track of how many have been returned
    323331    // with bitBufferIdx.
     
    328336
    329337
    330     #endregion   
     338    #endregion
    331339
    332340    #region IRandom Members
     
    340348    }
    341349
    342     #endregion   
    343 
    344     public override Common.IDeepCloneable Clone(Common.Cloner cloner) {
     350    #endregion
     351
     352    public override IDeepCloneable Clone(Cloner cloner) {
    345353      FastRandom clone = (FastRandom)base.Clone(cloner);
    346354      clone.x = x;
Note: See TracChangeset for help on using the changeset viewer.