Table of Contents

Class SeedlessSeedSequence

Namespace
NumSharp
Assembly
NumSharp.dll

A seed sequence for bit generators that need no seed state (NumPy's numpy.random.bit_generator.SeedlessSeedSequence).

public sealed class SeedlessSeedSequence : ISpawnableSeedSequence, ISeedSequence
Inheritance
SeedlessSeedSequence
Implements
Inherited Members

Remarks

It cannot produce words — seeding a bit generator from it fails in the constructor, as in NumPy — and it "spawns" itself: spawn(n) is [self] * n.

Methods

generate_state(long, DType)

Always fails: a seedless sequence has no state to generate from.

public NDArray generate_state(long n_words, DType dtype = null)

Parameters

n_words long

Ignored.

dtype DType

Ignored.

Returns

NDArray

Never returns.

Exceptions

NotImplementedError

Always (NumPy's NotImplementedError('seedless SeedSequences cannot generate state'), type and text).

spawn(int)

Returns this same instance n_children times (NumPy's [self] * n_children).

public ISpawnableSeedSequence[] spawn(int n_children)

Parameters

n_children int

The number of "children" (0: none).

Returns

ISpawnableSeedSequence[]

An array whose every element is this instance.

Exceptions

ValueError

n_children is negative: NumPy 2.5's n_children must be non-negative (NumPy 2.4 returned an empty list, Python's [self] * -1).