@thi.ng/lowdisc 0.3.64 → 0.3.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/kronecker.js +1 -2
- package/lowdisc.js +3 -6
- package/package.json +8 -9
- package/plastic.js +1 -2
package/CHANGELOG.md
CHANGED
package/kronecker.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { lowDiscrepancy } from "./lowdisc.js";
|
|
2
2
|
const fract = (x) => x - Math.floor(x);
|
|
3
3
|
function* kronecker(alpha, start = 0) {
|
|
4
|
-
while (true)
|
|
5
|
-
yield start = fract(start + alpha);
|
|
4
|
+
while (true) yield start = fract(start + alpha);
|
|
6
5
|
}
|
|
7
6
|
const kroneckerND = (alphas, offset = 0) => lowDiscrepancy(alphas.map(kronecker), offset);
|
|
8
7
|
export {
|
package/lowdisc.js
CHANGED
|
@@ -4,8 +4,7 @@ const lowDiscrepancy = (dims, offset = 0) => {
|
|
|
4
4
|
assert(num > 0, `invalid dimensions`);
|
|
5
5
|
const [x, y, z] = dims;
|
|
6
6
|
const iter = num === 1 ? function* () {
|
|
7
|
-
while (true)
|
|
8
|
-
yield [x.next().value];
|
|
7
|
+
while (true) yield [x.next().value];
|
|
9
8
|
}() : num === 2 ? function* () {
|
|
10
9
|
while (true)
|
|
11
10
|
yield [x.next().value, y.next().value];
|
|
@@ -17,11 +16,9 @@ const lowDiscrepancy = (dims, offset = 0) => {
|
|
|
17
16
|
z.next().value
|
|
18
17
|
];
|
|
19
18
|
}() : function* () {
|
|
20
|
-
while (true)
|
|
21
|
-
yield dims.map((d) => d.next().value);
|
|
19
|
+
while (true) yield dims.map((d) => d.next().value);
|
|
22
20
|
}();
|
|
23
|
-
for (; offset-- > 0; )
|
|
24
|
-
iter.next();
|
|
21
|
+
for (; offset-- > 0; ) iter.next();
|
|
25
22
|
return iter;
|
|
26
23
|
};
|
|
27
24
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/lowdisc",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.66",
|
|
4
4
|
"description": "n-dimensional low-discrepancy sequence generators/iterators",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"build": "yarn build:esbuild && yarn build:decl",
|
|
28
28
|
"build:decl": "tsc --declaration --emitDeclarationOnly",
|
|
29
29
|
"build:esbuild": "esbuild --format=esm --platform=neutral --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts",
|
|
30
|
-
"clean": "
|
|
30
|
+
"clean": "bun ../../tools/src/clean-package.ts",
|
|
31
31
|
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
32
32
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
33
33
|
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
@@ -36,14 +36,13 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/errors": "^2.5.
|
|
39
|
+
"@thi.ng/errors": "^2.5.7"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@microsoft/api-extractor": "^7.43.
|
|
43
|
-
"esbuild": "^0.
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"typescript": "^5.4.3"
|
|
42
|
+
"@microsoft/api-extractor": "^7.43.2",
|
|
43
|
+
"esbuild": "^0.21.1",
|
|
44
|
+
"typedoc": "^0.25.13",
|
|
45
|
+
"typescript": "^5.4.5"
|
|
47
46
|
},
|
|
48
47
|
"keywords": [
|
|
49
48
|
"discrepancy",
|
|
@@ -95,5 +94,5 @@
|
|
|
95
94
|
"status": "beta",
|
|
96
95
|
"year": 2020
|
|
97
96
|
},
|
|
98
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
|
|
99
98
|
}
|