Skip to content

Tessero\Sparse\SparseRandom

← All classes

AI assistant

Build this with Claude Code, Cursor or Copilot

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

randomArray static
randomArray(array $shape, float $density = 0.01, Tessero\Random\Generator|array|int $rng = 0): array

scipy.sparse.random_array(shape, density, rng=...). Returns the COO triplets as a map {'row': int[], 'col': int[], 'data': float[], 'shape': [m, n]}.

random static
random(int $m, ?int $n = null, float $density = 0.01, Tessero\Random\Generator|array|int $rng = 0): array

scipy.sparse.random(m, n, density, rng=...) — identical math to {@see randomArray}; scipy only differs in returning a coo_matrix rather than a coo_array.

rand static
rand(int $m, ?int $n = null, float $density = 0.01, Tessero\Random\Generator|array|int $rng = 0): array

scipy.sparse.rand(m, n, density, rng=...) — alias of {@see random} (uniform [0,1) data only).

choiceNoReplace static
choiceNoReplace(Tessero\Random\Generator $g, int $pop, int $size): array

numpy.random.Generator.choice(pop, size, replace=False, p=None), shuffle=True — returns the chosen raveled indices in numpy's exact order. All index draws use the Lemire bounded path (Generator::integers), matching numpy's random_bounded_uint64(..., use_masked=0).