@thi.ng/lowdisc 0.3.2 → 0.3.5
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/README.md +2 -2
- package/halton.d.ts +3 -3
- package/halton.js +3 -3
- package/kronecker.d.ts +4 -4
- package/kronecker.js +4 -4
- package/lowdisc.d.ts +2 -2
- package/lowdisc.js +2 -2
- package/package.json +12 -12
- package/plastic.d.ts +3 -3
- package/plastic.js +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ node --experimental-repl-await
|
|
|
90
90
|
> const lowdisc = await import("@thi.ng/lowdisc");
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
Package sizes (gzipped, pre-treeshake): ESM:
|
|
93
|
+
Package sizes (gzipped, pre-treeshake): ESM: 497 bytes
|
|
94
94
|
|
|
95
95
|
## Dependencies
|
|
96
96
|
|
|
@@ -119,4 +119,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
119
119
|
|
|
120
120
|
## License
|
|
121
121
|
|
|
122
|
-
© 2020 -
|
|
122
|
+
© 2020 - 2022 Karsten Schmidt // Apache Software License 2.0
|
package/halton.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @remarks
|
|
5
5
|
* Ported from Python version at: https://en.wikipedia.org/wiki/Halton_sequence
|
|
6
6
|
*
|
|
7
|
-
* @param base
|
|
7
|
+
* @param base -
|
|
8
8
|
*/
|
|
9
9
|
export declare function halton(base: number): Generator<number, void, unknown>;
|
|
10
10
|
/**
|
|
@@ -12,8 +12,8 @@ export declare function halton(base: number): Generator<number, void, unknown>;
|
|
|
12
12
|
* dimension) and yields iterator of nD points. If `offset` > 0, the stated
|
|
13
13
|
* number of initial iterations will be skipped.
|
|
14
14
|
*
|
|
15
|
-
* @param bases
|
|
16
|
-
* @param offset
|
|
15
|
+
* @param bases -
|
|
16
|
+
* @param offset -
|
|
17
17
|
*/
|
|
18
18
|
export declare const haltonND: (bases: number[], offset?: number) => Generator<number[], never, unknown>;
|
|
19
19
|
//# sourceMappingURL=halton.d.ts.map
|
package/halton.js
CHANGED
|
@@ -5,7 +5,7 @@ import { lowDiscrepancy } from "./lowdisc.js";
|
|
|
5
5
|
* @remarks
|
|
6
6
|
* Ported from Python version at: https://en.wikipedia.org/wiki/Halton_sequence
|
|
7
7
|
*
|
|
8
|
-
* @param base
|
|
8
|
+
* @param base -
|
|
9
9
|
*/
|
|
10
10
|
export function* halton(base) {
|
|
11
11
|
let n = 0;
|
|
@@ -32,7 +32,7 @@ export function* halton(base) {
|
|
|
32
32
|
* dimension) and yields iterator of nD points. If `offset` > 0, the stated
|
|
33
33
|
* number of initial iterations will be skipped.
|
|
34
34
|
*
|
|
35
|
-
* @param bases
|
|
36
|
-
* @param offset
|
|
35
|
+
* @param bases -
|
|
36
|
+
* @param offset -
|
|
37
37
|
*/
|
|
38
38
|
export const haltonND = (bases, offset = 0) => lowDiscrepancy(bases.map(halton), offset);
|
package/kronecker.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* - https://math.stackexchange.com/a/2848339
|
|
10
10
|
* - http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/
|
|
11
11
|
*
|
|
12
|
-
* @param alpha
|
|
13
|
-
* @param start
|
|
12
|
+
* @param alpha -
|
|
13
|
+
* @param start -
|
|
14
14
|
*/
|
|
15
15
|
export declare function kronecker(alpha: number, start?: number): Generator<number, void, unknown>;
|
|
16
16
|
/**
|
|
@@ -18,8 +18,8 @@ export declare function kronecker(alpha: number, start?: number): Generator<numb
|
|
|
18
18
|
* per dimension) and yields iterator of nD points. If `offset` > 0, the stated
|
|
19
19
|
* number of initial iterations will be skipped.
|
|
20
20
|
*
|
|
21
|
-
* @param bases
|
|
22
|
-
* @param offset
|
|
21
|
+
* @param bases -
|
|
22
|
+
* @param offset -
|
|
23
23
|
*/
|
|
24
24
|
export declare const kroneckerND: (alphas: number[], offset?: number) => Generator<number[], never, unknown>;
|
|
25
25
|
//# sourceMappingURL=kronecker.d.ts.map
|
package/kronecker.js
CHANGED
|
@@ -12,8 +12,8 @@ const fract = (x) => x - Math.floor(x);
|
|
|
12
12
|
* - https://math.stackexchange.com/a/2848339
|
|
13
13
|
* - http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/
|
|
14
14
|
*
|
|
15
|
-
* @param alpha
|
|
16
|
-
* @param start
|
|
15
|
+
* @param alpha -
|
|
16
|
+
* @param start -
|
|
17
17
|
*/
|
|
18
18
|
export function* kronecker(alpha, start = 0) {
|
|
19
19
|
while (true)
|
|
@@ -24,7 +24,7 @@ export function* kronecker(alpha, start = 0) {
|
|
|
24
24
|
* per dimension) and yields iterator of nD points. If `offset` > 0, the stated
|
|
25
25
|
* number of initial iterations will be skipped.
|
|
26
26
|
*
|
|
27
|
-
* @param bases
|
|
28
|
-
* @param offset
|
|
27
|
+
* @param bases -
|
|
28
|
+
* @param offset -
|
|
29
29
|
*/
|
|
30
30
|
export const kroneckerND = (alphas, offset = 0) => lowDiscrepancy(alphas.map(kronecker), offset);
|
package/lowdisc.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* This function acts as shared impl for all other sequence generators in this
|
|
8
8
|
* package.
|
|
9
9
|
*
|
|
10
|
-
* @param dims
|
|
11
|
-
* @param offset
|
|
10
|
+
* @param dims -
|
|
11
|
+
* @param offset -
|
|
12
12
|
*/
|
|
13
13
|
export declare const lowDiscrepancy: (dims: Iterator<number>[], offset?: number) => Generator<number[], never, unknown>;
|
|
14
14
|
//# sourceMappingURL=lowdisc.d.ts.map
|
package/lowdisc.js
CHANGED
|
@@ -8,8 +8,8 @@ import { assert } from "@thi.ng/errors/assert";
|
|
|
8
8
|
* This function acts as shared impl for all other sequence generators in this
|
|
9
9
|
* package.
|
|
10
10
|
*
|
|
11
|
-
* @param dims
|
|
12
|
-
* @param offset
|
|
11
|
+
* @param dims -
|
|
12
|
+
* @param offset -
|
|
13
13
|
*/
|
|
14
14
|
export const lowDiscrepancy = (dims, offset = 0) => {
|
|
15
15
|
const num = dims.length;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/lowdisc",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "n-dimensional low-discrepancy sequence generators/iterators",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/errors": "^2.1.
|
|
37
|
+
"@thi.ng/errors": "^2.1.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@microsoft/api-extractor": "^7.
|
|
41
|
-
"@thi.ng/testament": "^0.2.
|
|
40
|
+
"@microsoft/api-extractor": "^7.19.4",
|
|
41
|
+
"@thi.ng/testament": "^0.2.5",
|
|
42
42
|
"rimraf": "^3.0.2",
|
|
43
43
|
"tools": "^0.0.1",
|
|
44
|
-
"typedoc": "^0.22.
|
|
45
|
-
"typescript": "^4.
|
|
44
|
+
"typedoc": "^0.22.13",
|
|
45
|
+
"typescript": "^4.6.2"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"discrepancy",
|
|
@@ -70,19 +70,19 @@
|
|
|
70
70
|
],
|
|
71
71
|
"exports": {
|
|
72
72
|
".": {
|
|
73
|
-
"
|
|
73
|
+
"default": "./index.js"
|
|
74
74
|
},
|
|
75
75
|
"./halton": {
|
|
76
|
-
"
|
|
76
|
+
"default": "./halton.js"
|
|
77
77
|
},
|
|
78
78
|
"./kronecker": {
|
|
79
|
-
"
|
|
79
|
+
"default": "./kronecker.js"
|
|
80
80
|
},
|
|
81
81
|
"./lowdisc": {
|
|
82
|
-
"
|
|
82
|
+
"default": "./lowdisc.js"
|
|
83
83
|
},
|
|
84
84
|
"./plastic": {
|
|
85
|
-
"
|
|
85
|
+
"default": "./plastic.js"
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
"thi.ng": {
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"status": "beta",
|
|
94
94
|
"year": 2020
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "5ee1feb590dd935593b1dd4e7f38a3ed3ba64765\n"
|
|
97
97
|
}
|
package/plastic.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @remarks
|
|
8
8
|
* See {@link plasticND} for references.
|
|
9
9
|
*
|
|
10
|
-
* @param d
|
|
11
|
-
* @param i
|
|
10
|
+
* @param d -
|
|
11
|
+
* @param i -
|
|
12
12
|
*/
|
|
13
13
|
export declare const phi: (d: number, i?: number) => number;
|
|
14
14
|
/**
|
|
@@ -22,7 +22,7 @@ export declare const phi: (d: number, i?: number) => number;
|
|
|
22
22
|
* - https://en.wikipedia.org/wiki/Plastic_number
|
|
23
23
|
* - https://bib.irb.hr/datoteka/628836.Plastic_Number_-_Construct.pdf
|
|
24
24
|
*
|
|
25
|
-
* @param dim
|
|
25
|
+
* @param dim -
|
|
26
26
|
*/
|
|
27
27
|
export declare const plasticND: (dim: number, offset?: number) => Generator<number[], never, unknown>;
|
|
28
28
|
//# sourceMappingURL=plastic.d.ts.map
|
package/plastic.js
CHANGED
|
@@ -10,8 +10,8 @@ import { lowDiscrepancy } from "./lowdisc.js";
|
|
|
10
10
|
* @remarks
|
|
11
11
|
* See {@link plasticND} for references.
|
|
12
12
|
*
|
|
13
|
-
* @param d
|
|
14
|
-
* @param i
|
|
13
|
+
* @param d -
|
|
14
|
+
* @param i -
|
|
15
15
|
*/
|
|
16
16
|
export const phi = (d, i = 18) => {
|
|
17
17
|
assert(d > 0, `d must be > 0`);
|
|
@@ -32,7 +32,7 @@ export const phi = (d, i = 18) => {
|
|
|
32
32
|
* - https://en.wikipedia.org/wiki/Plastic_number
|
|
33
33
|
* - https://bib.irb.hr/datoteka/628836.Plastic_Number_-_Construct.pdf
|
|
34
34
|
*
|
|
35
|
-
* @param dim
|
|
35
|
+
* @param dim -
|
|
36
36
|
*/
|
|
37
37
|
export const plasticND = (dim, offset = 0) => {
|
|
38
38
|
const g = phi(dim);
|