RandomTools - Maple Programming 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

Description

Examples

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,RandomExpand,RemoveFlavor,SetState

(1)

sGetState

(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]