Get the internal state of the Mersenne Twister Generator - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Random Objects : RandomTools package : MersenneTwister Subpackage : RandomTools/MersenneTwister/GetState

RandomTools[MersenneTwister][GetState] - Get the internal state of the Mersenne Twister Generator

Calling Sequence

GetState( )

Description

• 

The GetState command returns the internal state of the Mersenne Twister pseudo-random number generator.  The state is an rtable of type integer4 with 625 entries.

• 

The state returned by GetState can be passed into SetState to regenerate a sequence of numbers.

Examples

withRandomTools[MersenneTwister]

GenerateData,GenerateFloat,GenerateFloat64,GenerateInteger,GenerateInteger32,GenerateUnsignedInt32,GetState,NewGenerator,SetState

(1)

s:=GetState

s:= 0 .. 624 ArrayData Type: integer4Storage: rectangularOrder: Fortran_order

(2)

seqGenerateInteger,i=1..5

395718860534,193139816415,22424170465,800187484459,427552056869

(3)

SetStatestate=s

seqGenerateInteger,i=1..5

395718860534,193139816415,22424170465,800187484459,427552056869

(4)

See Also

rand, RandomTools, RandomTools[Generate], RandomTools[GetState], RandomTools[MersenneTwister] RandomTools[MersenneTwister][GenerateInteger], RandomTools[MersenneTwister][SetState] RandomTools[SetState]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam