Click or drag to resize

Ran004 Class

Ran004: W.H. Press/S.A. Teukolsky: Numerical Recipes pseudo-DES ran4. Returns an integer random number uniformly distributed within [0,4294967295].
Inheritance Hierarchy
SystemObject
  Altaxo.Calc.Probability.OldRandomGenerator
    Altaxo.Calc.Probability.OldRan004

Namespace: Altaxo.Calc.Probability.Old
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntax
C#
public class Ran004 : RandomGenerator

The Ran004 type exposes the following members.

Constructors
 NameDescription
Public methodRan004Initializes a new instance of the Ran004 class.
Public methodRan004(UInt32)Initializes a new instance of the Ran004 class with a specified seed.
Top
Properties
 NameDescription
Public propertyMaximumThe maximum value of the random number which can be returned.
(Inherited from RandomGenerator)
Public propertySeedGets the current seed value.
(Inherited from RandomGenerator)
Top
Methods
 NameDescription
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodLongThe generation function.
(Overrides RandomGeneratorLong)
Public methodLong(UInt32, UInt32) Resets the sequence to a specified seed and position and returns that deviate.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Fields
 NameDescription
Protected fieldmax_valUniform long int values within [0...max_val].
(Inherited from RandomGenerator)
Protected fieldseedThe seed of the random generator.
(Inherited from RandomGenerator)
Top
Remarks
The period length for one seed is 2^32, but the seed is incremented automatically if the series for one seed is exhausted. There are 2^32 possible seeds. Notes: a) The original version of Ref. (1) is not portable to machines with larger word lengths. That means different random sequences are obtained for 32-bit long integers and 64-bit long integers. This version is made portable by using bit-masks. The run time penalty is negligible. b) The random sequence for one seed has only a period of maximally 2^32. This is definitely too short for modern MC simulations. In this version the seed is automatically incremented to jump to the next segment when one segment is exhausted. c) Also the extremely inconvenient interface of the original has been changed. Reference: (1) W.H. Press, S.A. Teukolsky, Vetterling, Teukolsky, Numerical Recipes in C, 2nd edition, 1992. (2) Major modifications a) to c) and inclusion into Matpack by B. M. Gammel, Apr 1, 1997 (no joke!)
See Also