@thi.ng/dual-algebra 0.4.71 → 0.4.72
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 +8 -1
- package/README.md +1 -1
- package/ops.js +1 -1
- package/package.json +7 -7
- package/vector.js +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-06-21T19:34:38Z
|
|
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.
|
|
@@ -9,6 +9,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [0.4.72](https://github.com/thi-ng/umbrella/tree/@thi.ng/dual-algebra@0.4.72) (2024-06-21)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- rename various rest args to be more semantically meaningful ([8088a56](https://github.com/thi-ng/umbrella/commit/8088a56))
|
|
17
|
+
- enforce uniform naming convention of internal functions ([56992b2](https://github.com/thi-ng/umbrella/commit/56992b2))
|
|
18
|
+
|
|
12
19
|
### [0.4.41](https://github.com/thi-ng/umbrella/tree/@thi.ng/dual-algebra@0.4.41) (2023-11-09)
|
|
13
20
|
|
|
14
21
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 193 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/ops.js
CHANGED
|
@@ -8,7 +8,7 @@ const $ = (r, i = 0) => [r, i === 1 ? 1 : 0];
|
|
|
8
8
|
const $2 = (r, i = 0) => dual(r, 2, i);
|
|
9
9
|
const $3 = (r, i = 0) => dual(r, 3, i);
|
|
10
10
|
const $4 = (r, i = 0) => dual(r, 4, i);
|
|
11
|
-
const defOp = (single, multi, dispatch = 0) => (...
|
|
11
|
+
const defOp = (single, multi, dispatch = 0) => (...args) => args[dispatch].length < 3 ? single(...args) : multi(...args);
|
|
12
12
|
const add = defOp(
|
|
13
13
|
(a, b) => [a[0] + b[0], a[1] + b[1]],
|
|
14
14
|
(a, b) => a.map((x, i) => x + b[i])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/dual-algebra",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.72",
|
|
4
4
|
"description": "Multivariate dual number algebra, automatic differentiation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://thi.ng/dual-algebra",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
39
|
+
"@thi.ng/api": "^8.11.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@microsoft/api-extractor": "^7.
|
|
43
|
-
"esbuild": "^0.21.
|
|
42
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
43
|
+
"esbuild": "^0.21.5",
|
|
44
44
|
"typedoc": "^0.25.13",
|
|
45
|
-
"typescript": "^5.
|
|
45
|
+
"typescript": "^5.5.2"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"algebra",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"status": "alpha",
|
|
92
92
|
"year": 2020
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "154c95cf9d6bab32174498ec3b5b5d87e42be7f9\n"
|
|
95
95
|
}
|
package/vector.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { add, div, dual, mul, sub } from "./ops.js";
|
|
2
|
-
const
|
|
3
|
-
const vadd =
|
|
4
|
-
const vsub =
|
|
5
|
-
const vmul =
|
|
6
|
-
const vdiv =
|
|
2
|
+
const __defVecOp2 = (op) => (a, b) => a.map((a2, i) => op(a2, b[i]));
|
|
3
|
+
const vadd = __defVecOp2(add);
|
|
4
|
+
const vsub = __defVecOp2(sub);
|
|
5
|
+
const vmul = __defVecOp2(mul);
|
|
6
|
+
const vdiv = __defVecOp2(div);
|
|
7
7
|
const dot = (a, b) => a.reduce((acc, a2, i) => add(acc, mul(a2, b[i])), dual(0, a[0].length));
|
|
8
8
|
export {
|
|
9
9
|
dot,
|