Xoshiro 256Star Star Constructor
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Overload List
| Xoshiro256Star | Constructs a new Xoshiro256** random number generator with a cryptographically generated seed. |
| Xoshiro256Star | Constructs a new Xoshiro256** random number generator with advanced options. |
| Xoshiro256Star | Constructs a new Xoshiro256** random number generator from saved state. |
| Xoshiro256Star | Constructs a new Xoshiro256** with the specified seed and seed profile. |
| Xoshiro256Star | Constructs a new Xoshiro256** with the specified seed array and seed profile. |
| Xoshiro256Star | Constructs a new Xoshiro256** random number generator with the specified seed. |
| Xoshiro256Star | Constructs a new Xoshiro256** random number generator with a seed array. |
| Xoshiro256Star | Initializes a new instance of the Xoshiro256StarStar class with direct state initialization. |
Xoshiro256StarStar
public Xoshiro256StarStar()Remarks
This constructor uses the Independent seed profile. It provides a convenient way to create a unique, statistically sound random source without requiring manual seed management.
For large-scale parallel simulations requiring a high degree of coordination between many streams, consider using the explicit streaming methods provided by RandomStreamTree<TRandom> or RandomStreamPartition<TRandom>.
Xoshiro256StarStar(RandomOptions)
Example
var options = new RandomOptions(12345, SeedProfile.Numpy, 0);
var rng = new Xoshiro256StarStar(options);Xoshiro256StarStar(ReadOnlySpan<Byte>)
public Xoshiro256StarStar(
ReadOnlySpan<byte> state
)Parameters
- state ReadOnlySpan<Byte>
- The saved state to restore.
Remarks
This constructor bypasses initialization and directly loads the state. Use this for exact continuation from a previously saved state.
Example
var rng1 = new Xoshiro256StarStar(42);
rng1.NextUInt64(); // advance state
byte[] state = rng1.GetState();
var rng2 = new Xoshiro256StarStar(state); // exact continuationXoshiro256StarStar(Int64, SeedProfile)
public Xoshiro256StarStar(
long seed,
SeedProfile seedProfile
)Parameters
- seed Int64
- seedProfile SeedProfile
Xoshiro256StarStar(ReadOnlySpan<UInt64>, SeedProfile)
public Xoshiro256StarStar(
ReadOnlySpan<ulong> seedMaterial,
SeedProfile seedProfile
)Parameters
- seedMaterial ReadOnlySpan<UInt64>
- seedProfile SeedProfile
Xoshiro256StarStar(Int64, StreamAddress, SeedProfile)
public Xoshiro256StarStar(
long seed,
StreamAddress streamAddress = default,
SeedProfile seedProfile = SeedProfile.Default
)Parameters
- seed Int64
- streamAddress StreamAddress (Optional)
- seedProfile SeedProfile (Optional)
Example
var rng = new Xoshiro256StarStar(123);
int n = rng.Next(100);Xoshiro256StarStar(ReadOnlySpan<UInt64>, StreamAddress, SeedProfile)
public Xoshiro256StarStar(
ReadOnlySpan<ulong> seedMaterial,
StreamAddress streamAddress = default,
SeedProfile seedProfile = SeedProfile.Default
)Parameters
- seedMaterial ReadOnlySpan<UInt64>
- streamAddress StreamAddress (Optional)
- seedProfile SeedProfile (Optional)
Xoshiro256StarStar(UInt64, UInt64, UInt64, UInt64)
public Xoshiro256StarStar(
ulong s0,
ulong s1,
ulong s2,
ulong s3
)Parameters
Remarks
This constructor directly sets the four 64-bit state words. The state must not be all zeros.
Exceptions
| Argument | All state words are zero. |