SetState - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


RandomTools[LinearCongruence]

  

SetState

  

Set the internal state of the Linear Congruence Generator

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

SetState( option )

Parameters

option

-

(optional) argument of the form option=value where option is state

Description

• 

The SetState command sets the state of the Linear Congruence pseudo-random number generator.

• 

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

• 

SetState accepts one optional argument, state.

  

state=integer

  

The state argument specifies the data used to set the state of the generator.  If the state argument is not given then the state is seeded using values taken from the system.

Examples

withRandomToolsLinearCongruence

GenerateInteger,GetState,NewGenerator,SetState

(1)

sGetState

s1

(2)

seqGenerateInteger,i=1..5

427419669081,321110693270,343633073697,474256143563,558458718976

(3)

SetStatestate=1234567

seqGenerateInteger,i=1..5

218604127385,665262624842,52899550817,984396582721,705317627386

(4)

SetStatestate=1234567

seqGenerateInteger,i=1..5

218604127385,665262624842,52899550817,984396582721,705317627386

(5)

SetStatestate=s

seqGenerateInteger,i=1..5

427419669081,321110693270,343633073697,474256143563,558458718976

(6)

See Also

rand

RandomTools

RandomTools[Generate]

RandomTools[GetState]

RandomTools[LinearCongruence]

RandomTools[LinearCongruence][GenerateInteger]

RandomTools[LinearCongruence][GetState]

RandomTools[SetState]