@thi.ng/lowdisc 0.3.65 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-23T07:02:18Z
3
+ - **Last updated**: 2024-05-08T18:24:32Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
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.65",
3
+ "version": "0.3.66",
4
4
  "description": "n-dimensional low-discrepancy sequence generators/iterators",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,13 +36,13 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/errors": "^2.5.6"
39
+ "@thi.ng/errors": "^2.5.7"
40
40
  },
41
41
  "devDependencies": {
42
- "@microsoft/api-extractor": "^7.43.0",
43
- "esbuild": "^0.20.2",
44
- "typedoc": "^0.25.12",
45
- "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"
46
46
  },
47
47
  "keywords": [
48
48
  "discrepancy",
@@ -94,5 +94,5 @@
94
94
  "status": "beta",
95
95
  "year": 2020
96
96
  },
97
- "gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n"
97
+ "gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
98
98
  }
package/plastic.js CHANGED
@@ -5,8 +5,7 @@ const phi = (d, i = 18) => {
5
5
  assert(d > 0, `d must be > 0`);
6
6
  d = 1 / (d + 1);
7
7
  let x = 2;
8
- while (i-- > 0)
9
- x = (1 + x) ** d;
8
+ while (i-- > 0) x = (1 + x) ** d;
10
9
  return x;
11
10
  };
12
11
  const plasticND = (dim, offset = 0) => {