Add Robot_JoyIt driver
This commit is contained in:
77
node_modules/pure-rand/CHANGELOG.md
generated
vendored
77
node_modules/pure-rand/CHANGELOG.md
generated
vendored
@@ -1,79 +1,26 @@
|
||||
# CHANGELOG 6.X
|
||||
# CHANGELOG 7.X
|
||||
|
||||
## 6.0.4
|
||||
## 7.0.1
|
||||
|
||||
### Fixes
|
||||
|
||||
- [716e073](https://github.com/dubzzz/pure-rand/commit/716e073) 🐛 Fix typings for node native esm (#649)
|
||||
- [c24bc93](https://github.com/dubzzz/pure-rand/commit/c24bc93) 🐛 Properly define exports in package.json (#758)
|
||||
|
||||
## 6.0.3
|
||||
|
||||
### Fixes
|
||||
|
||||
- [9aca792](https://github.com/dubzzz/pure-rand/commit/9aca792) 🏷️ Better declare ESM's types (#634)
|
||||
|
||||
## 6.0.2
|
||||
|
||||
### Fixes
|
||||
|
||||
- [6d05e8f](https://github.com/dubzzz/pure-rand/commit/6d05e8f) 🔐 Sign published packages (#591)
|
||||
- [8b4e165](https://github.com/dubzzz/pure-rand/commit/8b4e165) 👷 Switch default to Node 18 in CI (#578)
|
||||
|
||||
## 6.0.1
|
||||
|
||||
### Fixes
|
||||
|
||||
- [05421f2](https://github.com/dubzzz/pure-rand/commit/05421f2) 🚨 Reformat README.md (#563)
|
||||
- [ffacfbd](https://github.com/dubzzz/pure-rand/commit/ffacfbd) 📝 Give simple seed computation example (#562)
|
||||
- [e432d59](https://github.com/dubzzz/pure-rand/commit/e432d59) 📝 Add extra keywords (#561)
|
||||
- [f5b18d4](https://github.com/dubzzz/pure-rand/commit/f5b18d4) 🐛 Declare types first for package (#560)
|
||||
- [a5b30db](https://github.com/dubzzz/pure-rand/commit/a5b30db) 📝 Final clean-up of the README (#559)
|
||||
- [5254ee0](https://github.com/dubzzz/pure-rand/commit/5254ee0) 📝 Fix simple examples not fully working (#558)
|
||||
- [8daf460](https://github.com/dubzzz/pure-rand/commit/8daf460) 📝 Clarify the README (#556)
|
||||
- [a915b6a](https://github.com/dubzzz/pure-rand/commit/a915b6a) 📝 Fix url error in README for logo (#554)
|
||||
- [f94885c](https://github.com/dubzzz/pure-rand/commit/f94885c) 📝 Rework README header with logo (#553)
|
||||
- [5f7645e](https://github.com/dubzzz/pure-rand/commit/5f7645e) 📝 Typo in link to comparison SVG (#551)
|
||||
- [61726af](https://github.com/dubzzz/pure-rand/commit/61726af) 📝 Better keywords for NPM (#550)
|
||||
- [6001e5a](https://github.com/dubzzz/pure-rand/commit/6001e5a) 📝 Update performance section with recent stats (#549)
|
||||
- [556ec33](https://github.com/dubzzz/pure-rand/commit/556ec33) ⚗️ Rewrite not uniform of pure-rand (#547)
|
||||
- [b3dfea5](https://github.com/dubzzz/pure-rand/commit/b3dfea5) ⚗️ Add more libraries to the experiment (#546)
|
||||
- [ac8b85d](https://github.com/dubzzz/pure-rand/commit/ac8b85d) ⚗️ Add some more non-uniform versions (#543)
|
||||
- [44af2ad](https://github.com/dubzzz/pure-rand/commit/44af2ad) ⚗️ Add some more self comparisons (#542)
|
||||
- [6d3342d](https://github.com/dubzzz/pure-rand/commit/6d3342d) 📝 Add some more details on the algorithms in compare (#541)
|
||||
- [359e214](https://github.com/dubzzz/pure-rand/commit/359e214) 📝 Fix some typos in README (#540)
|
||||
- [28a7bfe](https://github.com/dubzzz/pure-rand/commit/28a7bfe) 📝 Document some performance stats (#539)
|
||||
- [81860b7](https://github.com/dubzzz/pure-rand/commit/81860b7) ⚗️ Measure performance against other libraries (#538)
|
||||
- [114c2c7](https://github.com/dubzzz/pure-rand/commit/114c2c7) 📝 Publish changelogs from 3.X to 6.X (#537)
|
||||
|
||||
## 6.0.0
|
||||
## 7.0.0
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- [c45912f](https://github.com/dubzzz/pure-rand/commit/c45912f) 💥 Require generators uniform in int32 (#513)
|
||||
- [0bde03e](https://github.com/dubzzz/pure-rand/commit/0bde03e) 💥 Drop congruencial generator (#511)
|
||||
- [2c94832](https://github.com/dubzzz/pure-rand/commit/2c94832) 🏷️ Move to "import type" when feasible (#736)
|
||||
- [3741a63](https://github.com/dubzzz/pure-rand/commit/3741a63) 🏷️ Mark `getState` as compulsory on `RandomGenerator` (#733)
|
||||
|
||||
### Features
|
||||
|
||||
- [7587984](https://github.com/dubzzz/pure-rand/commit/7587984) ⚡️ Faster uniform distribution on bigint (#517)
|
||||
- [464960a](https://github.com/dubzzz/pure-rand/commit/464960a) ⚡️ Faster uniform distribution on small ranges (#516)
|
||||
- [b4852a8](https://github.com/dubzzz/pure-rand/commit/b4852a8) ⚡️ Faster Congruencial 32bits (#512)
|
||||
- [fdb6ec8](https://github.com/dubzzz/pure-rand/commit/fdb6ec8) ⚡️ Faster Mersenne-Twister (#510)
|
||||
- [bb69be5](https://github.com/dubzzz/pure-rand/commit/bb69be5) ⚡️ Drop infinite loop for explicit loop (#507)
|
||||
- [228c73d](https://github.com/dubzzz/pure-rand/commit/228c73d) ⚡️ Faster uniform distributions on bigint (#757)
|
||||
- [86869a1](https://github.com/dubzzz/pure-rand/commit/86869a1) ✨ Expose generators and distributions (#735)
|
||||
|
||||
### Fixes
|
||||
|
||||
- [00fc62b](https://github.com/dubzzz/pure-rand/commit/00fc62b) 🔨 Add missing benchType to the script (#522)
|
||||
- [db4a0a6](https://github.com/dubzzz/pure-rand/commit/db4a0a6) 🔨 Add more options to benchmark (#521)
|
||||
- [5c1ca0e](https://github.com/dubzzz/pure-rand/commit/5c1ca0e) 🔨 Fix typo in benchmark code (#520)
|
||||
- [36c965f](https://github.com/dubzzz/pure-rand/commit/36c965f) 👷 Define a benchmark workflow (#519)
|
||||
- [0281cfd](https://github.com/dubzzz/pure-rand/commit/0281cfd) 🔨 More customizable benchmark (#518)
|
||||
- [a7e19a8](https://github.com/dubzzz/pure-rand/commit/a7e19a8) 🔥 Clean internals of uniform distribution (#515)
|
||||
- [520cca7](https://github.com/dubzzz/pure-rand/commit/520cca7) 🔨 Add some more benchmarks (#514)
|
||||
- [c2d6ee6](https://github.com/dubzzz/pure-rand/commit/c2d6ee6) 🔨 Fix typo in bench for large reference (#509)
|
||||
- [2dd7280](https://github.com/dubzzz/pure-rand/commit/2dd7280) 🔥 Clean useless variable (#506)
|
||||
- [dd621c9](https://github.com/dubzzz/pure-rand/commit/dd621c9) 🔨 Adapt benchmarks to make them reliable (#505)
|
||||
- [122f968](https://github.com/dubzzz/pure-rand/commit/122f968) 👷 Drop dependabot
|
||||
- [f11d2e8](https://github.com/dubzzz/pure-rand/commit/f11d2e8) 💸 Add GitHub sponsors in repository's configuration
|
||||
- [6a23e48](https://github.com/dubzzz/pure-rand/commit/6a23e48) 👷 Stop running tests against node 12 (#486)
|
||||
- [cbefd3e](https://github.com/dubzzz/pure-rand/commit/cbefd3e) 🔧 Better configuration of prettier (#474)
|
||||
- [c6712d3](https://github.com/dubzzz/pure-rand/commit/c6712d3) 🔧 Configure Renovate (#470)
|
||||
- [680a672](https://github.com/dubzzz/pure-rand/commit/680a672) 🚚 Do not export mersenne as default (#738)
|
||||
- [e1758c0](https://github.com/dubzzz/pure-rand/commit/e1758c0) 🚚 Split ArrayInt into two files (#737)
|
||||
- [0c356cf](https://github.com/dubzzz/pure-rand/commit/0c356cf) 🚚 Moving files around (#734)
|
||||
- [6d9b7b4](https://github.com/dubzzz/pure-rand/commit/6d9b7b4) 📝 Document generation of float/double (#715)
|
||||
|
||||
44
node_modules/pure-rand/README.md
generated
vendored
44
node_modules/pure-rand/README.md
generated
vendored
@@ -11,6 +11,7 @@ Fast Pseudorandom number generators (aka PRNG) with purity in mind!
|
||||
[](https://codecov.io/gh/dubzzz/pure-rand)
|
||||
[](https://packagequality.com/#?package=pure-rand)
|
||||
[](https://snyk.io/advisor/npm-package/pure-rand)
|
||||
[](https://fast-check.dev/)
|
||||
|
||||
[](https://github.com/dubzzz/pure-rand/labels/good%20first%20issue)
|
||||
[](https://github.com/dubzzz/pure-rand/blob/main/LICENSE)
|
||||
@@ -206,3 +207,46 @@ The recommended setup for pure-rand is to rely on our Xoroshiro128+. It provides
|
||||
(2) — How long it takes to reapeat itself?
|
||||
|
||||
(3) — While most users don't really think of it, uniform distribution is key! Without it entries might be biased towards some values and make some others less probable. The naive `rand() % numValues` is a good example of biased version as if `rand()` is uniform in `0, 1, 2` and `numValues` is `2`, the probabilities are: `P(0) = 67%`, `P(1) = 33%` causing `1` to be less probable than `0`
|
||||
|
||||
## Advanced patterns
|
||||
|
||||
### Generate 32-bit floating point numbers
|
||||
|
||||
The following snippet is responsible for generating 32-bit floating point numbers that spread uniformly between 0 (included) and 1 (excluded).
|
||||
|
||||
```js
|
||||
import prand from 'pure-rand';
|
||||
|
||||
function generateFloat32(rng) {
|
||||
const g1 = prand.unsafeUniformIntDistribution(0, (1 << 24) - 1, rng);
|
||||
const value = g1 / (1 << 24);
|
||||
return value;
|
||||
}
|
||||
|
||||
const seed = 42;
|
||||
const rng = prand.xoroshiro128plus(seed);
|
||||
|
||||
const float32Bits1 = generateFloat32(rng);
|
||||
const float32Bits2 = generateFloat32(rng);
|
||||
```
|
||||
|
||||
### Generate 64-bit floating point numbers
|
||||
|
||||
The following snippet is responsible for generating 64-bit floating point numbers that spread uniformly between 0 (included) and 1 (excluded).
|
||||
|
||||
```js
|
||||
import prand from 'pure-rand';
|
||||
|
||||
function generateFloat64(rng) {
|
||||
const g1 = prand.unsafeUniformIntDistribution(0, (1 << 26) - 1, rng);
|
||||
const g2 = prand.unsafeUniformIntDistribution(0, (1 << 27) - 1, rng);
|
||||
const value = (g1 * Math.pow(2, 27) + g2) * Math.pow(2, -53);
|
||||
return value;
|
||||
}
|
||||
|
||||
const seed = 42;
|
||||
const rng = prand.xoroshiro128plus(seed);
|
||||
|
||||
const float64Bits1 = generateFloat64(rng);
|
||||
const float64Bits2 = generateFloat64(rng);
|
||||
```
|
||||
|
||||
2
node_modules/pure-rand/lib/distribution/Distribution.js
generated
vendored
2
node_modules/pure-rand/lib/distribution/Distribution.js
generated
vendored
@@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
9
node_modules/pure-rand/lib/distribution/GenerateN.js
generated
vendored
Normal file
9
node_modules/pure-rand/lib/distribution/GenerateN.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.generateN = generateN;
|
||||
var UnsafeGenerateN_1 = require("./UnsafeGenerateN");
|
||||
function generateN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
var out = (0, UnsafeGenerateN_1.unsafeGenerateN)(nextRng, num);
|
||||
return [out, nextRng];
|
||||
}
|
||||
9
node_modules/pure-rand/lib/distribution/SkipN.js
generated
vendored
Normal file
9
node_modules/pure-rand/lib/distribution/SkipN.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.skipN = skipN;
|
||||
var UnsafeSkipN_1 = require("./UnsafeSkipN");
|
||||
function skipN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
(0, UnsafeSkipN_1.unsafeSkipN)(nextRng, num);
|
||||
return nextRng;
|
||||
}
|
||||
5
node_modules/pure-rand/lib/distribution/UniformArrayIntDistribution.js
generated
vendored
5
node_modules/pure-rand/lib/distribution/UniformArrayIntDistribution.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.uniformArrayIntDistribution = void 0;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.uniformArrayIntDistribution = uniformArrayIntDistribution;
|
||||
var UnsafeUniformArrayIntDistribution_1 = require("./UnsafeUniformArrayIntDistribution");
|
||||
function uniformArrayIntDistribution(from, to, rng) {
|
||||
if (rng != null) {
|
||||
@@ -12,4 +12,3 @@ function uniformArrayIntDistribution(from, to, rng) {
|
||||
return [(0, UnsafeUniformArrayIntDistribution_1.unsafeUniformArrayIntDistribution)(from, to, nextRng), nextRng];
|
||||
};
|
||||
}
|
||||
exports.uniformArrayIntDistribution = uniformArrayIntDistribution;
|
||||
|
||||
5
node_modules/pure-rand/lib/distribution/UniformBigIntDistribution.js
generated
vendored
5
node_modules/pure-rand/lib/distribution/UniformBigIntDistribution.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.uniformBigIntDistribution = void 0;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.uniformBigIntDistribution = uniformBigIntDistribution;
|
||||
var UnsafeUniformBigIntDistribution_1 = require("./UnsafeUniformBigIntDistribution");
|
||||
function uniformBigIntDistribution(from, to, rng) {
|
||||
if (rng != null) {
|
||||
@@ -12,4 +12,3 @@ function uniformBigIntDistribution(from, to, rng) {
|
||||
return [(0, UnsafeUniformBigIntDistribution_1.unsafeUniformBigIntDistribution)(from, to, nextRng), nextRng];
|
||||
};
|
||||
}
|
||||
exports.uniformBigIntDistribution = uniformBigIntDistribution;
|
||||
|
||||
5
node_modules/pure-rand/lib/distribution/UniformIntDistribution.js
generated
vendored
5
node_modules/pure-rand/lib/distribution/UniformIntDistribution.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.uniformIntDistribution = void 0;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.uniformIntDistribution = uniformIntDistribution;
|
||||
var UnsafeUniformIntDistribution_1 = require("./UnsafeUniformIntDistribution");
|
||||
function uniformIntDistribution(from, to, rng) {
|
||||
if (rng != null) {
|
||||
@@ -12,4 +12,3 @@ function uniformIntDistribution(from, to, rng) {
|
||||
return [(0, UnsafeUniformIntDistribution_1.unsafeUniformIntDistribution)(from, to, nextRng), nextRng];
|
||||
};
|
||||
}
|
||||
exports.uniformIntDistribution = uniformIntDistribution;
|
||||
|
||||
10
node_modules/pure-rand/lib/distribution/UnsafeGenerateN.js
generated
vendored
Normal file
10
node_modules/pure-rand/lib/distribution/UnsafeGenerateN.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unsafeGenerateN = unsafeGenerateN;
|
||||
function unsafeGenerateN(rng, num) {
|
||||
var out = [];
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
out.push(rng.unsafeNext());
|
||||
}
|
||||
return out;
|
||||
}
|
||||
8
node_modules/pure-rand/lib/distribution/UnsafeSkipN.js
generated
vendored
Normal file
8
node_modules/pure-rand/lib/distribution/UnsafeSkipN.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unsafeSkipN = unsafeSkipN;
|
||||
function unsafeSkipN(rng, num) {
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
rng.unsafeNext();
|
||||
}
|
||||
}
|
||||
5
node_modules/pure-rand/lib/distribution/UnsafeUniformArrayIntDistribution.js
generated
vendored
5
node_modules/pure-rand/lib/distribution/UnsafeUniformArrayIntDistribution.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.unsafeUniformArrayIntDistribution = void 0;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unsafeUniformArrayIntDistribution = unsafeUniformArrayIntDistribution;
|
||||
var ArrayInt_1 = require("./internals/ArrayInt");
|
||||
var UnsafeUniformArrayIntDistributionInternal_1 = require("./internals/UnsafeUniformArrayIntDistributionInternal");
|
||||
function unsafeUniformArrayIntDistribution(from, to, rng) {
|
||||
@@ -9,4 +9,3 @@ function unsafeUniformArrayIntDistribution(from, to, rng) {
|
||||
var g = (0, UnsafeUniformArrayIntDistributionInternal_1.unsafeUniformArrayIntDistributionInternal)(emptyArrayIntData, rangeSize.data, rng);
|
||||
return (0, ArrayInt_1.trimArrayIntInplace)((0, ArrayInt_1.addArrayIntToNew)({ sign: 1, data: g }, from));
|
||||
}
|
||||
exports.unsafeUniformArrayIntDistribution = unsafeUniformArrayIntDistribution;
|
||||
|
||||
44
node_modules/pure-rand/lib/distribution/UnsafeUniformBigIntDistribution.js
generated
vendored
44
node_modules/pure-rand/lib/distribution/UnsafeUniformBigIntDistribution.js
generated
vendored
@@ -1,28 +1,36 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.unsafeUniformBigIntDistribution = void 0;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unsafeUniformBigIntDistribution = unsafeUniformBigIntDistribution;
|
||||
var SBigInt = typeof BigInt !== 'undefined' ? BigInt : undefined;
|
||||
var One = typeof BigInt !== 'undefined' ? BigInt(1) : undefined;
|
||||
var ThirtyTwo = typeof BigInt !== 'undefined' ? BigInt(32) : undefined;
|
||||
var NumValues = typeof BigInt !== 'undefined' ? BigInt(0x100000000) : undefined;
|
||||
function unsafeUniformBigIntDistribution(from, to, rng) {
|
||||
var diff = to - from + SBigInt(1);
|
||||
var MinRng = SBigInt(-0x80000000);
|
||||
var NumValues = SBigInt(0x100000000);
|
||||
var diff = to - from + One;
|
||||
var FinalNumValues = NumValues;
|
||||
var NumIterations = 1;
|
||||
while (FinalNumValues < diff) {
|
||||
FinalNumValues *= NumValues;
|
||||
FinalNumValues <<= ThirtyTwo;
|
||||
++NumIterations;
|
||||
}
|
||||
var MaxAcceptedRandom = FinalNumValues - (FinalNumValues % diff);
|
||||
while (true) {
|
||||
var value = SBigInt(0);
|
||||
for (var num = 0; num !== NumIterations; ++num) {
|
||||
var out = rng.unsafeNext();
|
||||
value = NumValues * value + (SBigInt(out) - MinRng);
|
||||
}
|
||||
if (value < MaxAcceptedRandom) {
|
||||
var inDiff = value % diff;
|
||||
return inDiff + from;
|
||||
}
|
||||
var value = generateNext(NumIterations, rng);
|
||||
if (value < diff) {
|
||||
return value + from;
|
||||
}
|
||||
if (value + diff < FinalNumValues) {
|
||||
return (value % diff) + from;
|
||||
}
|
||||
var MaxAcceptedRandom = FinalNumValues - (FinalNumValues % diff);
|
||||
while (value >= MaxAcceptedRandom) {
|
||||
value = generateNext(NumIterations, rng);
|
||||
}
|
||||
return (value % diff) + from;
|
||||
}
|
||||
function generateNext(NumIterations, rng) {
|
||||
var value = SBigInt(rng.unsafeNext() + 0x80000000);
|
||||
for (var num = 1; num < NumIterations; ++num) {
|
||||
var out = rng.unsafeNext();
|
||||
value = (value << ThirtyTwo) + SBigInt(out + 0x80000000);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
exports.unsafeUniformBigIntDistribution = unsafeUniformBigIntDistribution;
|
||||
|
||||
11
node_modules/pure-rand/lib/distribution/UnsafeUniformIntDistribution.js
generated
vendored
11
node_modules/pure-rand/lib/distribution/UnsafeUniformIntDistribution.js
generated
vendored
@@ -1,8 +1,8 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.unsafeUniformIntDistribution = void 0;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unsafeUniformIntDistribution = unsafeUniformIntDistribution;
|
||||
var UnsafeUniformIntDistributionInternal_1 = require("./internals/UnsafeUniformIntDistributionInternal");
|
||||
var ArrayInt_1 = require("./internals/ArrayInt");
|
||||
var ArrayInt64_1 = require("./internals/ArrayInt64");
|
||||
var UnsafeUniformArrayIntDistributionInternal_1 = require("./internals/UnsafeUniformArrayIntDistributionInternal");
|
||||
var safeNumberMaxSafeInteger = Number.MAX_SAFE_INTEGER;
|
||||
var sharedA = { sign: 1, data: [0, 0] };
|
||||
@@ -11,8 +11,8 @@ var sharedC = { sign: 1, data: [0, 0] };
|
||||
var sharedData = [0, 0];
|
||||
function uniformLargeIntInternal(from, to, rangeSize, rng) {
|
||||
var rangeSizeArrayIntValue = rangeSize <= safeNumberMaxSafeInteger
|
||||
? (0, ArrayInt_1.fromNumberToArrayInt64)(sharedC, rangeSize)
|
||||
: (0, ArrayInt_1.substractArrayInt64)(sharedC, (0, ArrayInt_1.fromNumberToArrayInt64)(sharedA, to), (0, ArrayInt_1.fromNumberToArrayInt64)(sharedB, from));
|
||||
? (0, ArrayInt64_1.fromNumberToArrayInt64)(sharedC, rangeSize)
|
||||
: (0, ArrayInt64_1.substractArrayInt64)(sharedC, (0, ArrayInt64_1.fromNumberToArrayInt64)(sharedA, to), (0, ArrayInt64_1.fromNumberToArrayInt64)(sharedB, from));
|
||||
if (rangeSizeArrayIntValue.data[1] === 0xffffffff) {
|
||||
rangeSizeArrayIntValue.data[0] += 1;
|
||||
rangeSizeArrayIntValue.data[1] = 0;
|
||||
@@ -31,4 +31,3 @@ function unsafeUniformIntDistribution(from, to, rng) {
|
||||
}
|
||||
return uniformLargeIntInternal(from, to, rangeSize, rng);
|
||||
}
|
||||
exports.unsafeUniformIntDistribution = unsafeUniformIntDistribution;
|
||||
|
||||
62
node_modules/pure-rand/lib/distribution/internals/ArrayInt.js
generated
vendored
62
node_modules/pure-rand/lib/distribution/internals/ArrayInt.js
generated
vendored
@@ -1,6 +1,9 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.substractArrayInt64 = exports.fromNumberToArrayInt64 = exports.trimArrayIntInplace = exports.substractArrayIntToNew = exports.addOneToPositiveArrayInt = exports.addArrayIntToNew = void 0;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.addArrayIntToNew = addArrayIntToNew;
|
||||
exports.addOneToPositiveArrayInt = addOneToPositiveArrayInt;
|
||||
exports.substractArrayIntToNew = substractArrayIntToNew;
|
||||
exports.trimArrayIntInplace = trimArrayIntInplace;
|
||||
function addArrayIntToNew(arrayIntA, arrayIntB) {
|
||||
if (arrayIntA.sign !== arrayIntB.sign) {
|
||||
return substractArrayIntToNew(arrayIntA, { sign: -arrayIntB.sign, data: arrayIntB.data });
|
||||
@@ -21,7 +24,6 @@ function addArrayIntToNew(arrayIntA, arrayIntB) {
|
||||
}
|
||||
return { sign: arrayIntA.sign, data: data.reverse() };
|
||||
}
|
||||
exports.addArrayIntToNew = addArrayIntToNew;
|
||||
function addOneToPositiveArrayInt(arrayInt) {
|
||||
arrayInt.sign = 1;
|
||||
var data = arrayInt.data;
|
||||
@@ -37,7 +39,6 @@ function addOneToPositiveArrayInt(arrayInt) {
|
||||
data.unshift(1);
|
||||
return arrayInt;
|
||||
}
|
||||
exports.addOneToPositiveArrayInt = addOneToPositiveArrayInt;
|
||||
function isStrictlySmaller(dataA, dataB) {
|
||||
var maxLength = Math.max(dataA.length, dataB.length);
|
||||
for (var index = 0; index < maxLength; ++index) {
|
||||
@@ -74,7 +75,6 @@ function substractArrayIntToNew(arrayIntA, arrayIntB) {
|
||||
}
|
||||
return { sign: arrayIntA.sign, data: data.reverse() };
|
||||
}
|
||||
exports.substractArrayIntToNew = substractArrayIntToNew;
|
||||
function trimArrayIntInplace(arrayInt) {
|
||||
var data = arrayInt.data;
|
||||
var firstNonZero = 0;
|
||||
@@ -87,55 +87,3 @@ function trimArrayIntInplace(arrayInt) {
|
||||
data.splice(0, firstNonZero);
|
||||
return arrayInt;
|
||||
}
|
||||
exports.trimArrayIntInplace = trimArrayIntInplace;
|
||||
function fromNumberToArrayInt64(out, n) {
|
||||
if (n < 0) {
|
||||
var posN = -n;
|
||||
out.sign = -1;
|
||||
out.data[0] = ~~(posN / 0x100000000);
|
||||
out.data[1] = posN >>> 0;
|
||||
}
|
||||
else {
|
||||
out.sign = 1;
|
||||
out.data[0] = ~~(n / 0x100000000);
|
||||
out.data[1] = n >>> 0;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
exports.fromNumberToArrayInt64 = fromNumberToArrayInt64;
|
||||
function substractArrayInt64(out, arrayIntA, arrayIntB) {
|
||||
var lowA = arrayIntA.data[1];
|
||||
var highA = arrayIntA.data[0];
|
||||
var signA = arrayIntA.sign;
|
||||
var lowB = arrayIntB.data[1];
|
||||
var highB = arrayIntB.data[0];
|
||||
var signB = arrayIntB.sign;
|
||||
out.sign = 1;
|
||||
if (signA === 1 && signB === -1) {
|
||||
var low_1 = lowA + lowB;
|
||||
var high = highA + highB + (low_1 > 0xffffffff ? 1 : 0);
|
||||
out.data[0] = high >>> 0;
|
||||
out.data[1] = low_1 >>> 0;
|
||||
return out;
|
||||
}
|
||||
var lowFirst = lowA;
|
||||
var highFirst = highA;
|
||||
var lowSecond = lowB;
|
||||
var highSecond = highB;
|
||||
if (signA === -1) {
|
||||
lowFirst = lowB;
|
||||
highFirst = highB;
|
||||
lowSecond = lowA;
|
||||
highSecond = highA;
|
||||
}
|
||||
var reminderLow = 0;
|
||||
var low = lowFirst - lowSecond;
|
||||
if (low < 0) {
|
||||
reminderLow = 1;
|
||||
low = low >>> 0;
|
||||
}
|
||||
out.data[0] = highFirst - highSecond - reminderLow;
|
||||
out.data[1] = low;
|
||||
return out;
|
||||
}
|
||||
exports.substractArrayInt64 = substractArrayInt64;
|
||||
|
||||
53
node_modules/pure-rand/lib/distribution/internals/ArrayInt64.js
generated
vendored
Normal file
53
node_modules/pure-rand/lib/distribution/internals/ArrayInt64.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fromNumberToArrayInt64 = fromNumberToArrayInt64;
|
||||
exports.substractArrayInt64 = substractArrayInt64;
|
||||
function fromNumberToArrayInt64(out, n) {
|
||||
if (n < 0) {
|
||||
var posN = -n;
|
||||
out.sign = -1;
|
||||
out.data[0] = ~~(posN / 0x100000000);
|
||||
out.data[1] = posN >>> 0;
|
||||
}
|
||||
else {
|
||||
out.sign = 1;
|
||||
out.data[0] = ~~(n / 0x100000000);
|
||||
out.data[1] = n >>> 0;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
function substractArrayInt64(out, arrayIntA, arrayIntB) {
|
||||
var lowA = arrayIntA.data[1];
|
||||
var highA = arrayIntA.data[0];
|
||||
var signA = arrayIntA.sign;
|
||||
var lowB = arrayIntB.data[1];
|
||||
var highB = arrayIntB.data[0];
|
||||
var signB = arrayIntB.sign;
|
||||
out.sign = 1;
|
||||
if (signA === 1 && signB === -1) {
|
||||
var low_1 = lowA + lowB;
|
||||
var high = highA + highB + (low_1 > 0xffffffff ? 1 : 0);
|
||||
out.data[0] = high >>> 0;
|
||||
out.data[1] = low_1 >>> 0;
|
||||
return out;
|
||||
}
|
||||
var lowFirst = lowA;
|
||||
var highFirst = highA;
|
||||
var lowSecond = lowB;
|
||||
var highSecond = highB;
|
||||
if (signA === -1) {
|
||||
lowFirst = lowB;
|
||||
highFirst = highB;
|
||||
lowSecond = lowA;
|
||||
highSecond = highA;
|
||||
}
|
||||
var reminderLow = 0;
|
||||
var low = lowFirst - lowSecond;
|
||||
if (low < 0) {
|
||||
reminderLow = 1;
|
||||
low = low >>> 0;
|
||||
}
|
||||
out.data[0] = highFirst - highSecond - reminderLow;
|
||||
out.data[1] = low;
|
||||
return out;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.unsafeUniformArrayIntDistributionInternal = void 0;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unsafeUniformArrayIntDistributionInternal = unsafeUniformArrayIntDistributionInternal;
|
||||
var UnsafeUniformIntDistributionInternal_1 = require("./UnsafeUniformIntDistributionInternal");
|
||||
function unsafeUniformArrayIntDistributionInternal(out, rangeSize, rng) {
|
||||
var rangeLength = rangeSize.length;
|
||||
@@ -22,4 +22,3 @@ function unsafeUniformArrayIntDistributionInternal(out, rangeSize, rng) {
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.unsafeUniformArrayIntDistributionInternal = unsafeUniformArrayIntDistributionInternal;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.unsafeUniformIntDistributionInternal = void 0;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unsafeUniformIntDistributionInternal = unsafeUniformIntDistributionInternal;
|
||||
function unsafeUniformIntDistributionInternal(rangeSize, rng) {
|
||||
var MaxAllowed = rangeSize > 2 ? ~~(0x100000000 / rangeSize) * rangeSize : 0x100000000;
|
||||
var deltaV = rng.unsafeNext() + 0x80000000;
|
||||
@@ -9,4 +9,3 @@ function unsafeUniformIntDistributionInternal(rangeSize, rng) {
|
||||
}
|
||||
return deltaV % rangeSize;
|
||||
}
|
||||
exports.unsafeUniformIntDistributionInternal = unsafeUniformIntDistributionInternal;
|
||||
|
||||
6
node_modules/pure-rand/lib/esm/distribution/GenerateN.js
generated
vendored
Normal file
6
node_modules/pure-rand/lib/esm/distribution/GenerateN.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { unsafeGenerateN } from './UnsafeGenerateN.js';
|
||||
export function generateN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
var out = unsafeGenerateN(nextRng, num);
|
||||
return [out, nextRng];
|
||||
}
|
||||
6
node_modules/pure-rand/lib/esm/distribution/SkipN.js
generated
vendored
Normal file
6
node_modules/pure-rand/lib/esm/distribution/SkipN.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { unsafeSkipN } from './UnsafeSkipN.js';
|
||||
export function skipN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
unsafeSkipN(nextRng, num);
|
||||
return nextRng;
|
||||
}
|
||||
7
node_modules/pure-rand/lib/esm/distribution/UnsafeGenerateN.js
generated
vendored
Normal file
7
node_modules/pure-rand/lib/esm/distribution/UnsafeGenerateN.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export function unsafeGenerateN(rng, num) {
|
||||
var out = [];
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
out.push(rng.unsafeNext());
|
||||
}
|
||||
return out;
|
||||
}
|
||||
5
node_modules/pure-rand/lib/esm/distribution/UnsafeSkipN.js
generated
vendored
Normal file
5
node_modules/pure-rand/lib/esm/distribution/UnsafeSkipN.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export function unsafeSkipN(rng, num) {
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
rng.unsafeNext();
|
||||
}
|
||||
}
|
||||
39
node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js
generated
vendored
39
node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js
generated
vendored
@@ -1,24 +1,33 @@
|
||||
var SBigInt = typeof BigInt !== 'undefined' ? BigInt : undefined;
|
||||
var One = typeof BigInt !== 'undefined' ? BigInt(1) : undefined;
|
||||
var ThirtyTwo = typeof BigInt !== 'undefined' ? BigInt(32) : undefined;
|
||||
var NumValues = typeof BigInt !== 'undefined' ? BigInt(0x100000000) : undefined;
|
||||
export function unsafeUniformBigIntDistribution(from, to, rng) {
|
||||
var diff = to - from + SBigInt(1);
|
||||
var MinRng = SBigInt(-0x80000000);
|
||||
var NumValues = SBigInt(0x100000000);
|
||||
var diff = to - from + One;
|
||||
var FinalNumValues = NumValues;
|
||||
var NumIterations = 1;
|
||||
while (FinalNumValues < diff) {
|
||||
FinalNumValues *= NumValues;
|
||||
FinalNumValues <<= ThirtyTwo;
|
||||
++NumIterations;
|
||||
}
|
||||
var MaxAcceptedRandom = FinalNumValues - (FinalNumValues % diff);
|
||||
while (true) {
|
||||
var value = SBigInt(0);
|
||||
for (var num = 0; num !== NumIterations; ++num) {
|
||||
var out = rng.unsafeNext();
|
||||
value = NumValues * value + (SBigInt(out) - MinRng);
|
||||
}
|
||||
if (value < MaxAcceptedRandom) {
|
||||
var inDiff = value % diff;
|
||||
return inDiff + from;
|
||||
}
|
||||
var value = generateNext(NumIterations, rng);
|
||||
if (value < diff) {
|
||||
return value + from;
|
||||
}
|
||||
if (value + diff < FinalNumValues) {
|
||||
return (value % diff) + from;
|
||||
}
|
||||
var MaxAcceptedRandom = FinalNumValues - (FinalNumValues % diff);
|
||||
while (value >= MaxAcceptedRandom) {
|
||||
value = generateNext(NumIterations, rng);
|
||||
}
|
||||
return (value % diff) + from;
|
||||
}
|
||||
function generateNext(NumIterations, rng) {
|
||||
var value = SBigInt(rng.unsafeNext() + 0x80000000);
|
||||
for (var num = 1; num < NumIterations; ++num) {
|
||||
var out = rng.unsafeNext();
|
||||
value = (value << ThirtyTwo) + SBigInt(out + 0x80000000);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
2
node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js
generated
vendored
2
node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js
generated
vendored
@@ -1,5 +1,5 @@
|
||||
import { unsafeUniformIntDistributionInternal } from './internals/UnsafeUniformIntDistributionInternal.js';
|
||||
import { fromNumberToArrayInt64, substractArrayInt64 } from './internals/ArrayInt.js';
|
||||
import { fromNumberToArrayInt64, substractArrayInt64 } from './internals/ArrayInt64.js';
|
||||
import { unsafeUniformArrayIntDistributionInternal } from './internals/UnsafeUniformArrayIntDistributionInternal.js';
|
||||
var safeNumberMaxSafeInteger = Number.MAX_SAFE_INTEGER;
|
||||
var sharedA = { sign: 1, data: [0, 0] };
|
||||
|
||||
49
node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js
generated
vendored
49
node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js
generated
vendored
@@ -81,52 +81,3 @@ export function trimArrayIntInplace(arrayInt) {
|
||||
data.splice(0, firstNonZero);
|
||||
return arrayInt;
|
||||
}
|
||||
export function fromNumberToArrayInt64(out, n) {
|
||||
if (n < 0) {
|
||||
var posN = -n;
|
||||
out.sign = -1;
|
||||
out.data[0] = ~~(posN / 0x100000000);
|
||||
out.data[1] = posN >>> 0;
|
||||
}
|
||||
else {
|
||||
out.sign = 1;
|
||||
out.data[0] = ~~(n / 0x100000000);
|
||||
out.data[1] = n >>> 0;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
export function substractArrayInt64(out, arrayIntA, arrayIntB) {
|
||||
var lowA = arrayIntA.data[1];
|
||||
var highA = arrayIntA.data[0];
|
||||
var signA = arrayIntA.sign;
|
||||
var lowB = arrayIntB.data[1];
|
||||
var highB = arrayIntB.data[0];
|
||||
var signB = arrayIntB.sign;
|
||||
out.sign = 1;
|
||||
if (signA === 1 && signB === -1) {
|
||||
var low_1 = lowA + lowB;
|
||||
var high = highA + highB + (low_1 > 0xffffffff ? 1 : 0);
|
||||
out.data[0] = high >>> 0;
|
||||
out.data[1] = low_1 >>> 0;
|
||||
return out;
|
||||
}
|
||||
var lowFirst = lowA;
|
||||
var highFirst = highA;
|
||||
var lowSecond = lowB;
|
||||
var highSecond = highB;
|
||||
if (signA === -1) {
|
||||
lowFirst = lowB;
|
||||
highFirst = highB;
|
||||
lowSecond = lowA;
|
||||
highSecond = highA;
|
||||
}
|
||||
var reminderLow = 0;
|
||||
var low = lowFirst - lowSecond;
|
||||
if (low < 0) {
|
||||
reminderLow = 1;
|
||||
low = low >>> 0;
|
||||
}
|
||||
out.data[0] = highFirst - highSecond - reminderLow;
|
||||
out.data[1] = low;
|
||||
return out;
|
||||
}
|
||||
|
||||
49
node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt64.js
generated
vendored
Normal file
49
node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt64.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
export function fromNumberToArrayInt64(out, n) {
|
||||
if (n < 0) {
|
||||
var posN = -n;
|
||||
out.sign = -1;
|
||||
out.data[0] = ~~(posN / 0x100000000);
|
||||
out.data[1] = posN >>> 0;
|
||||
}
|
||||
else {
|
||||
out.sign = 1;
|
||||
out.data[0] = ~~(n / 0x100000000);
|
||||
out.data[1] = n >>> 0;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
export function substractArrayInt64(out, arrayIntA, arrayIntB) {
|
||||
var lowA = arrayIntA.data[1];
|
||||
var highA = arrayIntA.data[0];
|
||||
var signA = arrayIntA.sign;
|
||||
var lowB = arrayIntB.data[1];
|
||||
var highB = arrayIntB.data[0];
|
||||
var signB = arrayIntB.sign;
|
||||
out.sign = 1;
|
||||
if (signA === 1 && signB === -1) {
|
||||
var low_1 = lowA + lowB;
|
||||
var high = highA + highB + (low_1 > 0xffffffff ? 1 : 0);
|
||||
out.data[0] = high >>> 0;
|
||||
out.data[1] = low_1 >>> 0;
|
||||
return out;
|
||||
}
|
||||
var lowFirst = lowA;
|
||||
var highFirst = highA;
|
||||
var lowSecond = lowB;
|
||||
var highSecond = highB;
|
||||
if (signA === -1) {
|
||||
lowFirst = lowB;
|
||||
highFirst = highB;
|
||||
lowSecond = lowA;
|
||||
highSecond = highA;
|
||||
}
|
||||
var reminderLow = 0;
|
||||
var low = lowFirst - lowSecond;
|
||||
if (low < 0) {
|
||||
reminderLow = 1;
|
||||
low = low >>> 0;
|
||||
}
|
||||
out.data[0] = highFirst - highSecond - reminderLow;
|
||||
out.data[1] = low;
|
||||
return out;
|
||||
}
|
||||
14
node_modules/pure-rand/lib/esm/generator/LinearCongruential.js
generated
vendored
14
node_modules/pure-rand/lib/esm/generator/LinearCongruential.js
generated
vendored
@@ -30,8 +30,18 @@ var LinearCongruential32 = (function () {
|
||||
var vnext = v3 + ((v2 + (v1 << 15)) << 15);
|
||||
return vnext | 0;
|
||||
};
|
||||
LinearCongruential32.prototype.getState = function () {
|
||||
return [this.seed];
|
||||
};
|
||||
return LinearCongruential32;
|
||||
}());
|
||||
export var congruential32 = function (seed) {
|
||||
function fromState(state) {
|
||||
var valid = state.length === 1;
|
||||
if (!valid) {
|
||||
throw new Error('The state must have been produced by a congruential32 RandomGenerator');
|
||||
}
|
||||
return new LinearCongruential32(state[0]);
|
||||
}
|
||||
export var congruential32 = Object.assign(function (seed) {
|
||||
return new LinearCongruential32(seed);
|
||||
};
|
||||
}, { fromState: fromState });
|
||||
|
||||
42
node_modules/pure-rand/lib/esm/generator/MersenneTwister.js
generated
vendored
42
node_modules/pure-rand/lib/esm/generator/MersenneTwister.js
generated
vendored
@@ -1,3 +1,28 @@
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
var MersenneTwister = (function () {
|
||||
function MersenneTwister(states, index) {
|
||||
this.states = states;
|
||||
@@ -49,6 +74,16 @@ var MersenneTwister = (function () {
|
||||
}
|
||||
return y;
|
||||
};
|
||||
MersenneTwister.prototype.getState = function () {
|
||||
return __spreadArray([this.index], __read(this.states), false);
|
||||
};
|
||||
MersenneTwister.fromState = function (state) {
|
||||
var valid = state.length === MersenneTwister.N + 1 && state[0] >= 0 && state[0] < MersenneTwister.N;
|
||||
if (!valid) {
|
||||
throw new Error('The state must have been produced by a mersenne RandomGenerator');
|
||||
}
|
||||
return new MersenneTwister(state.slice(1), state[0]);
|
||||
};
|
||||
MersenneTwister.N = 624;
|
||||
MersenneTwister.M = 397;
|
||||
MersenneTwister.R = 31;
|
||||
@@ -64,6 +99,9 @@ var MersenneTwister = (function () {
|
||||
MersenneTwister.MASK_UPPER = Math.pow(2, MersenneTwister.R);
|
||||
return MersenneTwister;
|
||||
}());
|
||||
export default function (seed) {
|
||||
return MersenneTwister.from(seed);
|
||||
function fromState(state) {
|
||||
return MersenneTwister.fromState(state);
|
||||
}
|
||||
export var mersenne = Object.assign(function (seed) {
|
||||
return MersenneTwister.from(seed);
|
||||
}, { fromState: fromState });
|
||||
|
||||
22
node_modules/pure-rand/lib/esm/generator/RandomGenerator.js
generated
vendored
22
node_modules/pure-rand/lib/esm/generator/RandomGenerator.js
generated
vendored
@@ -1,22 +0,0 @@
|
||||
export function unsafeGenerateN(rng, num) {
|
||||
var out = [];
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
out.push(rng.unsafeNext());
|
||||
}
|
||||
return out;
|
||||
}
|
||||
export function generateN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
var out = unsafeGenerateN(nextRng, num);
|
||||
return [out, nextRng];
|
||||
}
|
||||
export function unsafeSkipN(rng, num) {
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
rng.unsafeNext();
|
||||
}
|
||||
}
|
||||
export function skipN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
unsafeSkipN(nextRng, num);
|
||||
return nextRng;
|
||||
}
|
||||
14
node_modules/pure-rand/lib/esm/generator/XorShift.js
generated
vendored
14
node_modules/pure-rand/lib/esm/generator/XorShift.js
generated
vendored
@@ -52,8 +52,18 @@ var XorShift128Plus = (function () {
|
||||
this.s11 = ns11;
|
||||
this.s10 = ns10;
|
||||
};
|
||||
XorShift128Plus.prototype.getState = function () {
|
||||
return [this.s01, this.s00, this.s11, this.s10];
|
||||
};
|
||||
return XorShift128Plus;
|
||||
}());
|
||||
export var xorshift128plus = function (seed) {
|
||||
function fromState(state) {
|
||||
var valid = state.length === 4;
|
||||
if (!valid) {
|
||||
throw new Error('The state must have been produced by a xorshift128plus RandomGenerator');
|
||||
}
|
||||
return new XorShift128Plus(state[0], state[1], state[2], state[3]);
|
||||
}
|
||||
export var xorshift128plus = Object.assign(function (seed) {
|
||||
return new XorShift128Plus(-1, ~seed, seed | 0, 0);
|
||||
};
|
||||
}, { fromState: fromState });
|
||||
|
||||
14
node_modules/pure-rand/lib/esm/generator/XoroShiro.js
generated
vendored
14
node_modules/pure-rand/lib/esm/generator/XoroShiro.js
generated
vendored
@@ -52,8 +52,18 @@ var XoroShiro128Plus = (function () {
|
||||
this.s11 = ns11;
|
||||
this.s10 = ns10;
|
||||
};
|
||||
XoroShiro128Plus.prototype.getState = function () {
|
||||
return [this.s01, this.s00, this.s11, this.s10];
|
||||
};
|
||||
return XoroShiro128Plus;
|
||||
}());
|
||||
export var xoroshiro128plus = function (seed) {
|
||||
function fromState(state) {
|
||||
var valid = state.length === 4;
|
||||
if (!valid) {
|
||||
throw new Error('The state must have been produced by a xoroshiro128plus RandomGenerator');
|
||||
}
|
||||
return new XoroShiro128Plus(state[0], state[1], state[2], state[3]);
|
||||
}
|
||||
export var xoroshiro128plus = Object.assign(function (seed) {
|
||||
return new XoroShiro128Plus(-1, ~seed, seed | 0, 0);
|
||||
};
|
||||
}, { fromState: fromState });
|
||||
|
||||
11
node_modules/pure-rand/lib/esm/pure-rand-default.js
generated
vendored
11
node_modules/pure-rand/lib/esm/pure-rand-default.js
generated
vendored
@@ -1,6 +1,5 @@
|
||||
import { generateN, skipN, unsafeGenerateN, unsafeSkipN } from './generator/RandomGenerator.js';
|
||||
import { congruential32 } from './generator/LinearCongruential.js';
|
||||
import mersenne from './generator/MersenneTwister.js';
|
||||
import { mersenne } from './generator/MersenneTwister.js';
|
||||
import { xorshift128plus } from './generator/XorShift.js';
|
||||
import { xoroshiro128plus } from './generator/XoroShiro.js';
|
||||
import { uniformArrayIntDistribution } from './distribution/UniformArrayIntDistribution.js';
|
||||
@@ -9,7 +8,11 @@ import { uniformIntDistribution } from './distribution/UniformIntDistribution.js
|
||||
import { unsafeUniformArrayIntDistribution } from './distribution/UnsafeUniformArrayIntDistribution.js';
|
||||
import { unsafeUniformBigIntDistribution } from './distribution/UnsafeUniformBigIntDistribution.js';
|
||||
import { unsafeUniformIntDistribution } from './distribution/UnsafeUniformIntDistribution.js';
|
||||
import { skipN } from './distribution/SkipN.js';
|
||||
import { generateN } from './distribution/GenerateN.js';
|
||||
import { unsafeGenerateN } from './distribution/UnsafeGenerateN.js';
|
||||
import { unsafeSkipN } from './distribution/UnsafeSkipN.js';
|
||||
var __type = 'module';
|
||||
var __version = '6.0.4';
|
||||
var __commitHash = 'bcf9517d53f733a335e678fbba321780c0543b29';
|
||||
var __version = '7.0.1';
|
||||
var __commitHash = '2248506b66d969d1a8b477a4dde8e24cbac33e6a';
|
||||
export { __type, __version, __commitHash, generateN, skipN, unsafeGenerateN, unsafeSkipN, congruential32, mersenne, xorshift128plus, xoroshiro128plus, uniformArrayIntDistribution, uniformBigIntDistribution, uniformIntDistribution, unsafeUniformArrayIntDistribution, unsafeUniformBigIntDistribution, unsafeUniformIntDistribution, };
|
||||
|
||||
1
node_modules/pure-rand/lib/esm/types/RandomGenerator.js
generated
vendored
Normal file
1
node_modules/pure-rand/lib/esm/types/RandomGenerator.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
2
node_modules/pure-rand/lib/esm/types/distribution/GenerateN.d.ts
generated
vendored
Normal file
2
node_modules/pure-rand/lib/esm/types/distribution/GenerateN.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function generateN(rng: RandomGenerator, num: number): [number[], RandomGenerator];
|
||||
2
node_modules/pure-rand/lib/esm/types/distribution/SkipN.d.ts
generated
vendored
Normal file
2
node_modules/pure-rand/lib/esm/types/distribution/SkipN.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function skipN(rng: RandomGenerator, num: number): RandomGenerator;
|
||||
6
node_modules/pure-rand/lib/esm/types/distribution/UniformArrayIntDistribution.d.ts
generated
vendored
6
node_modules/pure-rand/lib/esm/types/distribution/UniformArrayIntDistribution.d.ts
generated
vendored
@@ -1,6 +1,6 @@
|
||||
import { Distribution } from './Distribution.js';
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import { ArrayInt } from './internals/ArrayInt.js';
|
||||
import type { Distribution } from '../types/Distribution.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
import type { ArrayInt } from './internals/ArrayInt.js';
|
||||
declare function uniformArrayIntDistribution(from: ArrayInt, to: ArrayInt): Distribution<ArrayInt>;
|
||||
declare function uniformArrayIntDistribution(from: ArrayInt, to: ArrayInt, rng: RandomGenerator): [ArrayInt, RandomGenerator];
|
||||
export { uniformArrayIntDistribution };
|
||||
|
||||
4
node_modules/pure-rand/lib/esm/types/distribution/UniformBigIntDistribution.d.ts
generated
vendored
4
node_modules/pure-rand/lib/esm/types/distribution/UniformBigIntDistribution.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
import { Distribution } from './Distribution.js';
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { Distribution } from '../types/Distribution.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function uniformBigIntDistribution(from: bigint, to: bigint): Distribution<bigint>;
|
||||
declare function uniformBigIntDistribution(from: bigint, to: bigint, rng: RandomGenerator): [bigint, RandomGenerator];
|
||||
export { uniformBigIntDistribution };
|
||||
|
||||
4
node_modules/pure-rand/lib/esm/types/distribution/UniformIntDistribution.d.ts
generated
vendored
4
node_modules/pure-rand/lib/esm/types/distribution/UniformIntDistribution.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
import { Distribution } from './Distribution.js';
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { Distribution } from '../types/Distribution.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function uniformIntDistribution(from: number, to: number): Distribution<number>;
|
||||
declare function uniformIntDistribution(from: number, to: number, rng: RandomGenerator): [number, RandomGenerator];
|
||||
export { uniformIntDistribution };
|
||||
|
||||
2
node_modules/pure-rand/lib/esm/types/distribution/UnsafeGenerateN.d.ts
generated
vendored
Normal file
2
node_modules/pure-rand/lib/esm/types/distribution/UnsafeGenerateN.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function unsafeGenerateN(rng: RandomGenerator, num: number): number[];
|
||||
2
node_modules/pure-rand/lib/esm/types/distribution/UnsafeSkipN.d.ts
generated
vendored
Normal file
2
node_modules/pure-rand/lib/esm/types/distribution/UnsafeSkipN.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function unsafeSkipN(rng: RandomGenerator, num: number): void;
|
||||
@@ -1,3 +1,3 @@
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import { ArrayInt } from './internals/ArrayInt.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
import type { ArrayInt } from './internals/ArrayInt.js';
|
||||
export declare function unsafeUniformArrayIntDistribution(from: ArrayInt, to: ArrayInt, rng: RandomGenerator): ArrayInt;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function unsafeUniformBigIntDistribution(from: bigint, to: bigint, rng: RandomGenerator): bigint;
|
||||
|
||||
2
node_modules/pure-rand/lib/esm/types/distribution/UnsafeUniformIntDistribution.d.ts
generated
vendored
2
node_modules/pure-rand/lib/esm/types/distribution/UnsafeUniformIntDistribution.d.ts
generated
vendored
@@ -1,2 +1,2 @@
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function unsafeUniformIntDistribution(from: number, to: number, rng: RandomGenerator): number;
|
||||
|
||||
5
node_modules/pure-rand/lib/esm/types/distribution/internals/ArrayInt.d.ts
generated
vendored
5
node_modules/pure-rand/lib/esm/types/distribution/internals/ArrayInt.d.ts
generated
vendored
@@ -6,8 +6,3 @@ export declare function addArrayIntToNew(arrayIntA: ArrayInt, arrayIntB: ArrayIn
|
||||
export declare function addOneToPositiveArrayInt(arrayInt: ArrayInt): ArrayInt;
|
||||
export declare function substractArrayIntToNew(arrayIntA: ArrayInt, arrayIntB: ArrayInt): ArrayInt;
|
||||
export declare function trimArrayIntInplace(arrayInt: ArrayInt): ArrayInt;
|
||||
export type ArrayInt64 = Required<ArrayInt> & {
|
||||
data: [number, number];
|
||||
};
|
||||
export declare function fromNumberToArrayInt64(out: ArrayInt64, n: number): ArrayInt64;
|
||||
export declare function substractArrayInt64(out: ArrayInt64, arrayIntA: ArrayInt64, arrayIntB: ArrayInt64): ArrayInt64;
|
||||
|
||||
6
node_modules/pure-rand/lib/esm/types/distribution/internals/ArrayInt64.d.ts
generated
vendored
Normal file
6
node_modules/pure-rand/lib/esm/types/distribution/internals/ArrayInt64.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { ArrayInt } from './ArrayInt.js';
|
||||
export type ArrayInt64 = Required<ArrayInt> & {
|
||||
data: [number, number];
|
||||
};
|
||||
export declare function fromNumberToArrayInt64(out: ArrayInt64, n: number): ArrayInt64;
|
||||
export declare function substractArrayInt64(out: ArrayInt64, arrayIntA: ArrayInt64, arrayIntB: ArrayInt64): ArrayInt64;
|
||||
@@ -1,3 +1,3 @@
|
||||
import { RandomGenerator } from '../../generator/RandomGenerator.js';
|
||||
import { ArrayInt } from './ArrayInt.js';
|
||||
import type { RandomGenerator } from '../../types/RandomGenerator.js';
|
||||
import type { ArrayInt } from './ArrayInt.js';
|
||||
export declare function unsafeUniformArrayIntDistributionInternal(out: ArrayInt['data'], rangeSize: ArrayInt['data'], rng: RandomGenerator): ArrayInt['data'];
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
import { RandomGenerator } from '../../generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from '../../types/RandomGenerator.js';
|
||||
export declare function unsafeUniformIntDistributionInternal(rangeSize: number, rng: RandomGenerator): number;
|
||||
|
||||
8
node_modules/pure-rand/lib/esm/types/generator/LinearCongruential.d.ts
generated
vendored
8
node_modules/pure-rand/lib/esm/types/generator/LinearCongruential.d.ts
generated
vendored
@@ -1,2 +1,6 @@
|
||||
import { RandomGenerator } from './RandomGenerator.js';
|
||||
export declare const congruential32: (seed: number) => RandomGenerator;
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function fromState(state: readonly number[]): RandomGenerator;
|
||||
export declare const congruential32: ((seed: number) => RandomGenerator) & {
|
||||
fromState: typeof fromState;
|
||||
};
|
||||
export {};
|
||||
|
||||
8
node_modules/pure-rand/lib/esm/types/generator/MersenneTwister.d.ts
generated
vendored
8
node_modules/pure-rand/lib/esm/types/generator/MersenneTwister.d.ts
generated
vendored
@@ -1,2 +1,6 @@
|
||||
import { RandomGenerator } from './RandomGenerator.js';
|
||||
export default function (seed: number): RandomGenerator;
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function fromState(state: readonly number[]): RandomGenerator;
|
||||
export declare const mersenne: ((seed: number) => RandomGenerator) & {
|
||||
fromState: typeof fromState;
|
||||
};
|
||||
export {};
|
||||
|
||||
11
node_modules/pure-rand/lib/esm/types/generator/RandomGenerator.d.ts
generated
vendored
11
node_modules/pure-rand/lib/esm/types/generator/RandomGenerator.d.ts
generated
vendored
@@ -1,11 +0,0 @@
|
||||
export interface RandomGenerator {
|
||||
clone(): RandomGenerator;
|
||||
next(): [number, RandomGenerator];
|
||||
jump?(): RandomGenerator;
|
||||
unsafeNext(): number;
|
||||
unsafeJump?(): void;
|
||||
}
|
||||
export declare function unsafeGenerateN(rng: RandomGenerator, num: number): number[];
|
||||
export declare function generateN(rng: RandomGenerator, num: number): [number[], RandomGenerator];
|
||||
export declare function unsafeSkipN(rng: RandomGenerator, num: number): void;
|
||||
export declare function skipN(rng: RandomGenerator, num: number): RandomGenerator;
|
||||
8
node_modules/pure-rand/lib/esm/types/generator/XorShift.d.ts
generated
vendored
8
node_modules/pure-rand/lib/esm/types/generator/XorShift.d.ts
generated
vendored
@@ -1,2 +1,6 @@
|
||||
import { RandomGenerator } from './RandomGenerator.js';
|
||||
export declare const xorshift128plus: (seed: number) => RandomGenerator;
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function fromState(state: readonly number[]): RandomGenerator;
|
||||
export declare const xorshift128plus: ((seed: number) => RandomGenerator) & {
|
||||
fromState: typeof fromState;
|
||||
};
|
||||
export {};
|
||||
|
||||
8
node_modules/pure-rand/lib/esm/types/generator/XoroShiro.d.ts
generated
vendored
8
node_modules/pure-rand/lib/esm/types/generator/XoroShiro.d.ts
generated
vendored
@@ -1,2 +1,6 @@
|
||||
import { RandomGenerator } from './RandomGenerator.js';
|
||||
export declare const xoroshiro128plus: (seed: number) => RandomGenerator;
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function fromState(state: readonly number[]): RandomGenerator;
|
||||
export declare const xoroshiro128plus: ((seed: number) => RandomGenerator) & {
|
||||
fromState: typeof fromState;
|
||||
};
|
||||
export {};
|
||||
|
||||
10
node_modules/pure-rand/lib/esm/types/pure-rand-default.d.ts
generated
vendored
10
node_modules/pure-rand/lib/esm/types/pure-rand-default.d.ts
generated
vendored
@@ -1,15 +1,19 @@
|
||||
import { RandomGenerator, generateN, skipN, unsafeGenerateN, unsafeSkipN } from './generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from './types/RandomGenerator.js';
|
||||
import { congruential32 } from './generator/LinearCongruential.js';
|
||||
import mersenne from './generator/MersenneTwister.js';
|
||||
import { mersenne } from './generator/MersenneTwister.js';
|
||||
import { xorshift128plus } from './generator/XorShift.js';
|
||||
import { xoroshiro128plus } from './generator/XoroShiro.js';
|
||||
import { Distribution } from './distribution/Distribution.js';
|
||||
import type { Distribution } from './types/Distribution.js';
|
||||
import { uniformArrayIntDistribution } from './distribution/UniformArrayIntDistribution.js';
|
||||
import { uniformBigIntDistribution } from './distribution/UniformBigIntDistribution.js';
|
||||
import { uniformIntDistribution } from './distribution/UniformIntDistribution.js';
|
||||
import { unsafeUniformArrayIntDistribution } from './distribution/UnsafeUniformArrayIntDistribution.js';
|
||||
import { unsafeUniformBigIntDistribution } from './distribution/UnsafeUniformBigIntDistribution.js';
|
||||
import { unsafeUniformIntDistribution } from './distribution/UnsafeUniformIntDistribution.js';
|
||||
import { skipN } from './distribution/SkipN.js';
|
||||
import { generateN } from './distribution/GenerateN.js';
|
||||
import { unsafeGenerateN } from './distribution/UnsafeGenerateN.js';
|
||||
import { unsafeSkipN } from './distribution/UnsafeSkipN.js';
|
||||
declare const __type: string;
|
||||
declare const __version: string;
|
||||
declare const __commitHash: string;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from './RandomGenerator.js';
|
||||
export type Distribution<T> = (rng: RandomGenerator) => [T, RandomGenerator];
|
||||
8
node_modules/pure-rand/lib/esm/types/types/RandomGenerator.d.ts
generated
vendored
Normal file
8
node_modules/pure-rand/lib/esm/types/types/RandomGenerator.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export interface RandomGenerator {
|
||||
clone(): RandomGenerator;
|
||||
next(): [number, RandomGenerator];
|
||||
jump?(): RandomGenerator;
|
||||
unsafeNext(): number;
|
||||
unsafeJump?(): void;
|
||||
getState(): readonly number[];
|
||||
}
|
||||
17
node_modules/pure-rand/lib/generator/LinearCongruential.js
generated
vendored
17
node_modules/pure-rand/lib/generator/LinearCongruential.js
generated
vendored
@@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.congruential32 = void 0;
|
||||
var MULTIPLIER = 0x000343fd;
|
||||
var INCREMENT = 0x00269ec3;
|
||||
@@ -33,9 +33,18 @@ var LinearCongruential32 = (function () {
|
||||
var vnext = v3 + ((v2 + (v1 << 15)) << 15);
|
||||
return vnext | 0;
|
||||
};
|
||||
LinearCongruential32.prototype.getState = function () {
|
||||
return [this.seed];
|
||||
};
|
||||
return LinearCongruential32;
|
||||
}());
|
||||
var congruential32 = function (seed) {
|
||||
function fromState(state) {
|
||||
var valid = state.length === 1;
|
||||
if (!valid) {
|
||||
throw new Error('The state must have been produced by a congruential32 RandomGenerator');
|
||||
}
|
||||
return new LinearCongruential32(state[0]);
|
||||
}
|
||||
exports.congruential32 = Object.assign(function (seed) {
|
||||
return new LinearCongruential32(seed);
|
||||
};
|
||||
exports.congruential32 = congruential32;
|
||||
}, { fromState: fromState });
|
||||
|
||||
46
node_modules/pure-rand/lib/generator/MersenneTwister.js
generated
vendored
46
node_modules/pure-rand/lib/generator/MersenneTwister.js
generated
vendored
@@ -1,5 +1,31 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.mersenne = void 0;
|
||||
var MersenneTwister = (function () {
|
||||
function MersenneTwister(states, index) {
|
||||
this.states = states;
|
||||
@@ -51,6 +77,16 @@ var MersenneTwister = (function () {
|
||||
}
|
||||
return y;
|
||||
};
|
||||
MersenneTwister.prototype.getState = function () {
|
||||
return __spreadArray([this.index], __read(this.states), false);
|
||||
};
|
||||
MersenneTwister.fromState = function (state) {
|
||||
var valid = state.length === MersenneTwister.N + 1 && state[0] >= 0 && state[0] < MersenneTwister.N;
|
||||
if (!valid) {
|
||||
throw new Error('The state must have been produced by a mersenne RandomGenerator');
|
||||
}
|
||||
return new MersenneTwister(state.slice(1), state[0]);
|
||||
};
|
||||
MersenneTwister.N = 624;
|
||||
MersenneTwister.M = 397;
|
||||
MersenneTwister.R = 31;
|
||||
@@ -66,7 +102,9 @@ var MersenneTwister = (function () {
|
||||
MersenneTwister.MASK_UPPER = Math.pow(2, MersenneTwister.R);
|
||||
return MersenneTwister;
|
||||
}());
|
||||
function default_1(seed) {
|
||||
return MersenneTwister.from(seed);
|
||||
function fromState(state) {
|
||||
return MersenneTwister.fromState(state);
|
||||
}
|
||||
exports["default"] = default_1;
|
||||
exports.mersenne = Object.assign(function (seed) {
|
||||
return MersenneTwister.from(seed);
|
||||
}, { fromState: fromState });
|
||||
|
||||
29
node_modules/pure-rand/lib/generator/RandomGenerator.js
generated
vendored
29
node_modules/pure-rand/lib/generator/RandomGenerator.js
generated
vendored
@@ -1,29 +0,0 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.skipN = exports.unsafeSkipN = exports.generateN = exports.unsafeGenerateN = void 0;
|
||||
function unsafeGenerateN(rng, num) {
|
||||
var out = [];
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
out.push(rng.unsafeNext());
|
||||
}
|
||||
return out;
|
||||
}
|
||||
exports.unsafeGenerateN = unsafeGenerateN;
|
||||
function generateN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
var out = unsafeGenerateN(nextRng, num);
|
||||
return [out, nextRng];
|
||||
}
|
||||
exports.generateN = generateN;
|
||||
function unsafeSkipN(rng, num) {
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
rng.unsafeNext();
|
||||
}
|
||||
}
|
||||
exports.unsafeSkipN = unsafeSkipN;
|
||||
function skipN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
unsafeSkipN(nextRng, num);
|
||||
return nextRng;
|
||||
}
|
||||
exports.skipN = skipN;
|
||||
17
node_modules/pure-rand/lib/generator/XorShift.js
generated
vendored
17
node_modules/pure-rand/lib/generator/XorShift.js
generated
vendored
@@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.xorshift128plus = void 0;
|
||||
var XorShift128Plus = (function () {
|
||||
function XorShift128Plus(s01, s00, s11, s10) {
|
||||
@@ -55,9 +55,18 @@ var XorShift128Plus = (function () {
|
||||
this.s11 = ns11;
|
||||
this.s10 = ns10;
|
||||
};
|
||||
XorShift128Plus.prototype.getState = function () {
|
||||
return [this.s01, this.s00, this.s11, this.s10];
|
||||
};
|
||||
return XorShift128Plus;
|
||||
}());
|
||||
var xorshift128plus = function (seed) {
|
||||
function fromState(state) {
|
||||
var valid = state.length === 4;
|
||||
if (!valid) {
|
||||
throw new Error('The state must have been produced by a xorshift128plus RandomGenerator');
|
||||
}
|
||||
return new XorShift128Plus(state[0], state[1], state[2], state[3]);
|
||||
}
|
||||
exports.xorshift128plus = Object.assign(function (seed) {
|
||||
return new XorShift128Plus(-1, ~seed, seed | 0, 0);
|
||||
};
|
||||
exports.xorshift128plus = xorshift128plus;
|
||||
}, { fromState: fromState });
|
||||
|
||||
17
node_modules/pure-rand/lib/generator/XoroShiro.js
generated
vendored
17
node_modules/pure-rand/lib/generator/XoroShiro.js
generated
vendored
@@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.xoroshiro128plus = void 0;
|
||||
var XoroShiro128Plus = (function () {
|
||||
function XoroShiro128Plus(s01, s00, s11, s10) {
|
||||
@@ -55,9 +55,18 @@ var XoroShiro128Plus = (function () {
|
||||
this.s11 = ns11;
|
||||
this.s10 = ns10;
|
||||
};
|
||||
XoroShiro128Plus.prototype.getState = function () {
|
||||
return [this.s01, this.s00, this.s11, this.s10];
|
||||
};
|
||||
return XoroShiro128Plus;
|
||||
}());
|
||||
var xoroshiro128plus = function (seed) {
|
||||
function fromState(state) {
|
||||
var valid = state.length === 4;
|
||||
if (!valid) {
|
||||
throw new Error('The state must have been produced by a xoroshiro128plus RandomGenerator');
|
||||
}
|
||||
return new XoroShiro128Plus(state[0], state[1], state[2], state[3]);
|
||||
}
|
||||
exports.xoroshiro128plus = Object.assign(function (seed) {
|
||||
return new XoroShiro128Plus(-1, ~seed, seed | 0, 0);
|
||||
};
|
||||
exports.xoroshiro128plus = xoroshiro128plus;
|
||||
}, { fromState: fromState });
|
||||
|
||||
39
node_modules/pure-rand/lib/pure-rand-default.js
generated
vendored
39
node_modules/pure-rand/lib/pure-rand-default.js
generated
vendored
@@ -1,34 +1,37 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unsafeUniformIntDistribution = exports.unsafeUniformBigIntDistribution = exports.unsafeUniformArrayIntDistribution = exports.uniformIntDistribution = exports.uniformBigIntDistribution = exports.uniformArrayIntDistribution = exports.xoroshiro128plus = exports.xorshift128plus = exports.mersenne = exports.congruential32 = exports.unsafeSkipN = exports.unsafeGenerateN = exports.skipN = exports.generateN = exports.__commitHash = exports.__version = exports.__type = void 0;
|
||||
var RandomGenerator_1 = require("./generator/RandomGenerator");
|
||||
exports.generateN = RandomGenerator_1.generateN;
|
||||
exports.skipN = RandomGenerator_1.skipN;
|
||||
exports.unsafeGenerateN = RandomGenerator_1.unsafeGenerateN;
|
||||
exports.unsafeSkipN = RandomGenerator_1.unsafeSkipN;
|
||||
var LinearCongruential_1 = require("./generator/LinearCongruential");
|
||||
exports.congruential32 = LinearCongruential_1.congruential32;
|
||||
Object.defineProperty(exports, "congruential32", { enumerable: true, get: function () { return LinearCongruential_1.congruential32; } });
|
||||
var MersenneTwister_1 = require("./generator/MersenneTwister");
|
||||
exports.mersenne = MersenneTwister_1["default"];
|
||||
Object.defineProperty(exports, "mersenne", { enumerable: true, get: function () { return MersenneTwister_1.mersenne; } });
|
||||
var XorShift_1 = require("./generator/XorShift");
|
||||
exports.xorshift128plus = XorShift_1.xorshift128plus;
|
||||
Object.defineProperty(exports, "xorshift128plus", { enumerable: true, get: function () { return XorShift_1.xorshift128plus; } });
|
||||
var XoroShiro_1 = require("./generator/XoroShiro");
|
||||
exports.xoroshiro128plus = XoroShiro_1.xoroshiro128plus;
|
||||
Object.defineProperty(exports, "xoroshiro128plus", { enumerable: true, get: function () { return XoroShiro_1.xoroshiro128plus; } });
|
||||
var UniformArrayIntDistribution_1 = require("./distribution/UniformArrayIntDistribution");
|
||||
exports.uniformArrayIntDistribution = UniformArrayIntDistribution_1.uniformArrayIntDistribution;
|
||||
Object.defineProperty(exports, "uniformArrayIntDistribution", { enumerable: true, get: function () { return UniformArrayIntDistribution_1.uniformArrayIntDistribution; } });
|
||||
var UniformBigIntDistribution_1 = require("./distribution/UniformBigIntDistribution");
|
||||
exports.uniformBigIntDistribution = UniformBigIntDistribution_1.uniformBigIntDistribution;
|
||||
Object.defineProperty(exports, "uniformBigIntDistribution", { enumerable: true, get: function () { return UniformBigIntDistribution_1.uniformBigIntDistribution; } });
|
||||
var UniformIntDistribution_1 = require("./distribution/UniformIntDistribution");
|
||||
exports.uniformIntDistribution = UniformIntDistribution_1.uniformIntDistribution;
|
||||
Object.defineProperty(exports, "uniformIntDistribution", { enumerable: true, get: function () { return UniformIntDistribution_1.uniformIntDistribution; } });
|
||||
var UnsafeUniformArrayIntDistribution_1 = require("./distribution/UnsafeUniformArrayIntDistribution");
|
||||
exports.unsafeUniformArrayIntDistribution = UnsafeUniformArrayIntDistribution_1.unsafeUniformArrayIntDistribution;
|
||||
Object.defineProperty(exports, "unsafeUniformArrayIntDistribution", { enumerable: true, get: function () { return UnsafeUniformArrayIntDistribution_1.unsafeUniformArrayIntDistribution; } });
|
||||
var UnsafeUniformBigIntDistribution_1 = require("./distribution/UnsafeUniformBigIntDistribution");
|
||||
exports.unsafeUniformBigIntDistribution = UnsafeUniformBigIntDistribution_1.unsafeUniformBigIntDistribution;
|
||||
Object.defineProperty(exports, "unsafeUniformBigIntDistribution", { enumerable: true, get: function () { return UnsafeUniformBigIntDistribution_1.unsafeUniformBigIntDistribution; } });
|
||||
var UnsafeUniformIntDistribution_1 = require("./distribution/UnsafeUniformIntDistribution");
|
||||
exports.unsafeUniformIntDistribution = UnsafeUniformIntDistribution_1.unsafeUniformIntDistribution;
|
||||
Object.defineProperty(exports, "unsafeUniformIntDistribution", { enumerable: true, get: function () { return UnsafeUniformIntDistribution_1.unsafeUniformIntDistribution; } });
|
||||
var SkipN_1 = require("./distribution/SkipN");
|
||||
Object.defineProperty(exports, "skipN", { enumerable: true, get: function () { return SkipN_1.skipN; } });
|
||||
var GenerateN_1 = require("./distribution/GenerateN");
|
||||
Object.defineProperty(exports, "generateN", { enumerable: true, get: function () { return GenerateN_1.generateN; } });
|
||||
var UnsafeGenerateN_1 = require("./distribution/UnsafeGenerateN");
|
||||
Object.defineProperty(exports, "unsafeGenerateN", { enumerable: true, get: function () { return UnsafeGenerateN_1.unsafeGenerateN; } });
|
||||
var UnsafeSkipN_1 = require("./distribution/UnsafeSkipN");
|
||||
Object.defineProperty(exports, "unsafeSkipN", { enumerable: true, get: function () { return UnsafeSkipN_1.unsafeSkipN; } });
|
||||
var __type = 'commonjs';
|
||||
exports.__type = __type;
|
||||
var __version = '6.0.4';
|
||||
var __version = '7.0.1';
|
||||
exports.__version = __version;
|
||||
var __commitHash = 'bcf9517d53f733a335e678fbba321780c0543b29';
|
||||
var __commitHash = '2248506b66d969d1a8b477a4dde8e24cbac33e6a';
|
||||
exports.__commitHash = __commitHash;
|
||||
|
||||
4
node_modules/pure-rand/lib/pure-rand.js
generated
vendored
4
node_modules/pure-rand/lib/pure-rand.js
generated
vendored
@@ -13,7 +13,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var prand = require("./pure-rand-default");
|
||||
exports["default"] = prand;
|
||||
exports.default = prand;
|
||||
__exportStar(require("./pure-rand-default"), exports);
|
||||
|
||||
2
node_modules/pure-rand/lib/types/Distribution.js
generated
vendored
Normal file
2
node_modules/pure-rand/lib/types/Distribution.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
2
node_modules/pure-rand/lib/types/RandomGenerator.js
generated
vendored
Normal file
2
node_modules/pure-rand/lib/types/RandomGenerator.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
2
node_modules/pure-rand/lib/types/distribution/GenerateN.d.ts
generated
vendored
Normal file
2
node_modules/pure-rand/lib/types/distribution/GenerateN.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function generateN(rng: RandomGenerator, num: number): [number[], RandomGenerator];
|
||||
2
node_modules/pure-rand/lib/types/distribution/SkipN.d.ts
generated
vendored
Normal file
2
node_modules/pure-rand/lib/types/distribution/SkipN.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function skipN(rng: RandomGenerator, num: number): RandomGenerator;
|
||||
6
node_modules/pure-rand/lib/types/distribution/UniformArrayIntDistribution.d.ts
generated
vendored
6
node_modules/pure-rand/lib/types/distribution/UniformArrayIntDistribution.d.ts
generated
vendored
@@ -1,6 +1,6 @@
|
||||
import { Distribution } from './Distribution.js';
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import { ArrayInt } from './internals/ArrayInt.js';
|
||||
import type { Distribution } from '../types/Distribution.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
import type { ArrayInt } from './internals/ArrayInt.js';
|
||||
declare function uniformArrayIntDistribution(from: ArrayInt, to: ArrayInt): Distribution<ArrayInt>;
|
||||
declare function uniformArrayIntDistribution(from: ArrayInt, to: ArrayInt, rng: RandomGenerator): [ArrayInt, RandomGenerator];
|
||||
export { uniformArrayIntDistribution };
|
||||
|
||||
4
node_modules/pure-rand/lib/types/distribution/UniformBigIntDistribution.d.ts
generated
vendored
4
node_modules/pure-rand/lib/types/distribution/UniformBigIntDistribution.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
import { Distribution } from './Distribution.js';
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { Distribution } from '../types/Distribution.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function uniformBigIntDistribution(from: bigint, to: bigint): Distribution<bigint>;
|
||||
declare function uniformBigIntDistribution(from: bigint, to: bigint, rng: RandomGenerator): [bigint, RandomGenerator];
|
||||
export { uniformBigIntDistribution };
|
||||
|
||||
4
node_modules/pure-rand/lib/types/distribution/UniformIntDistribution.d.ts
generated
vendored
4
node_modules/pure-rand/lib/types/distribution/UniformIntDistribution.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
import { Distribution } from './Distribution.js';
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { Distribution } from '../types/Distribution.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function uniformIntDistribution(from: number, to: number): Distribution<number>;
|
||||
declare function uniformIntDistribution(from: number, to: number, rng: RandomGenerator): [number, RandomGenerator];
|
||||
export { uniformIntDistribution };
|
||||
|
||||
2
node_modules/pure-rand/lib/types/distribution/UnsafeGenerateN.d.ts
generated
vendored
Normal file
2
node_modules/pure-rand/lib/types/distribution/UnsafeGenerateN.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function unsafeGenerateN(rng: RandomGenerator, num: number): number[];
|
||||
2
node_modules/pure-rand/lib/types/distribution/UnsafeSkipN.d.ts
generated
vendored
Normal file
2
node_modules/pure-rand/lib/types/distribution/UnsafeSkipN.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function unsafeSkipN(rng: RandomGenerator, num: number): void;
|
||||
4
node_modules/pure-rand/lib/types/distribution/UnsafeUniformArrayIntDistribution.d.ts
generated
vendored
4
node_modules/pure-rand/lib/types/distribution/UnsafeUniformArrayIntDistribution.d.ts
generated
vendored
@@ -1,3 +1,3 @@
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import { ArrayInt } from './internals/ArrayInt.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
import type { ArrayInt } from './internals/ArrayInt.js';
|
||||
export declare function unsafeUniformArrayIntDistribution(from: ArrayInt, to: ArrayInt, rng: RandomGenerator): ArrayInt;
|
||||
|
||||
2
node_modules/pure-rand/lib/types/distribution/UnsafeUniformBigIntDistribution.d.ts
generated
vendored
2
node_modules/pure-rand/lib/types/distribution/UnsafeUniformBigIntDistribution.d.ts
generated
vendored
@@ -1,2 +1,2 @@
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function unsafeUniformBigIntDistribution(from: bigint, to: bigint, rng: RandomGenerator): bigint;
|
||||
|
||||
2
node_modules/pure-rand/lib/types/distribution/UnsafeUniformIntDistribution.d.ts
generated
vendored
2
node_modules/pure-rand/lib/types/distribution/UnsafeUniformIntDistribution.d.ts
generated
vendored
@@ -1,2 +1,2 @@
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
export declare function unsafeUniformIntDistribution(from: number, to: number, rng: RandomGenerator): number;
|
||||
|
||||
5
node_modules/pure-rand/lib/types/distribution/internals/ArrayInt.d.ts
generated
vendored
5
node_modules/pure-rand/lib/types/distribution/internals/ArrayInt.d.ts
generated
vendored
@@ -6,8 +6,3 @@ export declare function addArrayIntToNew(arrayIntA: ArrayInt, arrayIntB: ArrayIn
|
||||
export declare function addOneToPositiveArrayInt(arrayInt: ArrayInt): ArrayInt;
|
||||
export declare function substractArrayIntToNew(arrayIntA: ArrayInt, arrayIntB: ArrayInt): ArrayInt;
|
||||
export declare function trimArrayIntInplace(arrayInt: ArrayInt): ArrayInt;
|
||||
export type ArrayInt64 = Required<ArrayInt> & {
|
||||
data: [number, number];
|
||||
};
|
||||
export declare function fromNumberToArrayInt64(out: ArrayInt64, n: number): ArrayInt64;
|
||||
export declare function substractArrayInt64(out: ArrayInt64, arrayIntA: ArrayInt64, arrayIntB: ArrayInt64): ArrayInt64;
|
||||
|
||||
6
node_modules/pure-rand/lib/types/distribution/internals/ArrayInt64.d.ts
generated
vendored
Normal file
6
node_modules/pure-rand/lib/types/distribution/internals/ArrayInt64.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { ArrayInt } from './ArrayInt.js';
|
||||
export type ArrayInt64 = Required<ArrayInt> & {
|
||||
data: [number, number];
|
||||
};
|
||||
export declare function fromNumberToArrayInt64(out: ArrayInt64, n: number): ArrayInt64;
|
||||
export declare function substractArrayInt64(out: ArrayInt64, arrayIntA: ArrayInt64, arrayIntB: ArrayInt64): ArrayInt64;
|
||||
@@ -1,3 +1,3 @@
|
||||
import { RandomGenerator } from '../../generator/RandomGenerator.js';
|
||||
import { ArrayInt } from './ArrayInt.js';
|
||||
import type { RandomGenerator } from '../../types/RandomGenerator.js';
|
||||
import type { ArrayInt } from './ArrayInt.js';
|
||||
export declare function unsafeUniformArrayIntDistributionInternal(out: ArrayInt['data'], rangeSize: ArrayInt['data'], rng: RandomGenerator): ArrayInt['data'];
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
import { RandomGenerator } from '../../generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from '../../types/RandomGenerator.js';
|
||||
export declare function unsafeUniformIntDistributionInternal(rangeSize: number, rng: RandomGenerator): number;
|
||||
|
||||
8
node_modules/pure-rand/lib/types/generator/LinearCongruential.d.ts
generated
vendored
8
node_modules/pure-rand/lib/types/generator/LinearCongruential.d.ts
generated
vendored
@@ -1,2 +1,6 @@
|
||||
import { RandomGenerator } from './RandomGenerator.js';
|
||||
export declare const congruential32: (seed: number) => RandomGenerator;
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function fromState(state: readonly number[]): RandomGenerator;
|
||||
export declare const congruential32: ((seed: number) => RandomGenerator) & {
|
||||
fromState: typeof fromState;
|
||||
};
|
||||
export {};
|
||||
|
||||
8
node_modules/pure-rand/lib/types/generator/MersenneTwister.d.ts
generated
vendored
8
node_modules/pure-rand/lib/types/generator/MersenneTwister.d.ts
generated
vendored
@@ -1,2 +1,6 @@
|
||||
import { RandomGenerator } from './RandomGenerator.js';
|
||||
export default function (seed: number): RandomGenerator;
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function fromState(state: readonly number[]): RandomGenerator;
|
||||
export declare const mersenne: ((seed: number) => RandomGenerator) & {
|
||||
fromState: typeof fromState;
|
||||
};
|
||||
export {};
|
||||
|
||||
11
node_modules/pure-rand/lib/types/generator/RandomGenerator.d.ts
generated
vendored
11
node_modules/pure-rand/lib/types/generator/RandomGenerator.d.ts
generated
vendored
@@ -1,11 +0,0 @@
|
||||
export interface RandomGenerator {
|
||||
clone(): RandomGenerator;
|
||||
next(): [number, RandomGenerator];
|
||||
jump?(): RandomGenerator;
|
||||
unsafeNext(): number;
|
||||
unsafeJump?(): void;
|
||||
}
|
||||
export declare function unsafeGenerateN(rng: RandomGenerator, num: number): number[];
|
||||
export declare function generateN(rng: RandomGenerator, num: number): [number[], RandomGenerator];
|
||||
export declare function unsafeSkipN(rng: RandomGenerator, num: number): void;
|
||||
export declare function skipN(rng: RandomGenerator, num: number): RandomGenerator;
|
||||
8
node_modules/pure-rand/lib/types/generator/XorShift.d.ts
generated
vendored
8
node_modules/pure-rand/lib/types/generator/XorShift.d.ts
generated
vendored
@@ -1,2 +1,6 @@
|
||||
import { RandomGenerator } from './RandomGenerator.js';
|
||||
export declare const xorshift128plus: (seed: number) => RandomGenerator;
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function fromState(state: readonly number[]): RandomGenerator;
|
||||
export declare const xorshift128plus: ((seed: number) => RandomGenerator) & {
|
||||
fromState: typeof fromState;
|
||||
};
|
||||
export {};
|
||||
|
||||
8
node_modules/pure-rand/lib/types/generator/XoroShiro.d.ts
generated
vendored
8
node_modules/pure-rand/lib/types/generator/XoroShiro.d.ts
generated
vendored
@@ -1,2 +1,6 @@
|
||||
import { RandomGenerator } from './RandomGenerator.js';
|
||||
export declare const xoroshiro128plus: (seed: number) => RandomGenerator;
|
||||
import type { RandomGenerator } from '../types/RandomGenerator.js';
|
||||
declare function fromState(state: readonly number[]): RandomGenerator;
|
||||
export declare const xoroshiro128plus: ((seed: number) => RandomGenerator) & {
|
||||
fromState: typeof fromState;
|
||||
};
|
||||
export {};
|
||||
|
||||
10
node_modules/pure-rand/lib/types/pure-rand-default.d.ts
generated
vendored
10
node_modules/pure-rand/lib/types/pure-rand-default.d.ts
generated
vendored
@@ -1,15 +1,19 @@
|
||||
import { RandomGenerator, generateN, skipN, unsafeGenerateN, unsafeSkipN } from './generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from './types/RandomGenerator.js';
|
||||
import { congruential32 } from './generator/LinearCongruential.js';
|
||||
import mersenne from './generator/MersenneTwister.js';
|
||||
import { mersenne } from './generator/MersenneTwister.js';
|
||||
import { xorshift128plus } from './generator/XorShift.js';
|
||||
import { xoroshiro128plus } from './generator/XoroShiro.js';
|
||||
import { Distribution } from './distribution/Distribution.js';
|
||||
import type { Distribution } from './types/Distribution.js';
|
||||
import { uniformArrayIntDistribution } from './distribution/UniformArrayIntDistribution.js';
|
||||
import { uniformBigIntDistribution } from './distribution/UniformBigIntDistribution.js';
|
||||
import { uniformIntDistribution } from './distribution/UniformIntDistribution.js';
|
||||
import { unsafeUniformArrayIntDistribution } from './distribution/UnsafeUniformArrayIntDistribution.js';
|
||||
import { unsafeUniformBigIntDistribution } from './distribution/UnsafeUniformBigIntDistribution.js';
|
||||
import { unsafeUniformIntDistribution } from './distribution/UnsafeUniformIntDistribution.js';
|
||||
import { skipN } from './distribution/SkipN.js';
|
||||
import { generateN } from './distribution/GenerateN.js';
|
||||
import { unsafeGenerateN } from './distribution/UnsafeGenerateN.js';
|
||||
import { unsafeSkipN } from './distribution/UnsafeSkipN.js';
|
||||
declare const __type: string;
|
||||
declare const __version: string;
|
||||
declare const __commitHash: string;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
import { RandomGenerator } from '../generator/RandomGenerator.js';
|
||||
import type { RandomGenerator } from './RandomGenerator.js';
|
||||
export type Distribution<T> = (rng: RandomGenerator) => [T, RandomGenerator];
|
||||
8
node_modules/pure-rand/lib/types/types/RandomGenerator.d.ts
generated
vendored
Normal file
8
node_modules/pure-rand/lib/types/types/RandomGenerator.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export interface RandomGenerator {
|
||||
clone(): RandomGenerator;
|
||||
next(): [number, RandomGenerator];
|
||||
jump?(): RandomGenerator;
|
||||
unsafeNext(): number;
|
||||
unsafeJump?(): void;
|
||||
getState(): readonly number[];
|
||||
}
|
||||
54
node_modules/pure-rand/package.json
generated
vendored
54
node_modules/pure-rand/package.json
generated
vendored
@@ -1,11 +1,41 @@
|
||||
{
|
||||
"name": "pure-rand",
|
||||
"version": "6.0.4",
|
||||
"version": "7.0.1",
|
||||
"description": " Pure random number generator written in TypeScript",
|
||||
"type": "commonjs",
|
||||
"main": "lib/pure-rand.js",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
"./distribution/*": {
|
||||
"require": {
|
||||
"types": "./lib/types/distribution/*.d.ts",
|
||||
"default": "./lib/distribution/*.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./lib/esm/types/distribution/*.d.ts",
|
||||
"default": "./lib/esm/distribution/*.js"
|
||||
}
|
||||
},
|
||||
"./generator/*": {
|
||||
"require": {
|
||||
"types": "./lib/types/generator/*.d.ts",
|
||||
"default": "./lib/generator/*.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./lib/esm/types/generator/*.d.ts",
|
||||
"default": "./lib/esm/generator/*.js"
|
||||
}
|
||||
},
|
||||
"./types/*": {
|
||||
"require": {
|
||||
"types": "./lib/types/types/*.d.ts",
|
||||
"default": "./lib/types/*.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./lib/esm/types/types/*.d.ts",
|
||||
"default": "./lib/esm/types/*.js"
|
||||
}
|
||||
},
|
||||
".": {
|
||||
"require": {
|
||||
"types": "./lib/types/pure-rand.d.ts",
|
||||
@@ -23,13 +53,13 @@
|
||||
"lib"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"packageManager": "yarn@3.6.3",
|
||||
"packageManager": "yarn@4.6.0",
|
||||
"scripts": {
|
||||
"format:check": "prettier --list-different .",
|
||||
"format": "prettier --write .",
|
||||
"build": "tsc && tsc -p ./tsconfig.declaration.json",
|
||||
"build:esm": "tsc --module es2015 --outDir lib/esm --moduleResolution node && tsc -p ./tsconfig.declaration.json --outDir lib/esm/types && cp package.esm-template.json lib/esm/package.json",
|
||||
"build:prod": "yarn build && yarn build:esm && node postbuild/main.cjs",
|
||||
"build:prod": "yarn build && yarn build:esm && node postbuild/main.mjs",
|
||||
"build:prod-ci": "cross-env EXPECT_GITHUB_SHA=true yarn build:prod",
|
||||
"test": "jest --config jest.config.js --coverage",
|
||||
"build:bench:old": "tsc --outDir lib-reference/",
|
||||
@@ -47,18 +77,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/dubzzz/pure-rand#readme",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.5",
|
||||
"@types/node": "^18.17.17",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^22.13.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"fast-check": "^3.13.0",
|
||||
"fast-check": "^3.23.2",
|
||||
"jest": "^29.7.0",
|
||||
"prettier": "2.8.8",
|
||||
"replace-in-file": "^7.0.1",
|
||||
"prettier": "3.4.2",
|
||||
"replace-in-file": "^8.3.0",
|
||||
"source-map-support": "^0.5.21",
|
||||
"tinybench": "^2.5.1",
|
||||
"ts-jest": "^29.1.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
"tinybench": "^3.1.1",
|
||||
"ts-jest": "^29.2.5",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.5.3"
|
||||
},
|
||||
"keywords": [
|
||||
"seed",
|
||||
|
||||
Reference in New Issue
Block a user