sample

package
v0.0.0-...-22cda3e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From(m int) iter.Seq[int]

From returns a sequence of unique pseudo-random integers in [0, m). The sequence yields each value at most once and stops when the caller stops iterating; callers should not consume more than m values.

func Take

func Take(n, m int) iter.Seq2[int, int]

Take returns a sequence of exactly n unique samples drawn from [0, m). It yields pairs (i, r) where i is the 0-based sample index (0..n-1) and r is the sampled value. Requires 0 < n < m.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL