functionSetSeed
SetSeed
Information
SetSeed
Syntax
SetSeed(g,seed)
Description
Changes the initial seed of the RngStream g. This modificatioin also changes the current state of the RngStream.
Examples
g2 := g1;
for i in 1:3 loop
(u1[i],g1) := CMRG.RandU01(g1);
(u2[i],g2) := CMRG.RandU01(g2);
end for;
g2 := CMRG.SetSeed(g2,{2345,2435,2345,2345,2345,2345});
for i in 4:6 loop
(u1[i],g1) := CMRG.RandU01(g1);
(u2[i],g2) := CMRG.RandU01(g2);
end for;
// u1 = {0.586819,0.848015,0.494309,0.609745,0.698027,0.812434}
// u2 = {0.586819,0.848015,0.494309,0.813362,0.517802,0.947542}
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| RngStream | g | RngStream | |
| Src.Seed | seed | New seed |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| RngStream | gout | Updated RngStream | |
| Integer | out | result (0 == success) |