Skip to content

Tessero\Random\MT19937

← All classes

AI assistant

Build this with Claude Code, Cursor or Copilot

Copy a Tessero-tuned prompt for Tessero\Random\MT19937, grounded in 9 real API signatures , into your IDE's AI. No chatbot, just exact context.

__construct
__construct(array|int $seed)

(→ init_by_array), exactly as numpy.random.RandomState accepts.

nextUint32
nextUint32(): int

The next tempered 32-bit word (numpy next_uint32 / genrand_uint32).

nextDouble
nextDouble(): float

A single double in [0, 1) (numpy legacy next_double / random_sample).

randomSample
randomSample(int $n): array
nextGauss
nextGauss(): float

A single standard normal (numpy legacy gauss: Box–Muller polar).

standardNormal
standardNormal(int $n): array
randomInterval
randomInterval(int $max): int

A uniform integer in [0, $max] by numpy's smallest-mask rejection (rk_interval). Uses a 32-bit draw when the range fits in 32 bits, else a 64-bit draw — matching numpy's legacy buffered path.

randint
randint(int $low, int $high, int $size): array
permutation
permutation(int $n): array
shuffle
shuffle(array $arr): void

In-place legacy Fisher–Yates shuffle (numpy RandomState.shuffle).