Random Options Constructor
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Overload List
| Random | Constructs a new RandomOptions with the specified parameters. |
| Random | Constructs a new RandomOptions with a uint[] seed array. |
| Random | Constructs a new RandomOptions with the specified parameters. |
RandomOptions(Int64, StreamAddress, SeedProfile)
public RandomOptions(
long seed,
StreamAddress streamAddress = default,
SeedProfile seedProfile = SeedProfile.Default
)Parameters
- seed Int64
- The seed value used for initialization.
- streamAddress StreamAddress (Optional)
- Optional stream address (default: empty).
- seedProfile SeedProfile (Optional)
- The seed profile (default: Default).
Remarks
This constructor does not perform validation. Validation should be performed at public API boundaries by calling Validate.
The seed is stored as a scalar ulong (via unchecked cast), which will be flattened to uint[] internally.
Exceptions
| Argument | seedProfile is not a valid SeedProfile value. |
RandomOptions(ReadOnlySpan<UInt32>, StreamAddress, SeedProfile)
public RandomOptions(
ReadOnlySpan<uint> seedArray,
StreamAddress streamAddress = default,
SeedProfile seedProfile = SeedProfile.Default
)Parameters
- seedArray ReadOnlySpan<UInt32>
- The 32-bit seed array values.
- streamAddress StreamAddress (Optional)
- Optional stream address (default: empty).
- seedProfile SeedProfile (Optional)
- The seed profile (default: Default).
Remarks
This constructor is primarily used by 32-bit RNGs.
The seed array is used as-is (cloned for immutability).
Exceptions
| Argument | seedArray is null. |
| Argument | seedProfile is not a valid SeedProfile value. |
RandomOptions(ReadOnlySpan<UInt64>, StreamAddress, SeedProfile)
public RandomOptions(
ReadOnlySpan<ulong> seedArray,
StreamAddress streamAddress = default,
SeedProfile seedProfile = SeedProfile.Default
)Parameters
- seedArray ReadOnlySpan<UInt64>
- The seed array values.
- streamAddress StreamAddress (Optional)
- Optional stream address (default: empty).
- seedProfile SeedProfile (Optional)
- The seed profile (default: Default).
Remarks
This constructor does not perform validation. Validation should be performed at public API boundaries by calling Validate.
The seed array is flattened to uint[] internally, with each ulong split into two uint values in little-endian order.
Exceptions
| Argument | seedArray is null. |
| Argument | seedProfile is not a valid SeedProfile value. |