Get the state of the RandomTools Generator - Maple Help

Online Help

All Products    Maple    MapleSim


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

RandomTools[GetState] - Get the state of the RandomTools Generator

Calling Sequence

GetState( )

Description

• 

The GetState command returns the internal state of the pseudo-random number generator used by Generate.  Currently the Mersenne Twister generator is used.

• 

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

Examples

withRandomTools

AddFlavor,BlumBlumShub,Generate,GetFlavor,GetFlavors,GetState,HasFlavor,LinearCongruence,MersenneTwister,QuadraticCongruence,RemoveFlavor,SetState,returnValueInertProc

(1)

s:=GetState

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

(2)

seqGenerateinteger,i=1..5

104281139460,306860183579,477575829529,300187484465,72447943125

(3)

SetStatestate=s

seqGenerateinteger,i=1..5

104281139460,306860183579,477575829529,300187484465,72447943125

(4)

See Also

rand, RandomTools, RandomTools[Generate], RandomTools[MersenneTwister], RandomTools[MersenneTwister][GetState] 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