Xoshiro256StarStar Constructor

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0

Overload List

Xoshiro256StarStar() Constructs a new Xoshiro256** random number generator with a cryptographically generated seed.
Xoshiro256StarStar(RandomOptions) Constructs a new Xoshiro256** random number generator with advanced options.
Xoshiro256StarStar(ReadOnlySpan<Byte>) Constructs a new Xoshiro256** random number generator from saved state.
Xoshiro256StarStar(Int64, SeedProfile) Constructs a new Xoshiro256** with the specified seed and seed profile.
Xoshiro256StarStar(ReadOnlySpan<UInt64>, SeedProfile) Constructs a new Xoshiro256** with the specified seed array and seed profile.
Xoshiro256StarStar(Int64, StreamAddress, SeedProfile) Constructs a new Xoshiro256** random number generator with the specified seed.
Xoshiro256StarStar(ReadOnlySpan<UInt64>, StreamAddress, SeedProfile) Constructs a new Xoshiro256** random number generator with a seed array.
Xoshiro256StarStar(UInt64, UInt64, UInt64, UInt64) Initializes a new instance of the Xoshiro256StarStar class with direct state initialization.

Xoshiro256StarStar

Constructs a new Xoshiro256** random number generator with a cryptographically generated seed.
C#
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)

Constructs a new Xoshiro256** random number generator with advanced options.
C#
public Xoshiro256StarStar(
	 in RandomOptions options
)

Parameters

options  RandomOptions
 

Example

C#
var options = new RandomOptions(12345, SeedProfile.Numpy, 0);
var rng = new Xoshiro256StarStar(options);

Xoshiro256StarStar(ReadOnlySpan<Byte>)

Constructs a new Xoshiro256** random number generator from saved state.
C#
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

C#
var rng1 = new Xoshiro256StarStar(42);
rng1.NextUInt64(); // advance state
byte[] state = rng1.GetState();

var rng2 = new Xoshiro256StarStar(state); // exact continuation

Xoshiro256StarStar(Int64, SeedProfile)

Constructs a new Xoshiro256** with the specified seed and seed profile.
C#
public Xoshiro256StarStar(
	long seed,
	SeedProfile seedProfile
)

Parameters

seed  Int64
 
seedProfile  SeedProfile
 

Xoshiro256StarStar(ReadOnlySpan<UInt64>, SeedProfile)

Constructs a new Xoshiro256** with the specified seed array and seed profile.
C#
public Xoshiro256StarStar(
	ReadOnlySpan<ulong> seedMaterial,
	SeedProfile seedProfile
)

Parameters

seedMaterial  ReadOnlySpan<UInt64>
 
seedProfile  SeedProfile
 

Xoshiro256StarStar(Int64, StreamAddress, SeedProfile)

Constructs a new Xoshiro256** random number generator with the specified seed.
C#
public Xoshiro256StarStar(
	long seed,
	StreamAddress streamAddress = default,
	SeedProfile seedProfile = SeedProfile.Default
)

Parameters

seed  Int64
 
streamAddress  StreamAddress  (Optional)
 
seedProfile  SeedProfile  (Optional)
 

Example

C#
var rng = new Xoshiro256StarStar(123);
int n = rng.Next(100);

Xoshiro256StarStar(ReadOnlySpan<UInt64>, StreamAddress, SeedProfile)

Constructs a new Xoshiro256** random number generator with a seed array.
C#
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)

Initializes a new instance of the Xoshiro256StarStar class with direct state initialization.
C#
public Xoshiro256StarStar(
	ulong s0,
	ulong s1,
	ulong s2,
	ulong s3
)

Parameters

s0  UInt64
First state word.
s1  UInt64
Second state word.
s2  UInt64
Third state word.
s3  UInt64
Fourth state word.

Remarks

This constructor directly sets the four 64-bit state words. The state must not be all zeros.

Exceptions

ArgumentExceptionAll state words are zero.

See Also