sampleConstrainedPair(
random,options): readonly [number,number]
Defined in: packages/sampling/src/sample-pair.ts:54
Sample uniformly from ascending integer pairs whose gap is in the inclusive
interval [minimumGap, maximumGap].
Valid pairs are ranked by increasing gap and then increasing first index. Rank lookup takes O(log(maximumGap - minimumGap + 1)) time and O(1) auxiliary space. The options object is not mutated.
Parameters
Section titled “Parameters”random
Section titled “random”options
Section titled “options”Returns
Section titled “Returns”readonly [number, number]
Throws
Section titled “Throws”With code INVALID_RANGE when bounds do
not describe a supported range or the range contains more than 2^32 valid
pairs, or INVALID_GAP when the gap interval is invalid for the range.
Throws
Section titled “Throws”With code INVALID_SOURCE_VALUE when the
random source returns a value outside [0, 1).