Threefry4x64.FromKey Method

Definition

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

Overload List

FromKey(ReadOnlySpan<UInt64>) Creates a new Threefry4x64 instance with the specified key and counter initialized to zero.
FromKey(ReadOnlySpan<UInt64>, ReadOnlySpan<UInt64>) Creates a new Threefry4x64 instance with the specified key and counter.

FromKey(ReadOnlySpan<UInt64>)

Creates a new Threefry4x64 instance with the specified key and counter initialized to zero.
C#
public static Threefry4x64 FromKey(
	ReadOnlySpan<ulong> key
)

Parameters

key  ReadOnlySpan<UInt64>
The 256-bit key (4 × 64-bit words).

Return Value

Threefry4x64
A new Threefry4x64 instance with the specified key and zero counter.

Remarks

This factory method directly sets the Threefry key and initializes the counter to zero, providing direct access to the counter-based RNG's key/counter interface.

Exceptions

ArgumentExceptionThrown when key length is not exactly 4.

FromKey(ReadOnlySpan<UInt64>, ReadOnlySpan<UInt64>)

Creates a new Threefry4x64 instance with the specified key and counter.
C#
public static Threefry4x64 FromKey(
	ReadOnlySpan<ulong> key,
	ReadOnlySpan<ulong> counter
)

Parameters

key  ReadOnlySpan<UInt64>
The 256-bit key (4 × 64-bit words).
counter  ReadOnlySpan<UInt64>
The 256-bit counter (4 × 64-bit words).

Return Value

Threefry4x64
A new Threefry4x64 instance with the specified key and counter.

Remarks

This factory method directly sets the Threefry key and counter, providing direct access to the counter-based RNG's key/counter interface.

Exceptions

ArgumentExceptionThrown when key or counter length is incorrect.

See Also