RandomTools[LinearCongruence]
SetState
Set the internal state of the Linear Congruence Generator
Calling Sequence
Parameters
Description
Examples
SetState( option )
option
-
(optional) argument of the form option=value where option is state
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.
with⁡RandomToolsLinearCongruence
GenerateInteger,GetState,NewGenerator,SetState
s≔GetState⁡
s≔1
seq⁡GenerateInteger⁡,i=1..5
427419669081,321110693270,343633073697,474256143563,558458718976
SetState⁡state=1234567
218604127385,665262624842,52899550817,984396582721,705317627386
SetState⁡state=s
See Also
rand
RandomTools
RandomTools[Generate]
RandomTools[GetState]
RandomTools[LinearCongruence][GenerateInteger]
RandomTools[LinearCongruence][GetState]
RandomTools[SetState]
Download Help Document