RandomSources.Create Method

Definition

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

Overload List

Create(Int64) Creates a high-performance, reproducible random source from the specified seed.
Create(Int64, UInt64) Creates a reproducible random source from the specified seed and deterministic stream ID.
Create<T>() Creates a non-deterministic random source of the specified type.
Create<T>(Int64) Creates a reproducible random source of the specified type from the given seed.
Create<T>(Int64, UInt64) Creates a reproducible random source of the specified type from the given seed and stream identifier.

Create<T>

Creates a non-deterministic random source of the specified type.
C#
public static T Create<T>()
where T : Object, IRandomSourceFactory<T>

Type Parameters

T
The random source type to create.

Return Value

T
A random source instance of type T.

Create(Int64)

Creates a high-performance, reproducible random source from the specified seed.
C#
public static Xoshiro256StarStar Create(
	long seed
)

Parameters

seed  Int64
 

Return Value

Xoshiro256StarStar

Remarks

This returns a RNG type to allow maximum JIT inlining when passed into performance-critical code.

Create<T>(Int64)

Creates a reproducible random source of the specified type from the given seed.
C#
public static T Create<T>(
	long seed
)
where T : Object, IRandomSourceFactory<T>

Parameters

seed  Int64
The seed used to initialize the random source.

Type Parameters

T
The random source type to create.

Return Value

T
A random source instance of type T.

Create(Int64, UInt64)

Creates a reproducible random source from the specified seed and deterministic stream ID.
C#
public static Xoshiro256StarStar Create(
	long seed,
	ulong streamId
)

Parameters

seed  Int64
 
streamId  UInt64
 

Return Value

Xoshiro256StarStar

Remarks

Stream IDs are intended to produce independent deterministic streams for parallel or multi-stream use.

Create<T>(Int64, UInt64)

Creates a reproducible random source of the specified type from the given seed and stream identifier.
C#
public static T Create<T>(
	long seed,
	ulong streamId
)
where T : Object, IRandomSourceFactory<T>

Parameters

seed  Int64
The base seed used to initialize the random source.
streamId  UInt64
A deterministic stream identifier used to create an independent stream.

Type Parameters

T
The random source type to create.

Return Value

T
A random source instance of type T.

See Also