C# 클래스 RandomOps.XorShift

Pseudo-Random Number Generator (PRNG) based on XorShift as described in the paper: G. Marsaglia, Random Number Generators, Journal of Modern Applied Statistical Methods, 2003, vol. 2, no. 1, p. 2-13. Period of this PRNG is about 2^160. Not thread-safe.
This is a translation of the C source-code published 2003-05-13 in the newsgroup comp.lang.c by George Marsaglia, published here with Marsaglia's authorization under the license in license.txt
상속: RanUInt32Array
파일 보기 프로젝트 열기: DanWBR/dwsim3

공개 프로퍼티들

프로퍼티 타입 설명
SeedDefault System.UInt32[]

공개 메소드들

메소드 설명
Rand ( ) : UInt32

Draw a random number in inclusive range {0, .., RandMax}

Seed ( UInt32 seed ) : void

Seed with an array.

XorShift ( ) : System

Constructs the PRNG-object without a seed. Remember to seed it before drawing random numbers.

XorShift ( Random rand ) : System

Constructs the PRNG-object and uses another RNG for seeding.

XorShift ( UInt32 seed ) : System

Constructs the PRNG-object using the designated seed. This is useful if you want to repeat experiments with the same sequence of pseudo-random numbers.

메소드 상세

Rand() 공개 최종 메소드

Draw a random number in inclusive range {0, .., RandMax}
public final Rand ( ) : UInt32
리턴 System.UInt32

Seed() 공개 최종 메소드

Seed with an array.
public final Seed ( UInt32 seed ) : void
seed System.UInt32
리턴 void

XorShift() 공개 메소드

Constructs the PRNG-object without a seed. Remember to seed it before drawing random numbers.
public XorShift ( ) : System
리턴 System

XorShift() 공개 메소드

Constructs the PRNG-object and uses another RNG for seeding.
public XorShift ( Random rand ) : System
rand Random
리턴 System

XorShift() 공개 메소드

Constructs the PRNG-object using the designated seed. This is useful if you want to repeat experiments with the same sequence of pseudo-random numbers.
public XorShift ( UInt32 seed ) : System
seed System.UInt32
리턴 System

프로퍼티 상세

SeedDefault 공개적으로 정적으로 프로퍼티

Default seed.
public static UInt32[],System SeedDefault
리턴 System.UInt32[]