@danielsimonjr/mathts-functions 0.65.0 → 0.66.0
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/dist/factories/evaluate.d.ts +48 -6
- package/dist/factories/evaluate.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +434 -66
- package/dist/numeric/gauss-legendre4.d.ts +75 -0
- package/dist/numeric/gauss-legendre4.d.ts.map +1 -0
- package/dist/numeric/propagate-uncertainty.d.ts +46 -0
- package/dist/numeric/propagate-uncertainty.d.ts.map +1 -0
- package/dist/numeric/rational-nullspace.d.ts +45 -0
- package/dist/numeric/rational-nullspace.d.ts.map +1 -0
- package/dist/typed/arithmetic.d.ts.map +1 -1
- package/dist/typed/numeric.d.ts +2 -0
- package/dist/typed/numeric.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
import { createEvaluate } from '@danielsimonjr/mathts-expression';
|
|
11
|
+
/** Map-like scope accepted by the expression compiler. */
|
|
12
|
+
interface Scope {
|
|
13
|
+
has(key: string): boolean;
|
|
14
|
+
get(key: string): unknown;
|
|
15
|
+
set(key: string, value: unknown): void;
|
|
16
|
+
}
|
|
11
17
|
/**
|
|
12
18
|
* Parse a math expression string into an AST node.
|
|
13
19
|
* Can be used for inspection or pre-compilation.
|
|
@@ -16,21 +22,52 @@ import { createEvaluate } from '@danielsimonjr/mathts-expression';
|
|
|
16
22
|
* typed-function conversion registrations.
|
|
17
23
|
*/
|
|
18
24
|
export declare const parse: Parameters<typeof createEvaluate>[0];
|
|
25
|
+
/**
|
|
26
|
+
* Options for {@link evaluate}, {@link compileExpr}, and {@link parser}.
|
|
27
|
+
*/
|
|
28
|
+
export interface PhysicsEvaluateOptions {
|
|
29
|
+
/**
|
|
30
|
+
* When `true`, disables the pre-compile AST validator.
|
|
31
|
+
* Only opt out when the host is providing trusted, hand-authored input.
|
|
32
|
+
*/
|
|
33
|
+
unsafe?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Opt-in physics reading of bare `e`.
|
|
36
|
+
*
|
|
37
|
+
* When `true`, `e` is the elementary charge `1.602176634e-19 C` (a Unit).
|
|
38
|
+
* `E` stays unbound so a formula can use it for energy. Euler's number is
|
|
39
|
+
* only `exp(x)`, for example `exp(1)`. An explicit scope binding for `e`
|
|
40
|
+
* still wins. Default `false`: `e` is Euler's number.
|
|
41
|
+
*/
|
|
42
|
+
physics?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Scope in which bare `e` is the elementary charge.
|
|
46
|
+
*
|
|
47
|
+
* Pass the result as `evaluate`'s scope, or use `{ physics: true }`.
|
|
48
|
+
* Entries already present on `scope` win, including an explicit `e`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function physicsScope(scope?: Record<string, unknown> | Scope): Record<string, unknown> | Scope;
|
|
19
51
|
/**
|
|
20
52
|
* Evaluate a math expression string against the full activated math scope.
|
|
21
53
|
*
|
|
22
54
|
* @param expr - Expression string (e.g., '2 + 3', 'sin(pi/2)', 'x^2')
|
|
23
55
|
* @param scope - Optional variable bindings (e.g., { x: 3 })
|
|
56
|
+
* @param options - Optional flags. `{ physics: true }` reads bare `e` as the elementary charge.
|
|
24
57
|
* @returns The result of evaluating the expression
|
|
25
58
|
*
|
|
26
59
|
* @example
|
|
27
60
|
* ```ts
|
|
28
|
-
* evaluate('2 + 3');
|
|
29
|
-
* evaluate('sin(pi / 2)');
|
|
30
|
-
* evaluate('x^2 + 1', { x: 3 })
|
|
61
|
+
* evaluate('2 + 3'); // 5
|
|
62
|
+
* evaluate('sin(pi / 2)'); // 1
|
|
63
|
+
* evaluate('x^2 + 1', { x: 3 }); // 10
|
|
64
|
+
* evaluate('e'); // Euler's number
|
|
65
|
+
* evaluate('e', undefined, { physics: true }); // 1.602176634e-19 C
|
|
66
|
+
* evaluate('exp(1)', undefined, { physics: true }); // Euler's number
|
|
31
67
|
* ```
|
|
32
68
|
*/
|
|
33
|
-
export declare
|
|
69
|
+
export declare function evaluate(expr: string, scope?: Record<string, unknown> | Scope, options?: PhysicsEvaluateOptions): unknown;
|
|
70
|
+
export declare function evaluate(exprs: string[], scope?: Record<string, unknown> | Scope, options?: PhysicsEvaluateOptions): unknown[];
|
|
34
71
|
/**
|
|
35
72
|
* Compile a math expression into a reusable CompiledExpression.
|
|
36
73
|
*
|
|
@@ -38,6 +75,7 @@ export declare const evaluate: ReturnType<typeof createEvaluate>;
|
|
|
38
75
|
* many times with different variable bindings.
|
|
39
76
|
*
|
|
40
77
|
* @param expr - Expression string to compile
|
|
78
|
+
* @param options - Optional flags. `{ physics: true }` reads bare `e` as the elementary charge.
|
|
41
79
|
* @returns CompiledExpression with an evaluate(scope?) method
|
|
42
80
|
*
|
|
43
81
|
* @example
|
|
@@ -45,9 +83,10 @@ export declare const evaluate: ReturnType<typeof createEvaluate>;
|
|
|
45
83
|
* const compiled = compileExpr('x^2 + y');
|
|
46
84
|
* compiled.evaluate({ x: 2, y: 1 }); // 5
|
|
47
85
|
* compiled.evaluate({ x: 3, y: 2 }); // 11
|
|
86
|
+
* compileExpr('e', { physics: true }).evaluate(); // 1.602176634e-19 C
|
|
48
87
|
* ```
|
|
49
88
|
*/
|
|
50
|
-
export declare function compileExpr(expr: string): import("@danielsimonjr/mathts-expression").CompiledExpression;
|
|
89
|
+
export declare function compileExpr(expr: string, options?: PhysicsEvaluateOptions): import("@danielsimonjr/mathts-expression").CompiledExpression;
|
|
51
90
|
/**
|
|
52
91
|
* A stateful parser with a retained scope. Variables persist across
|
|
53
92
|
* `evaluate` calls.
|
|
@@ -55,6 +94,7 @@ export declare function compileExpr(expr: string): import("@danielsimonjr/mathts
|
|
|
55
94
|
* Assignment expressions (`x = 5`) are rejected by the expression security
|
|
56
95
|
* validator — manage retained state with `set` / `get` instead.
|
|
57
96
|
*
|
|
97
|
+
* @param options - Optional flags. `{ physics: true }` reads bare `e` as the elementary charge.
|
|
58
98
|
* @example
|
|
59
99
|
* ```ts
|
|
60
100
|
* const p = parser();
|
|
@@ -62,9 +102,10 @@ export declare function compileExpr(expr: string): import("@danielsimonjr/mathts
|
|
|
62
102
|
* p.evaluate('x^2'); // 9
|
|
63
103
|
* p.set('y', p.evaluate('x + 1')); // retain a computed value
|
|
64
104
|
* p.get('y'); // 4
|
|
105
|
+
* parser({ physics: true }).evaluate('exp(1)'); // Euler's number
|
|
65
106
|
* ```
|
|
66
107
|
*/
|
|
67
|
-
export declare function parser(): {
|
|
108
|
+
export declare function parser(options?: PhysicsEvaluateOptions): {
|
|
68
109
|
/** The live scope object — assignments during `evaluate` land here. */
|
|
69
110
|
scope: Record<string, unknown>;
|
|
70
111
|
/** Evaluate an expression against the retained scope. */
|
|
@@ -88,4 +129,5 @@ export declare function replacer(_key: string, value: unknown): unknown;
|
|
|
88
129
|
* non-finite numbers tagged by {@link replacer} / the types' own `toJSON()`.
|
|
89
130
|
*/
|
|
90
131
|
export declare function reviver(_key: string, value: unknown): unknown;
|
|
132
|
+
export {};
|
|
91
133
|
//# sourceMappingURL=evaluate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/factories/evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,cAAc,EAEf,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/factories/evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,cAAc,EAEf,MAAM,kCAAkC,CAAC;AAgB1C,0DAA0D;AAC1D,UAAU,KAAK;IACb,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,GAAG,CAAC,GAAG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iBACrB,MAAM,GAAG,IAAI;IAG1B,oCAAoC;aAC3B,IAAI;EAIhB;AAMD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAO9D;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAgB7D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,9 @@ export * from './factories/index.js';
|
|
|
14
14
|
export { config } from './config-api.js';
|
|
15
15
|
export { loadWasm, isWasmLoaded } from './wasm/WasmLoader.js';
|
|
16
16
|
export { to, toBest } from './typed/unit.js';
|
|
17
|
-
export { evaluate, compileExpr, parse, parser, reviver, replacer } from './factories/evaluate.js';
|
|
17
|
+
export { evaluate, compileExpr, parse, parser, physicsScope, reviver, replacer, } from './factories/evaluate.js';
|
|
18
|
+
export type { PhysicsEvaluateOptions } from './factories/evaluate.js';
|
|
19
|
+
export { propagateUncertainty, type UncertaintyPropagationOptions, type UncertaintyPropagationResult, } from './numeric/propagate-uncertainty.js';
|
|
18
20
|
export { help } from './help.js';
|
|
19
21
|
export { continuedFraction, eulerNumbers, stirlingS1, discreteLog, primitiveRoot, multiplicativeOrder, kroneckerSymbol, permutationsGen, combinationsGen, } from './numbertheory/extra.js';
|
|
20
22
|
export { derivativeAt, valueAndDerivativeAt, gradientAt } from './grad-forward.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,cAAc,kBAAkB,CAAC;AAKjC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIzC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAs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AE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAI1E,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAI1F,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACtF,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAI9F,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAChG,YAAY,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,10 @@ __export(typed_exports, {
|
|
|
24
24
|
CENTRALITY_WORKER_THRESHOLD: () => CENTRALITY_WORKER_THRESHOLD,
|
|
25
25
|
DIST_WORKER_THRESHOLD: () => DIST_WORKER_THRESHOLD,
|
|
26
26
|
GAUSS_WORKER_THRESHOLD: () => GAUSS_WORKER_THRESHOLD,
|
|
27
|
+
GL4ConvergenceError: () => GL4ConvergenceError,
|
|
28
|
+
GL4_A: () => GL4_A,
|
|
29
|
+
GL4_B: () => GL4_B,
|
|
30
|
+
GL4_C: () => GL4_C,
|
|
27
31
|
GPU_ELEMENTWISE_OPS: () => GPU_ELEMENTWISE_OPS,
|
|
28
32
|
GPU_MIN_ELEMENTS: () => GPU_MIN_ELEMENTS2,
|
|
29
33
|
GPU_REDUCE_OPS: () => GPU_REDUCE_OPS,
|
|
@@ -206,6 +210,7 @@ __export(typed_exports, {
|
|
|
206
210
|
gammaPDF: () => gammaPDF,
|
|
207
211
|
gammainc: () => gammainc,
|
|
208
212
|
gammaincp: () => gammaincp,
|
|
213
|
+
gaussLegendre4: () => gaussLegendre4,
|
|
209
214
|
gaussQuad: () => gaussQuad,
|
|
210
215
|
gcd: () => gcd,
|
|
211
216
|
geometricPMF: () => geometricPMF,
|
|
@@ -397,6 +402,7 @@ __export(typed_exports, {
|
|
|
397
402
|
random: () => random,
|
|
398
403
|
randomInt: () => randomInt,
|
|
399
404
|
rank: () => rank,
|
|
405
|
+
rationalNullspace: () => rationalNullspace,
|
|
400
406
|
rayleighDist: () => rayleighDist,
|
|
401
407
|
rbfInterpolate: () => rbfInterpolate,
|
|
402
408
|
re: () => re,
|
|
@@ -1683,6 +1689,8 @@ var pow = mathTyped2("pow", {
|
|
|
1683
1689
|
// Dual numbers (forward-mode AD): constant or variable exponent.
|
|
1684
1690
|
"Dual, number": (a, b) => a.powConst(b),
|
|
1685
1691
|
"Dual, Dual": (a, b) => a.pow(b),
|
|
1692
|
+
// Dimensional power, including physics-mode `e^2` (elementary charge squared).
|
|
1693
|
+
"Unit, number": (a, b) => a.pow(b),
|
|
1686
1694
|
// Matrix power A^n for a square 2-D array and non-negative integer n, via binary
|
|
1687
1695
|
// exponentiation on the native DenseMatrix backend (accelerated matmul, B2). Element-
|
|
1688
1696
|
// wise power is `dotPow`; negative/fractional matrix powers need eigendecomposition —
|
|
@@ -11119,8 +11127,8 @@ function integerPolynomialGCD(a, b) {
|
|
|
11119
11127
|
return g.map((c) => Number(c) / lead);
|
|
11120
11128
|
}
|
|
11121
11129
|
function polynomialLCM(a, b) {
|
|
11122
|
-
const
|
|
11123
|
-
const [quotient] = polyDivMod(polymul(a, b),
|
|
11130
|
+
const gcd3 = polynomialGCD(a, b);
|
|
11131
|
+
const [quotient] = polyDivMod(polymul(a, b), gcd3);
|
|
11124
11132
|
const leading = quotient[quotient.length - 1];
|
|
11125
11133
|
if (leading !== 0 && leading !== 1) {
|
|
11126
11134
|
return quotient.map((c) => c / leading);
|
|
@@ -14116,6 +14124,109 @@ function quad(f, a, b, opts) {
|
|
|
14116
14124
|
return panel(a, b, 0);
|
|
14117
14125
|
}
|
|
14118
14126
|
|
|
14127
|
+
// src/numeric/rational-nullspace.ts
|
|
14128
|
+
import { Fraction as Fraction2, isFraction as isFraction2 } from "@danielsimonjr/mathts-core";
|
|
14129
|
+
function gcd2(a, b) {
|
|
14130
|
+
let x = a < 0n ? -a : a;
|
|
14131
|
+
let y = b < 0n ? -b : b;
|
|
14132
|
+
while (y !== 0n) {
|
|
14133
|
+
const t = y;
|
|
14134
|
+
y = x % y;
|
|
14135
|
+
x = t;
|
|
14136
|
+
}
|
|
14137
|
+
return x;
|
|
14138
|
+
}
|
|
14139
|
+
function lcm2(a, b) {
|
|
14140
|
+
if (a === 0n || b === 0n) return 0n;
|
|
14141
|
+
return a / gcd2(a, b) * b;
|
|
14142
|
+
}
|
|
14143
|
+
function entryToFraction(value, row2, col) {
|
|
14144
|
+
if (isFraction2(value)) return value;
|
|
14145
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
14146
|
+
throw new TypeError(
|
|
14147
|
+
`rationalNullspace: entry [${row2}, ${col}] must be a finite number or a Fraction`
|
|
14148
|
+
);
|
|
14149
|
+
}
|
|
14150
|
+
return Number.isInteger(value) ? new Fraction2(value, 1) : Fraction2.fromNumber(value);
|
|
14151
|
+
}
|
|
14152
|
+
function integerize(vec) {
|
|
14153
|
+
let scale4 = 1n;
|
|
14154
|
+
for (const f of vec) {
|
|
14155
|
+
if (f.numerator !== 0n) scale4 = lcm2(scale4, f.denominator);
|
|
14156
|
+
}
|
|
14157
|
+
const ints = vec.map((f) => f.numerator * scale4 / f.denominator);
|
|
14158
|
+
let content2 = 0n;
|
|
14159
|
+
for (const x of ints) {
|
|
14160
|
+
if (x !== 0n) content2 = gcd2(content2, x);
|
|
14161
|
+
}
|
|
14162
|
+
if (content2 === 0n) content2 = 1n;
|
|
14163
|
+
const reduced = ints.map((x) => x / content2);
|
|
14164
|
+
const first = reduced.find((x) => x !== 0n) ?? 0n;
|
|
14165
|
+
const sign3 = first < 0n ? -1n : 1n;
|
|
14166
|
+
return reduced.map((x) => new Fraction2(sign3 * x, 1n));
|
|
14167
|
+
}
|
|
14168
|
+
function rref(matrix2) {
|
|
14169
|
+
const rows = matrix2.length;
|
|
14170
|
+
const cols = rows === 0 ? 0 : matrix2[0].length;
|
|
14171
|
+
const pivotCols = [];
|
|
14172
|
+
let r = 0;
|
|
14173
|
+
for (let c = 0; c < cols && r < rows; c++) {
|
|
14174
|
+
let pivotRow = -1;
|
|
14175
|
+
for (let i = r; i < rows; i++) {
|
|
14176
|
+
if (matrix2[i][c].numerator !== 0n) {
|
|
14177
|
+
pivotRow = i;
|
|
14178
|
+
break;
|
|
14179
|
+
}
|
|
14180
|
+
}
|
|
14181
|
+
if (pivotRow === -1) continue;
|
|
14182
|
+
if (pivotRow !== r) {
|
|
14183
|
+
const swap = matrix2[r];
|
|
14184
|
+
matrix2[r] = matrix2[pivotRow];
|
|
14185
|
+
matrix2[pivotRow] = swap;
|
|
14186
|
+
}
|
|
14187
|
+
const pivot = matrix2[r][c];
|
|
14188
|
+
for (let j = 0; j < cols; j++) matrix2[r][j] = matrix2[r][j].div(pivot);
|
|
14189
|
+
for (let i = 0; i < rows; i++) {
|
|
14190
|
+
if (i === r || matrix2[i][c].numerator === 0n) continue;
|
|
14191
|
+
const factor2 = matrix2[i][c];
|
|
14192
|
+
for (let j = 0; j < cols; j++) {
|
|
14193
|
+
matrix2[i][j] = matrix2[i][j].sub(factor2.mul(matrix2[r][j]));
|
|
14194
|
+
}
|
|
14195
|
+
}
|
|
14196
|
+
pivotCols.push(c);
|
|
14197
|
+
r++;
|
|
14198
|
+
}
|
|
14199
|
+
return pivotCols;
|
|
14200
|
+
}
|
|
14201
|
+
function rationalNullspace(matrix2) {
|
|
14202
|
+
if (matrix2.length === 0) return { basis: [], rank: 0 };
|
|
14203
|
+
const cols = matrix2[0].length;
|
|
14204
|
+
for (let i = 0; i < matrix2.length; i++) {
|
|
14205
|
+
if (!Array.isArray(matrix2[i]) || matrix2[i].length !== cols) {
|
|
14206
|
+
throw new TypeError(
|
|
14207
|
+
`rationalNullspace: row ${i} has length ${matrix2[i]?.length ?? "n/a"}; expected ${cols}`
|
|
14208
|
+
);
|
|
14209
|
+
}
|
|
14210
|
+
}
|
|
14211
|
+
const reduced = matrix2.map((row2, i) => row2.map((value, j) => entryToFraction(value, i, j)));
|
|
14212
|
+
const pivotCols = rref(reduced);
|
|
14213
|
+
const pivotSet = new Set(pivotCols);
|
|
14214
|
+
const basis = [];
|
|
14215
|
+
const zero = new Fraction2(0n, 1n);
|
|
14216
|
+
const one = new Fraction2(1n, 1n);
|
|
14217
|
+
for (let free = 0; free < cols; free++) {
|
|
14218
|
+
if (pivotSet.has(free)) continue;
|
|
14219
|
+
const vec = new Array(cols);
|
|
14220
|
+
for (let j = 0; j < cols; j++) vec[j] = zero;
|
|
14221
|
+
vec[free] = one;
|
|
14222
|
+
for (let i = 0; i < pivotCols.length; i++) {
|
|
14223
|
+
vec[pivotCols[i]] = zero.sub(reduced[i][free]);
|
|
14224
|
+
}
|
|
14225
|
+
basis.push(integerize(vec));
|
|
14226
|
+
}
|
|
14227
|
+
return { basis, rank: pivotCols.length };
|
|
14228
|
+
}
|
|
14229
|
+
|
|
14119
14230
|
// src/numeric/solveParabolicPDE.ts
|
|
14120
14231
|
function asSpaceFn(c, dflt) {
|
|
14121
14232
|
if (c === void 0) return () => dflt;
|
|
@@ -14681,6 +14792,125 @@ function solveDDE(f, tspan, history, delays, options = {}) {
|
|
|
14681
14792
|
};
|
|
14682
14793
|
}
|
|
14683
14794
|
|
|
14795
|
+
// src/numeric/gauss-legendre4.ts
|
|
14796
|
+
var SQRT3_OVER_6 = Math.sqrt(3) / 6;
|
|
14797
|
+
var GL4_C = [0.5 - SQRT3_OVER_6, 0.5 + SQRT3_OVER_6];
|
|
14798
|
+
var GL4_A = [
|
|
14799
|
+
[0.25, 0.25 - SQRT3_OVER_6],
|
|
14800
|
+
[0.25 + SQRT3_OVER_6, 0.25]
|
|
14801
|
+
];
|
|
14802
|
+
var GL4_B = [0.5, 0.5];
|
|
14803
|
+
var GL4ConvergenceError = class extends Error {
|
|
14804
|
+
constructor(message = "Picard iteration did not converge") {
|
|
14805
|
+
super(message);
|
|
14806
|
+
this.name = "GL4ConvergenceError";
|
|
14807
|
+
}
|
|
14808
|
+
};
|
|
14809
|
+
function assertFiniteVector(label, v) {
|
|
14810
|
+
for (let i = 0; i < v.length; i++) {
|
|
14811
|
+
if (!Number.isFinite(v[i])) {
|
|
14812
|
+
throw new TypeError(`${label}[${i}] must be a finite number`);
|
|
14813
|
+
}
|
|
14814
|
+
}
|
|
14815
|
+
}
|
|
14816
|
+
function gaussLegendre4(f, y0, tspan, options) {
|
|
14817
|
+
if (y0.length === 0) {
|
|
14818
|
+
throw new TypeError("y0 must be a non-empty vector");
|
|
14819
|
+
}
|
|
14820
|
+
assertFiniteVector("y0", y0);
|
|
14821
|
+
const t0 = tspan[0];
|
|
14822
|
+
const t1 = tspan[1];
|
|
14823
|
+
if (!Number.isFinite(t0) || !Number.isFinite(t1)) {
|
|
14824
|
+
throw new TypeError("tspan entries must be finite numbers");
|
|
14825
|
+
}
|
|
14826
|
+
const picardTol = options?.picardTol ?? 1e-12;
|
|
14827
|
+
const picardMaxIter = options?.picardMaxIter ?? 64;
|
|
14828
|
+
if (!(picardTol > 0) || !Number.isFinite(picardTol)) {
|
|
14829
|
+
throw new TypeError("picardTol must be a positive finite number");
|
|
14830
|
+
}
|
|
14831
|
+
if (!Number.isInteger(picardMaxIter) || picardMaxIter < 1) {
|
|
14832
|
+
throw new TypeError("picardMaxIter must be a positive integer");
|
|
14833
|
+
}
|
|
14834
|
+
if (t0 === t1) {
|
|
14835
|
+
return { t: [t0], y: [y0.slice()] };
|
|
14836
|
+
}
|
|
14837
|
+
const span = t1 - t0;
|
|
14838
|
+
let nSteps;
|
|
14839
|
+
if (options?.steps !== void 0) {
|
|
14840
|
+
nSteps = options.steps;
|
|
14841
|
+
if (!Number.isInteger(nSteps) || nSteps < 1) {
|
|
14842
|
+
throw new TypeError("steps must be a positive integer");
|
|
14843
|
+
}
|
|
14844
|
+
} else if (options?.h !== void 0) {
|
|
14845
|
+
const hAbs = options.h;
|
|
14846
|
+
if (!(hAbs > 0) || !Number.isFinite(hAbs)) {
|
|
14847
|
+
throw new TypeError("h must be a positive finite number");
|
|
14848
|
+
}
|
|
14849
|
+
nSteps = Math.max(1, Math.ceil(Math.abs(span) / hAbs));
|
|
14850
|
+
} else {
|
|
14851
|
+
nSteps = 100;
|
|
14852
|
+
}
|
|
14853
|
+
const h = span / nSteps;
|
|
14854
|
+
const n = y0.length;
|
|
14855
|
+
const c0 = GL4_C[0];
|
|
14856
|
+
const c1 = GL4_C[1];
|
|
14857
|
+
const a00 = GL4_A[0][0];
|
|
14858
|
+
const a01 = GL4_A[0][1];
|
|
14859
|
+
const a10 = GL4_A[1][0];
|
|
14860
|
+
const a11 = GL4_A[1][1];
|
|
14861
|
+
const b0 = GL4_B[0];
|
|
14862
|
+
const b1 = GL4_B[1];
|
|
14863
|
+
const t = [t0];
|
|
14864
|
+
const y = [y0.slice()];
|
|
14865
|
+
let tn = t0;
|
|
14866
|
+
let yn = y0.slice();
|
|
14867
|
+
for (let step = 0; step < nSteps; step++) {
|
|
14868
|
+
let Y0 = yn.slice();
|
|
14869
|
+
let Y1 = yn.slice();
|
|
14870
|
+
let converged = false;
|
|
14871
|
+
const next = new Array(n);
|
|
14872
|
+
for (let iter = 0; iter < picardMaxIter; iter++) {
|
|
14873
|
+
const k0 = f(tn + c0 * h, Y0);
|
|
14874
|
+
const k1 = f(tn + c1 * h, Y1);
|
|
14875
|
+
if (k0.length !== n || k1.length !== n) {
|
|
14876
|
+
throw new TypeError(`f must return a vector of length ${n}`);
|
|
14877
|
+
}
|
|
14878
|
+
assertFiniteVector("f(t, y)", k0);
|
|
14879
|
+
assertFiniteVector("f(t, y)", k1);
|
|
14880
|
+
let maxDiff = 0;
|
|
14881
|
+
const nY0 = new Array(n);
|
|
14882
|
+
const nY1 = new Array(n);
|
|
14883
|
+
for (let i = 0; i < n; i++) {
|
|
14884
|
+
nY0[i] = yn[i] + h * (a00 * k0[i] + a01 * k1[i]);
|
|
14885
|
+
nY1[i] = yn[i] + h * (a10 * k0[i] + a11 * k1[i]);
|
|
14886
|
+
const d0 = Math.abs(nY0[i] - Y0[i]);
|
|
14887
|
+
const d1 = Math.abs(nY1[i] - Y1[i]);
|
|
14888
|
+
if (d0 > maxDiff) maxDiff = d0;
|
|
14889
|
+
if (d1 > maxDiff) maxDiff = d1;
|
|
14890
|
+
}
|
|
14891
|
+
Y0 = nY0;
|
|
14892
|
+
Y1 = nY1;
|
|
14893
|
+
if (maxDiff <= picardTol) {
|
|
14894
|
+
for (let i = 0; i < n; i++) {
|
|
14895
|
+
next[i] = yn[i] + h * (b0 * k0[i] + b1 * k1[i]);
|
|
14896
|
+
}
|
|
14897
|
+
converged = true;
|
|
14898
|
+
break;
|
|
14899
|
+
}
|
|
14900
|
+
}
|
|
14901
|
+
if (!converged) {
|
|
14902
|
+
throw new GL4ConvergenceError(
|
|
14903
|
+
`Picard iteration did not converge within ${picardMaxIter} iterations (step h=${h})`
|
|
14904
|
+
);
|
|
14905
|
+
}
|
|
14906
|
+
tn += h;
|
|
14907
|
+
yn = next;
|
|
14908
|
+
t.push(tn);
|
|
14909
|
+
y.push(yn.slice());
|
|
14910
|
+
}
|
|
14911
|
+
return { t, y };
|
|
14912
|
+
}
|
|
14913
|
+
|
|
14684
14914
|
// src/typed/numeric.ts
|
|
14685
14915
|
function findRoot(f, a, b, opts) {
|
|
14686
14916
|
const tol = opts?.tol ?? 1e-12;
|
|
@@ -19545,12 +19775,12 @@ function rowReduce(A, tol = 1e-10) {
|
|
|
19545
19775
|
return M;
|
|
19546
19776
|
}
|
|
19547
19777
|
function matrixRank(A, tol = 1e-10) {
|
|
19548
|
-
const
|
|
19778
|
+
const rref2 = rowReduce(A, tol);
|
|
19549
19779
|
let r = 0;
|
|
19550
|
-
for (let i = 0; i <
|
|
19780
|
+
for (let i = 0; i < rref2.length; i++) {
|
|
19551
19781
|
let nonzero = false;
|
|
19552
|
-
for (let j = 0; j <
|
|
19553
|
-
if (Math.abs(
|
|
19782
|
+
for (let j = 0; j < rref2[i].length; j++) {
|
|
19783
|
+
if (Math.abs(rref2[i][j]) > tol) {
|
|
19554
19784
|
nonzero = true;
|
|
19555
19785
|
break;
|
|
19556
19786
|
}
|
|
@@ -19890,11 +20120,11 @@ async function jordanForm(A) {
|
|
|
19890
20120
|
return { J, P: P2 };
|
|
19891
20121
|
}
|
|
19892
20122
|
function matrixRankInternal(A, tol) {
|
|
19893
|
-
const
|
|
20123
|
+
const rref2 = rowReduce(A, tol);
|
|
19894
20124
|
let r = 0;
|
|
19895
|
-
for (let i = 0; i <
|
|
19896
|
-
for (let j = 0; j <
|
|
19897
|
-
if (Math.abs(
|
|
20125
|
+
for (let i = 0; i < rref2.length; i++) {
|
|
20126
|
+
for (let j = 0; j < rref2[i].length; j++) {
|
|
20127
|
+
if (Math.abs(rref2[i][j]) > tol) {
|
|
19898
20128
|
r++;
|
|
19899
20129
|
break;
|
|
19900
20130
|
}
|
|
@@ -19954,11 +20184,11 @@ async function buildJordanBlocks(A, lambda, algebraicMult, geoMult, n, tol) {
|
|
|
19954
20184
|
return blocks;
|
|
19955
20185
|
}
|
|
19956
20186
|
function findKernelVector(A, n, tol) {
|
|
19957
|
-
const
|
|
20187
|
+
const rref2 = rowReduce(A, tol);
|
|
19958
20188
|
const pivotCols = /* @__PURE__ */ new Set();
|
|
19959
20189
|
for (let i = 0; i < n; i++) {
|
|
19960
20190
|
for (let j = 0; j < n; j++) {
|
|
19961
|
-
if (Math.abs(
|
|
20191
|
+
if (Math.abs(rref2[i][j]) > tol) {
|
|
19962
20192
|
pivotCols.add(j);
|
|
19963
20193
|
break;
|
|
19964
20194
|
}
|
|
@@ -19980,8 +20210,8 @@ function findKernelVector(A, n, tol) {
|
|
|
19980
20210
|
v[freeCol] = 1;
|
|
19981
20211
|
for (let i = 0; i < n; i++) {
|
|
19982
20212
|
for (let j = 0; j < n; j++) {
|
|
19983
|
-
if (Math.abs(
|
|
19984
|
-
v[j] = -
|
|
20213
|
+
if (Math.abs(rref2[i][j]) > tol) {
|
|
20214
|
+
v[j] = -rref2[i][freeCol];
|
|
19985
20215
|
break;
|
|
19986
20216
|
}
|
|
19987
20217
|
}
|
|
@@ -20114,7 +20344,7 @@ import { enableGpu, disableGpu, isGpuEnabled as isGpuEnabled3, GPU_MIN_ELEMENTS
|
|
|
20114
20344
|
|
|
20115
20345
|
// src/typed/relational.ts
|
|
20116
20346
|
import naturalSort from "javascript-natural-sort";
|
|
20117
|
-
import { mathTyped as mathTyped14, Complex as Complex6, BigNumber as BigNumber6, Fraction as
|
|
20347
|
+
import { mathTyped as mathTyped14, Complex as Complex6, BigNumber as BigNumber6, Fraction as Fraction3 } from "@danielsimonjr/mathts-core";
|
|
20118
20348
|
var REL_TOL = 1e-12;
|
|
20119
20349
|
var ABS_TOL = 1e-15;
|
|
20120
20350
|
function numbersNearlyEqual(x, y) {
|
|
@@ -20138,7 +20368,7 @@ function typeNameOf(x) {
|
|
|
20138
20368
|
if (typeof x === "string") return "string";
|
|
20139
20369
|
if (x instanceof Complex6) return "Complex";
|
|
20140
20370
|
if (x instanceof BigNumber6) return "BigNumber";
|
|
20141
|
-
if (x instanceof
|
|
20371
|
+
if (x instanceof Fraction3) return "Fraction";
|
|
20142
20372
|
if (Array.isArray(x)) return "Array";
|
|
20143
20373
|
if (typeof x === "object") return "Object";
|
|
20144
20374
|
return typeof x;
|
|
@@ -20276,7 +20506,7 @@ function _numericCompare(x, y) {
|
|
|
20276
20506
|
let ny;
|
|
20277
20507
|
if (x instanceof BigNumber6) {
|
|
20278
20508
|
nx = x.toNumber();
|
|
20279
|
-
} else if (x instanceof
|
|
20509
|
+
} else if (x instanceof Fraction3) {
|
|
20280
20510
|
nx = x.valueOf();
|
|
20281
20511
|
} else if (typeof x === "bigint") {
|
|
20282
20512
|
nx = Number(x);
|
|
@@ -20285,7 +20515,7 @@ function _numericCompare(x, y) {
|
|
|
20285
20515
|
}
|
|
20286
20516
|
if (y instanceof BigNumber6) {
|
|
20287
20517
|
ny = y.toNumber();
|
|
20288
|
-
} else if (y instanceof
|
|
20518
|
+
} else if (y instanceof Fraction3) {
|
|
20289
20519
|
ny = y.valueOf();
|
|
20290
20520
|
} else if (typeof y === "bigint") {
|
|
20291
20521
|
ny = Number(y);
|
|
@@ -20705,7 +20935,7 @@ import {
|
|
|
20705
20935
|
} from "@danielsimonjr/mathts-expression";
|
|
20706
20936
|
import {
|
|
20707
20937
|
Complex as Complex9,
|
|
20708
|
-
Fraction as
|
|
20938
|
+
Fraction as Fraction5,
|
|
20709
20939
|
I,
|
|
20710
20940
|
PHI,
|
|
20711
20941
|
SQRT2,
|
|
@@ -20713,11 +20943,12 @@ import {
|
|
|
20713
20943
|
LN2 as LN22,
|
|
20714
20944
|
LN10,
|
|
20715
20945
|
LOG2E,
|
|
20716
|
-
LOG10E
|
|
20946
|
+
LOG10E,
|
|
20947
|
+
Unit as Unit2
|
|
20717
20948
|
} from "@danielsimonjr/mathts-core";
|
|
20718
20949
|
|
|
20719
20950
|
// src/factories/scope.ts
|
|
20720
|
-
import { mathTyped as mathTyped18, Complex as Complex7, Fraction as
|
|
20951
|
+
import { mathTyped as mathTyped18, Complex as Complex7, Fraction as Fraction4, BigNumber as BigNumber8 } from "@danielsimonjr/mathts-core";
|
|
20721
20952
|
|
|
20722
20953
|
// src/typed/typed-bridge.ts
|
|
20723
20954
|
import { registerNativeTypes } from "@danielsimonjr/mathts-core";
|
|
@@ -20832,7 +21063,7 @@ var factoryScope = {
|
|
|
20832
21063
|
// Class constructors (uppercase) — factories use `new BigNumber(...)` etc.
|
|
20833
21064
|
Complex: Complex7,
|
|
20834
21065
|
BigNumber: BigNumber8,
|
|
20835
|
-
Fraction:
|
|
21066
|
+
Fraction: Fraction4,
|
|
20836
21067
|
// Matrix bridge classes
|
|
20837
21068
|
DenseMatrix: MathJSDenseMatrix,
|
|
20838
21069
|
SparseMatrix: MathJSSparseMatrix,
|
|
@@ -20846,7 +21077,7 @@ var factoryScope = {
|
|
|
20846
21077
|
if (typeof x === "number") return BigNumber8.fromNumber(x);
|
|
20847
21078
|
return BigNumber8.fromNumber(Number(x.valueOf()));
|
|
20848
21079
|
},
|
|
20849
|
-
fraction: (n, d) => new
|
|
21080
|
+
fraction: (n, d) => new Fraction4(n, d ?? 1),
|
|
20850
21081
|
number: Number,
|
|
20851
21082
|
// Matrix helper factories
|
|
20852
21083
|
createDenseMatrix: (data) => new MathJSDenseMatrix(data),
|
|
@@ -21372,7 +21603,7 @@ var dependencies10 = ["typed", "BigNumber", "complex", "Fraction"];
|
|
|
21372
21603
|
var createSign = /* @__PURE__ */ factory(
|
|
21373
21604
|
name10,
|
|
21374
21605
|
dependencies10,
|
|
21375
|
-
({ typed: typed3, BigNumber: BigNumber9, complex: complex3, Fraction:
|
|
21606
|
+
({ typed: typed3, BigNumber: BigNumber9, complex: complex3, Fraction: Fraction6 }) => {
|
|
21376
21607
|
return typed3(name10, {
|
|
21377
21608
|
number: signNumber,
|
|
21378
21609
|
Complex: function(x) {
|
|
@@ -21385,7 +21616,7 @@ var createSign = /* @__PURE__ */ factory(
|
|
|
21385
21616
|
return x > 0n ? 1n : x < 0n ? -1n : 0n;
|
|
21386
21617
|
},
|
|
21387
21618
|
Fraction: function(x) {
|
|
21388
|
-
return x.n === 0n ? new
|
|
21619
|
+
return x.n === 0n ? new Fraction6(0) : new Fraction6(x.s);
|
|
21389
21620
|
},
|
|
21390
21621
|
// deep map collection, skip zeros since sign(0) = 0
|
|
21391
21622
|
"Array | Matrix": typed3.referToSelf(
|
|
@@ -26861,7 +27092,7 @@ var createCbrt = /* @__PURE__ */ factory(
|
|
|
26861
27092
|
matrix: matrix2,
|
|
26862
27093
|
Complex: Complex13,
|
|
26863
27094
|
BigNumber: BigNumber9,
|
|
26864
|
-
Fraction:
|
|
27095
|
+
Fraction: Fraction6
|
|
26865
27096
|
}) => {
|
|
26866
27097
|
return typed3(name106, {
|
|
26867
27098
|
number: cbrtNumber,
|
|
@@ -26919,7 +27150,7 @@ var createCbrt = /* @__PURE__ */ factory(
|
|
|
26919
27150
|
if (isBigNumber(value)) {
|
|
26920
27151
|
return new BigNumber9(1).div(3);
|
|
26921
27152
|
} else if (isFraction(value)) {
|
|
26922
|
-
return new
|
|
27153
|
+
return new Fraction6(1, 3);
|
|
26923
27154
|
} else {
|
|
26924
27155
|
return 1 / 3;
|
|
26925
27156
|
}
|
|
@@ -27360,7 +27591,7 @@ var dependencies112 = ["typed", "config", "matrix", "BigNumber", "?Fraction"];
|
|
|
27360
27591
|
var createXgcd = /* @__PURE__ */ factory(
|
|
27361
27592
|
name112,
|
|
27362
27593
|
dependencies112,
|
|
27363
|
-
({ typed: typed3, config: config2, matrix: matrix2, BigNumber: BigNumber9, Fraction:
|
|
27594
|
+
({ typed: typed3, config: config2, matrix: matrix2, BigNumber: BigNumber9, Fraction: Fraction6 }) => {
|
|
27364
27595
|
const typedSignatures = {
|
|
27365
27596
|
"number, number": function(a, b) {
|
|
27366
27597
|
const res = xgcdNumber(a, b);
|
|
@@ -27368,7 +27599,7 @@ var createXgcd = /* @__PURE__ */ factory(
|
|
|
27368
27599
|
},
|
|
27369
27600
|
"BigNumber, BigNumber": _xgcdBigNumber
|
|
27370
27601
|
};
|
|
27371
|
-
if (
|
|
27602
|
+
if (Fraction6) {
|
|
27372
27603
|
typedSignatures["Fraction, Fraction"] = _xgcdFraction;
|
|
27373
27604
|
}
|
|
27374
27605
|
return typed3(name112, typedSignatures);
|
|
@@ -27406,14 +27637,14 @@ var createXgcd = /* @__PURE__ */ factory(
|
|
|
27406
27637
|
return config2.matrix === "Array" ? res : matrix2(res);
|
|
27407
27638
|
}
|
|
27408
27639
|
function _xgcdFraction(a, b) {
|
|
27409
|
-
if (!
|
|
27640
|
+
if (!Fraction6) {
|
|
27410
27641
|
throw new Error("Fraction is not available");
|
|
27411
27642
|
}
|
|
27412
27643
|
let t;
|
|
27413
27644
|
let q;
|
|
27414
27645
|
let r;
|
|
27415
|
-
const zero = new
|
|
27416
|
-
const one = new
|
|
27646
|
+
const zero = new Fraction6(0);
|
|
27647
|
+
const one = new Fraction6(1);
|
|
27417
27648
|
let x = zero;
|
|
27418
27649
|
let lastx = one;
|
|
27419
27650
|
let y = one;
|
|
@@ -28147,7 +28378,7 @@ var createBernoulli = /* @__PURE__ */ factory(
|
|
|
28147
28378
|
isInteger: _isInteger,
|
|
28148
28379
|
number: number2,
|
|
28149
28380
|
BigNumber: BigNumber9,
|
|
28150
|
-
Fraction:
|
|
28381
|
+
Fraction: Fraction6
|
|
28151
28382
|
}) => {
|
|
28152
28383
|
const numberCache = [void 0];
|
|
28153
28384
|
const fractionCache = [void 0];
|
|
@@ -28164,7 +28395,7 @@ var createBernoulli = /* @__PURE__ */ factory(
|
|
|
28164
28395
|
),
|
|
28165
28396
|
"bigint | Fraction": (index) => _bernoulli(
|
|
28166
28397
|
number2(index),
|
|
28167
|
-
(n) => new
|
|
28398
|
+
(n) => new Fraction6(n),
|
|
28168
28399
|
fractionCache,
|
|
28169
28400
|
(a, b) => a.add(b),
|
|
28170
28401
|
(a, b) => a.mul(b),
|
|
@@ -31009,7 +31240,7 @@ var createCompare = /* @__PURE__ */ factory(
|
|
|
31009
31240
|
equalScalar: equalScalar3,
|
|
31010
31241
|
matrix: matrix2,
|
|
31011
31242
|
BigNumber: BigNumber9,
|
|
31012
|
-
Fraction:
|
|
31243
|
+
Fraction: Fraction6,
|
|
31013
31244
|
DenseMatrix: DenseMatrix7,
|
|
31014
31245
|
concat: concat3
|
|
31015
31246
|
}) => {
|
|
@@ -31037,7 +31268,7 @@ var createCompare = /* @__PURE__ */ factory(
|
|
|
31037
31268
|
return x === y ? 0n : x > y ? 1n : -1n;
|
|
31038
31269
|
},
|
|
31039
31270
|
"Fraction, Fraction": function(x, y) {
|
|
31040
|
-
return new
|
|
31271
|
+
return new Fraction6(x.compare(y));
|
|
31041
31272
|
},
|
|
31042
31273
|
"Complex, Complex": function() {
|
|
31043
31274
|
throw new TypeError("No ordering relation is defined for complex numbers");
|
|
@@ -31713,8 +31944,8 @@ var createInvmod = /* @__PURE__ */ factory(
|
|
|
31713
31944
|
if (equal2(b, 0)) throw new Error("Divisor must be non zero");
|
|
31714
31945
|
const res = xgcd2(a, b);
|
|
31715
31946
|
const resVal = res.valueOf();
|
|
31716
|
-
const [
|
|
31717
|
-
if (!equal2(
|
|
31947
|
+
const [gcd3, invValue] = resVal;
|
|
31948
|
+
if (!equal2(gcd3, 1)) return NaN;
|
|
31718
31949
|
let inv3 = mod3(invValue, b);
|
|
31719
31950
|
if (smaller2(inv3, 0)) inv3 = add5(inv3, b);
|
|
31720
31951
|
return inv3;
|
|
@@ -32055,9 +32286,9 @@ var createPinv = /* @__PURE__ */ factory(
|
|
|
32055
32286
|
return M;
|
|
32056
32287
|
}
|
|
32057
32288
|
function _rankFact(mat, rows, cols) {
|
|
32058
|
-
const
|
|
32059
|
-
const C = mat.map((row2) => row2.filter((_, j) => j < rows && !_isZero(dot9(
|
|
32060
|
-
const F =
|
|
32289
|
+
const rref2 = _rref(mat, rows, cols);
|
|
32290
|
+
const C = mat.map((row2) => row2.filter((_, j) => j < rows && !_isZero(dot9(rref2[j], rref2[j]))));
|
|
32291
|
+
const F = rref2.filter((_, i) => !_isZero(dot9(rref2[i], rref2[i])));
|
|
32061
32292
|
return { C, F };
|
|
32062
32293
|
}
|
|
32063
32294
|
function _isZero(x) {
|
|
@@ -35173,33 +35404,33 @@ var dependencies203 = ["typed", "Unit"];
|
|
|
35173
35404
|
var createCreateUnit = /* @__PURE__ */ factory(
|
|
35174
35405
|
name203,
|
|
35175
35406
|
dependencies203,
|
|
35176
|
-
({ typed: typed3, Unit:
|
|
35407
|
+
({ typed: typed3, Unit: Unit3 }) => {
|
|
35177
35408
|
return typed3(name203, {
|
|
35178
35409
|
// General function signature. First parameter is an object where each property is the definition of a new unit. The object keys are the unit names and the values are the definitions. The values can be objects, strings, or Units. If a property is an empty object or an empty string, a new base unit is created. The second parameter is the options.
|
|
35179
35410
|
"Object, Object": function(obj, options) {
|
|
35180
|
-
return
|
|
35411
|
+
return Unit3.createUnit(obj, options);
|
|
35181
35412
|
},
|
|
35182
35413
|
// Same as above but without the options.
|
|
35183
35414
|
Object: function(obj) {
|
|
35184
|
-
return
|
|
35415
|
+
return Unit3.createUnit(obj, {});
|
|
35185
35416
|
},
|
|
35186
35417
|
// Shortcut method for creating one unit.
|
|
35187
35418
|
"string, Unit | string | Object, Object": function(name254, def, options) {
|
|
35188
35419
|
const obj = {};
|
|
35189
35420
|
obj[name254] = def;
|
|
35190
|
-
return
|
|
35421
|
+
return Unit3.createUnit(obj, options);
|
|
35191
35422
|
},
|
|
35192
35423
|
// Same as above but without the options.
|
|
35193
35424
|
"string, Unit | string | Object": function(name254, def) {
|
|
35194
35425
|
const obj = {};
|
|
35195
35426
|
obj[name254] = def;
|
|
35196
|
-
return
|
|
35427
|
+
return Unit3.createUnit(obj, {});
|
|
35197
35428
|
},
|
|
35198
35429
|
// Without a definition, creates a base unit.
|
|
35199
35430
|
string: function(name254) {
|
|
35200
35431
|
const obj = {};
|
|
35201
35432
|
obj[name254] = {};
|
|
35202
|
-
return
|
|
35433
|
+
return Unit3.createUnit(obj, {});
|
|
35203
35434
|
}
|
|
35204
35435
|
});
|
|
35205
35436
|
}
|
|
@@ -35211,22 +35442,22 @@ var dependencies204 = ["typed", "Unit"];
|
|
|
35211
35442
|
var createUnitFunction = /* @__PURE__ */ factory(
|
|
35212
35443
|
name204,
|
|
35213
35444
|
dependencies204,
|
|
35214
|
-
({ typed: typed3, Unit:
|
|
35445
|
+
({ typed: typed3, Unit: Unit3 }) => {
|
|
35215
35446
|
return typed3(name204, {
|
|
35216
35447
|
Unit: function(x) {
|
|
35217
35448
|
return x.clone();
|
|
35218
35449
|
},
|
|
35219
35450
|
string: function(x) {
|
|
35220
|
-
if (
|
|
35221
|
-
return new
|
|
35451
|
+
if (Unit3.isValuelessUnit(x)) {
|
|
35452
|
+
return new Unit3(null, x);
|
|
35222
35453
|
}
|
|
35223
|
-
return
|
|
35454
|
+
return Unit3.parse(x, { allowNoUnits: true });
|
|
35224
35455
|
},
|
|
35225
35456
|
"number | BigNumber | Fraction | Complex, string | Unit": function(value, unit2) {
|
|
35226
|
-
return new
|
|
35457
|
+
return new Unit3(value, unit2);
|
|
35227
35458
|
},
|
|
35228
35459
|
"number | BigNumber | Fraction": function(value) {
|
|
35229
|
-
return new
|
|
35460
|
+
return new Unit3(value);
|
|
35230
35461
|
},
|
|
35231
35462
|
"Array | Matrix": typed3.referToSelf(
|
|
35232
35463
|
(self) => (x) => deepMap(x, self)
|
|
@@ -42614,9 +42845,9 @@ function unitFactory(name254, valueStr, unitStr) {
|
|
|
42614
42845
|
return factory(
|
|
42615
42846
|
name254,
|
|
42616
42847
|
dependencies254,
|
|
42617
|
-
({ config: config2, Unit:
|
|
42848
|
+
({ config: config2, Unit: Unit3, BigNumber: BigNumber9 }) => {
|
|
42618
42849
|
const value = config2.number === "BigNumber" ? new BigNumber9(valueStr) : parseFloat(valueStr);
|
|
42619
|
-
const unit2 = new
|
|
42850
|
+
const unit2 = new Unit3(value, unitStr);
|
|
42620
42851
|
unit2.fixPrefix = true;
|
|
42621
42852
|
return unit2;
|
|
42622
42853
|
}
|
|
@@ -43559,18 +43790,64 @@ var mathScope = {
|
|
|
43559
43790
|
}
|
|
43560
43791
|
}
|
|
43561
43792
|
var parse = factoryScope.parse;
|
|
43562
|
-
var
|
|
43563
|
-
|
|
43564
|
-
|
|
43793
|
+
var _evaluate = createEvaluate(parse, mathScope);
|
|
43794
|
+
var ELEMENTARY_CHARGE_COULOMB = 1602176634e-28;
|
|
43795
|
+
function elementaryChargeUnit() {
|
|
43796
|
+
return new Unit2(ELEMENTARY_CHARGE_COULOMB, "C");
|
|
43797
|
+
}
|
|
43798
|
+
function isMapScope(scope) {
|
|
43799
|
+
const candidate = scope;
|
|
43800
|
+
return typeof candidate.has === "function" && typeof candidate.get === "function" && typeof candidate.set === "function";
|
|
43801
|
+
}
|
|
43802
|
+
function physicsScope(scope) {
|
|
43803
|
+
const charge = elementaryChargeUnit();
|
|
43804
|
+
if (scope == null) return { e: charge };
|
|
43805
|
+
if (isMapScope(scope)) {
|
|
43806
|
+
if (scope.has("e")) return scope;
|
|
43807
|
+
return {
|
|
43808
|
+
has(key2) {
|
|
43809
|
+
return key2 === "e" || scope.has(key2);
|
|
43810
|
+
},
|
|
43811
|
+
get(key2) {
|
|
43812
|
+
return key2 === "e" ? charge : scope.get(key2);
|
|
43813
|
+
},
|
|
43814
|
+
set(key2, value) {
|
|
43815
|
+
scope.set(key2, value);
|
|
43816
|
+
}
|
|
43817
|
+
};
|
|
43818
|
+
}
|
|
43819
|
+
if (Object.prototype.hasOwnProperty.call(scope, "e")) return scope;
|
|
43820
|
+
return { e: charge, ...scope };
|
|
43821
|
+
}
|
|
43822
|
+
function evaluate(exprOrExprs, scope, options) {
|
|
43823
|
+
const bound = options?.physics === true ? physicsScope(scope) : scope;
|
|
43824
|
+
const inner = options?.unsafe === true ? { unsafe: true } : void 0;
|
|
43825
|
+
if (Array.isArray(exprOrExprs)) return _evaluate(exprOrExprs, bound, inner);
|
|
43826
|
+
return _evaluate(exprOrExprs, bound, inner);
|
|
43827
|
+
}
|
|
43828
|
+
function compileExpr(expr, options) {
|
|
43829
|
+
const compiled = _compileExpression(
|
|
43830
|
+
parse,
|
|
43831
|
+
mathScope,
|
|
43832
|
+
expr,
|
|
43833
|
+
options?.unsafe === true ? { unsafe: true } : void 0
|
|
43834
|
+
);
|
|
43835
|
+
if (options?.physics !== true) return compiled;
|
|
43836
|
+
return {
|
|
43837
|
+
evaluate(scope) {
|
|
43838
|
+
return compiled.evaluate(physicsScope(scope));
|
|
43839
|
+
}
|
|
43840
|
+
};
|
|
43565
43841
|
}
|
|
43566
|
-
function parser() {
|
|
43842
|
+
function parser(options) {
|
|
43567
43843
|
const scope = {};
|
|
43844
|
+
const callOptions = options?.physics === true || options?.unsafe === true ? { physics: options.physics, unsafe: options.unsafe } : void 0;
|
|
43568
43845
|
return {
|
|
43569
43846
|
/** The live scope object — assignments during `evaluate` land here. */
|
|
43570
43847
|
scope,
|
|
43571
43848
|
/** Evaluate an expression against the retained scope. */
|
|
43572
43849
|
evaluate(expr) {
|
|
43573
|
-
return evaluate(expr, scope);
|
|
43850
|
+
return evaluate(expr, scope, callOptions);
|
|
43574
43851
|
},
|
|
43575
43852
|
/** Read a retained variable. */
|
|
43576
43853
|
get(name254) {
|
|
@@ -43605,7 +43882,7 @@ function reviver(_key, value) {
|
|
|
43605
43882
|
case "Complex":
|
|
43606
43883
|
return Complex9.fromJSON(tagged);
|
|
43607
43884
|
case "Fraction":
|
|
43608
|
-
return
|
|
43885
|
+
return Fraction5.fromJSON(tagged);
|
|
43609
43886
|
case "number":
|
|
43610
43887
|
if (tagged.value === "Infinity") return Infinity;
|
|
43611
43888
|
if (tagged.value === "-Infinity") return -Infinity;
|
|
@@ -45144,6 +45421,89 @@ function config(options) {
|
|
|
45144
45421
|
return { ...shared };
|
|
45145
45422
|
}
|
|
45146
45423
|
|
|
45424
|
+
// src/numeric/propagate-uncertainty.ts
|
|
45425
|
+
function asFiniteNumber(label, value) {
|
|
45426
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
45427
|
+
throw new TypeError(`${label} is not a finite number`);
|
|
45428
|
+
}
|
|
45429
|
+
return value;
|
|
45430
|
+
}
|
|
45431
|
+
function partialDerivative2(expr, name254, values) {
|
|
45432
|
+
const node = derivative2(expr, name254);
|
|
45433
|
+
return asFiniteNumber(`partial of "${expr}" with respect to "${name254}"`, node.evaluate(values));
|
|
45434
|
+
}
|
|
45435
|
+
function propagateUncertainty(expr, values, sigmas, options) {
|
|
45436
|
+
if (typeof expr !== "string" || expr.length === 0) {
|
|
45437
|
+
throw new TypeError("expr must be a non-empty string");
|
|
45438
|
+
}
|
|
45439
|
+
if (values === null || typeof values !== "object") {
|
|
45440
|
+
throw new TypeError("values must be an object of finite numbers");
|
|
45441
|
+
}
|
|
45442
|
+
const names = Object.keys(values);
|
|
45443
|
+
const point = {};
|
|
45444
|
+
for (const name254 of names) {
|
|
45445
|
+
point[name254] = asFiniteNumber(`values.${name254}`, values[name254]);
|
|
45446
|
+
}
|
|
45447
|
+
const covariance = options?.covariance;
|
|
45448
|
+
if (covariance !== void 0 && sigmas !== void 0) {
|
|
45449
|
+
throw new TypeError("pass either sigmas or covariance, not both");
|
|
45450
|
+
}
|
|
45451
|
+
if (sigmas !== void 0 && (sigmas === null || typeof sigmas !== "object")) {
|
|
45452
|
+
throw new TypeError("sigmas must be an object of finite numbers");
|
|
45453
|
+
}
|
|
45454
|
+
const partials = {};
|
|
45455
|
+
const gradient2 = [];
|
|
45456
|
+
for (const name254 of names) {
|
|
45457
|
+
const d = partialDerivative2(expr, name254, point);
|
|
45458
|
+
partials[name254] = d;
|
|
45459
|
+
gradient2.push(d);
|
|
45460
|
+
}
|
|
45461
|
+
const value = asFiniteNumber(`value of "${expr}"`, evaluate(expr, point));
|
|
45462
|
+
let variance2;
|
|
45463
|
+
if (covariance !== void 0) {
|
|
45464
|
+
const n = names.length;
|
|
45465
|
+
if (covariance.length !== n) {
|
|
45466
|
+
throw new TypeError(`covariance must be ${n}\xD7${n} to match values`);
|
|
45467
|
+
}
|
|
45468
|
+
variance2 = 0;
|
|
45469
|
+
for (let i = 0; i < n; i++) {
|
|
45470
|
+
const row2 = covariance[i];
|
|
45471
|
+
if (row2 === void 0 || row2.length !== n) {
|
|
45472
|
+
throw new TypeError(`covariance must be ${n}\xD7${n} to match values`);
|
|
45473
|
+
}
|
|
45474
|
+
let acc = 0;
|
|
45475
|
+
for (let j = 0; j < n; j++) {
|
|
45476
|
+
const sij = asFiniteNumber(`covariance[${i}][${j}]`, row2[j]);
|
|
45477
|
+
acc += sij * gradient2[j];
|
|
45478
|
+
}
|
|
45479
|
+
variance2 += gradient2[i] * acc;
|
|
45480
|
+
}
|
|
45481
|
+
} else {
|
|
45482
|
+
variance2 = 0;
|
|
45483
|
+
if (sigmas !== void 0) {
|
|
45484
|
+
for (const key2 of Object.keys(sigmas)) {
|
|
45485
|
+
if (!Object.prototype.hasOwnProperty.call(point, key2)) {
|
|
45486
|
+
throw new TypeError(`sigmas.${key2} has no matching value`);
|
|
45487
|
+
}
|
|
45488
|
+
}
|
|
45489
|
+
for (let i = 0; i < names.length; i++) {
|
|
45490
|
+
const name254 = names[i];
|
|
45491
|
+
if (!Object.prototype.hasOwnProperty.call(sigmas, name254)) continue;
|
|
45492
|
+
const sigma = asFiniteNumber(`sigmas.${name254}`, sigmas[name254]);
|
|
45493
|
+
if (sigma < 0) {
|
|
45494
|
+
throw new RangeError(`sigmas.${name254} must be >= 0`);
|
|
45495
|
+
}
|
|
45496
|
+
variance2 += (gradient2[i] * sigma) ** 2;
|
|
45497
|
+
}
|
|
45498
|
+
}
|
|
45499
|
+
}
|
|
45500
|
+
if (variance2 < 0) {
|
|
45501
|
+
if (variance2 > -1e-12) variance2 = 0;
|
|
45502
|
+
else throw new RangeError("covariance produced a negative variance");
|
|
45503
|
+
}
|
|
45504
|
+
return { value, sigma: Math.sqrt(variance2), partials };
|
|
45505
|
+
}
|
|
45506
|
+
|
|
45147
45507
|
// src/help.ts
|
|
45148
45508
|
import { createHelpClass, embeddedDocs } from "@danielsimonjr/mathts-expression";
|
|
45149
45509
|
var savedConfig = {};
|
|
@@ -49457,8 +49817,8 @@ function intToRatPoly(p) {
|
|
|
49457
49817
|
}
|
|
49458
49818
|
function ratPolyToInt(p) {
|
|
49459
49819
|
if (p.length === 0) return { poly: [], den: 1n };
|
|
49460
|
-
let
|
|
49461
|
-
const
|
|
49820
|
+
let lcm3 = 1n;
|
|
49821
|
+
const gcd3 = (a, b) => {
|
|
49462
49822
|
let x = a < 0n ? -a : a;
|
|
49463
49823
|
let y = b < 0n ? -b : b;
|
|
49464
49824
|
while (y !== 0n) {
|
|
@@ -49469,10 +49829,10 @@ function ratPolyToInt(p) {
|
|
|
49469
49829
|
return x;
|
|
49470
49830
|
};
|
|
49471
49831
|
for (const r of p) {
|
|
49472
|
-
const g =
|
|
49473
|
-
|
|
49832
|
+
const g = gcd3(lcm3, r.den);
|
|
49833
|
+
lcm3 = lcm3 / g * r.den;
|
|
49474
49834
|
}
|
|
49475
|
-
return { poly: trim(p.map((r) => r.num *
|
|
49835
|
+
return { poly: trim(p.map((r) => r.num * lcm3 / r.den)), den: lcm3 };
|
|
49476
49836
|
}
|
|
49477
49837
|
function rpAdd(a, b) {
|
|
49478
49838
|
const n = Math.max(a.length, b.length);
|
|
@@ -55276,6 +55636,10 @@ export {
|
|
|
55276
55636
|
DIST_WORKER_THRESHOLD,
|
|
55277
55637
|
EARTH_RADIUS_KM,
|
|
55278
55638
|
GAUSS_WORKER_THRESHOLD,
|
|
55639
|
+
GL4ConvergenceError,
|
|
55640
|
+
GL4_A,
|
|
55641
|
+
GL4_B,
|
|
55642
|
+
GL4_C,
|
|
55279
55643
|
GPU_ELEMENTWISE_OPS,
|
|
55280
55644
|
GPU_MIN_ELEMENTS2 as GPU_MIN_ELEMENTS,
|
|
55281
55645
|
GPU_REDUCE_OPS,
|
|
@@ -55698,6 +56062,7 @@ export {
|
|
|
55698
56062
|
gammainc,
|
|
55699
56063
|
gammaincp,
|
|
55700
56064
|
gasConstant,
|
|
56065
|
+
gaussLegendre4,
|
|
55701
56066
|
gaussQuad,
|
|
55702
56067
|
gaussianKDE,
|
|
55703
56068
|
gaussianProcessRegression,
|
|
@@ -56040,6 +56405,7 @@ export {
|
|
|
56040
56405
|
permutationTest,
|
|
56041
56406
|
permutations,
|
|
56042
56407
|
permutationsGen,
|
|
56408
|
+
physicsScope,
|
|
56043
56409
|
pickRandom,
|
|
56044
56410
|
piecewise,
|
|
56045
56411
|
pinv,
|
|
@@ -56079,6 +56445,7 @@ export {
|
|
|
56079
56445
|
procrustes,
|
|
56080
56446
|
prod,
|
|
56081
56447
|
projectVector,
|
|
56448
|
+
propagateUncertainty,
|
|
56082
56449
|
proportionCI,
|
|
56083
56450
|
proportionZTest,
|
|
56084
56451
|
protonMass,
|
|
@@ -56107,6 +56474,7 @@ export {
|
|
|
56107
56474
|
range,
|
|
56108
56475
|
rank,
|
|
56109
56476
|
rankdata,
|
|
56477
|
+
rationalNullspace,
|
|
56110
56478
|
rationalize,
|
|
56111
56479
|
rayPlaneIntersect,
|
|
56112
56480
|
rayTriangleIntersect,
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symplectic Gauss–Legendre 4th-order ODE integrator.
|
|
3
|
+
*
|
|
4
|
+
* Two-stage implicit Runge–Kutta collocation on the roots of the shifted
|
|
5
|
+
* Legendre polynomial P₂ (order 4, stage order 2). The Butcher tableau is
|
|
6
|
+
* the one in Hairer, Lubich, and Wanner, *Geometric Numerical Integration*
|
|
7
|
+
* §II.1, and it satisfies the Sanz-Serna 1988 symplecticity condition
|
|
8
|
+
* `b_i a_ij + b_j a_ji = b_i b_j`. That is what keeps a Hamiltonian's
|
|
9
|
+
* energy error bounded instead of drifting.
|
|
10
|
+
*
|
|
11
|
+
* This is an ODE solver (`y' = f(t, y)`). It is not Gauss–Legendre
|
|
12
|
+
* quadrature — that function is `gaussQuad`.
|
|
13
|
+
*
|
|
14
|
+
* The stage equations
|
|
15
|
+
*
|
|
16
|
+
* Y_i = y_n + h Σ_j a_ij f(t_n + c_j h, Y_j)
|
|
17
|
+
*
|
|
18
|
+
* are solved by Picard iteration. A step that does not contract throws
|
|
19
|
+
* {@link GL4ConvergenceError}; shrink `h` (or raise `steps`) or raise
|
|
20
|
+
* `picardMaxIter`.
|
|
21
|
+
*
|
|
22
|
+
* @packageDocumentation
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* GL4 nodes `c₁ = ½ − √3/6`, `c₂ = ½ + √3/6`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const GL4_C: readonly [number, number];
|
|
28
|
+
/**
|
|
29
|
+
* GL4 Butcher matrix
|
|
30
|
+
*
|
|
31
|
+
* [ 1/4 1/4 − √3/6 ]
|
|
32
|
+
* [ 1/4 + √3/6 1/4 ]
|
|
33
|
+
*/
|
|
34
|
+
export declare const GL4_A: readonly [readonly [number, number], readonly [number, number]];
|
|
35
|
+
/**
|
|
36
|
+
* GL4 weights `b₁ = b₂ = ½`.
|
|
37
|
+
*/
|
|
38
|
+
export declare const GL4_B: readonly [number, number];
|
|
39
|
+
/**
|
|
40
|
+
* Thrown when Picard iteration on a GL4 step does not reach `picardTol`
|
|
41
|
+
* within `picardMaxIter`. The message matches `/Picard iteration did not converge/`.
|
|
42
|
+
*/
|
|
43
|
+
export declare class GL4ConvergenceError extends Error {
|
|
44
|
+
constructor(message?: string);
|
|
45
|
+
}
|
|
46
|
+
/** Options for {@link gaussLegendre4}. */
|
|
47
|
+
export interface GaussLegendre4Options {
|
|
48
|
+
/**
|
|
49
|
+
* Positive step size. The span is split into equal steps of size at most
|
|
50
|
+
* `h` that land on `tspan[1]`. Ignored when `steps` is set.
|
|
51
|
+
*/
|
|
52
|
+
h?: number;
|
|
53
|
+
/** Number of equal steps across `tspan`. Takes precedence over `h`. */
|
|
54
|
+
steps?: number;
|
|
55
|
+
/** Infinity-norm tolerance on successive Picard iterates (default `1e-12`). */
|
|
56
|
+
picardTol?: number;
|
|
57
|
+
/** Picard iteration cap per step (default `64`). */
|
|
58
|
+
picardMaxIter?: number;
|
|
59
|
+
}
|
|
60
|
+
/** Time grid and states, same shape as `solveODESystem`. */
|
|
61
|
+
export interface GaussLegendre4Solution {
|
|
62
|
+
t: number[];
|
|
63
|
+
y: number[][];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Integrate `y' = f(t, y)` with the 2-stage Gauss–Legendre method.
|
|
67
|
+
*
|
|
68
|
+
* @param f - Right-hand side. Must return a vector the same length as `y`.
|
|
69
|
+
* @param y0 - Initial state (non-empty, finite).
|
|
70
|
+
* @param tspan - `[t0, t1]`. `t1` may be less than `t0`.
|
|
71
|
+
* @param options - Step control and Picard tolerances. With neither `steps`
|
|
72
|
+
* nor `h`, the span is split into 100 equal steps.
|
|
73
|
+
*/
|
|
74
|
+
export declare function gaussLegendre4(f: (t: number, y: readonly number[]) => readonly number[], y0: readonly number[], tspan: readonly [number, number], options?: GaussLegendre4Options): GaussLegendre4Solution;
|
|
75
|
+
//# sourceMappingURL=gauss-legendre4.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gauss-legendre4.d.ts","sourceRoot":"","sources":["../../src/numeric/gauss-legendre4.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAA4C,CAAC;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAGjF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAc,CAAC;AAE3D;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAO,SAAsC,EAGxD;CACF;AAED,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,4DAA4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACf;AAUD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,EAAE,EACzD,EAAE,EAAE,SAAS,MAAM,EAAE,EACrB,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,sBAAsB,CA2GxB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-order (linear) uncertainty propagation for scalar expressions.
|
|
3
|
+
*
|
|
4
|
+
* For `f` and inputs `x` with covariance `Σ`,
|
|
5
|
+
*
|
|
6
|
+
* σ² = ∇f(x)ᵀ Σ ∇f(x)
|
|
7
|
+
*
|
|
8
|
+
* Partials come from the symbolic {@link derivative}, then are evaluated at
|
|
9
|
+
* `values`. Independent inputs are the shorthand `Σ = diag(σᵢ²)`; pass
|
|
10
|
+
* `options.covariance` for a full matrix, in `Object.keys(values)` order.
|
|
11
|
+
* Supplying both `sigmas` and `covariance` is rejected.
|
|
12
|
+
*
|
|
13
|
+
* This is the linear (delta-method) term only. It does not add a curvature
|
|
14
|
+
* correction, and it does not depend on the autograd package.
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
*/
|
|
18
|
+
/** Result of {@link propagateUncertainty}. */
|
|
19
|
+
export interface UncertaintyPropagationResult {
|
|
20
|
+
/** `f` evaluated at `values`. */
|
|
21
|
+
readonly value: number;
|
|
22
|
+
/** First-order standard deviation `√(∇fᵀ Σ ∇f)`. */
|
|
23
|
+
readonly sigma: number;
|
|
24
|
+
/** `∂f/∂xᵢ` at `values`, keyed by the names in `values`. */
|
|
25
|
+
readonly partials: Readonly<Record<string, number>>;
|
|
26
|
+
}
|
|
27
|
+
/** Options for {@link propagateUncertainty}. */
|
|
28
|
+
export interface UncertaintyPropagationOptions {
|
|
29
|
+
/**
|
|
30
|
+
* Covariance of the inputs, row/column order matching `Object.keys(values)`.
|
|
31
|
+
* When this is set, `sigmas` must be omitted.
|
|
32
|
+
*/
|
|
33
|
+
covariance?: ReadonlyArray<ReadonlyArray<number>>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Propagate input uncertainty through a scalar expression to first order.
|
|
37
|
+
*
|
|
38
|
+
* @param expr - Expression in the names of `values` (for example `'x * y'`).
|
|
39
|
+
* @param values - Point at which `f` and `∇f` are evaluated.
|
|
40
|
+
* @param sigmas - Independent 1σ uncertainties, keyed like `values`. Omitted
|
|
41
|
+
* keys contribute no variance. Do not pass this together with
|
|
42
|
+
* `options.covariance`.
|
|
43
|
+
* @param options - Full covariance, in place of `sigmas`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function propagateUncertainty(expr: string, values: Readonly<Record<string, number>>, sigmas?: Readonly<Record<string, number>>, options?: UncertaintyPropagationOptions): UncertaintyPropagationResult;
|
|
46
|
+
//# sourceMappingURL=propagate-uncertainty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propagate-uncertainty.d.ts","sourceRoot":"","sources":["../../src/numeric/propagate-uncertainty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,8CAA8C;AAC9C,MAAM,WAAW,4BAA4B;IAC3C,iCAAiC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD;AAED,gDAAgD;AAChD,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;CACnD;AAkBD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACxC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,OAAO,CAAC,EAAE,6BAA6B,GACtC,4BAA4B,CA8E9B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact rational null space.
|
|
3
|
+
*
|
|
4
|
+
* The numeric `nullspace` reduces with floating-point pivots and a 1e-10 cutoff.
|
|
5
|
+
* Dimensional analysis (Buckingham-π) needs the null space of a matrix of small
|
|
6
|
+
* rational exponents, where that cutoff can drop a real pivot or return a basis
|
|
7
|
+
* that is only approximately dimensionless. This routine reduces over
|
|
8
|
+
* {@link Fraction} (bigint numerator and denominator) and returns an integer
|
|
9
|
+
* basis: each vector is scaled to content 1, and its first nonzero entry is
|
|
10
|
+
* positive. That is the same normalization the Buckingham-π enumerator uses.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
import { Fraction } from '@danielsimonjr/mathts-core';
|
|
15
|
+
/** One exact null-space basis of a rational matrix. */
|
|
16
|
+
export interface RationalNullspaceResult {
|
|
17
|
+
/**
|
|
18
|
+
* Basis vectors, one per free column, in increasing column order.
|
|
19
|
+
* Each entry is an integer {@link Fraction} (denominator 1).
|
|
20
|
+
*/
|
|
21
|
+
readonly basis: Fraction[][];
|
|
22
|
+
/** Rank of the matrix: the number of nonzero rows after exact RREF. */
|
|
23
|
+
readonly rank: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Exact null space of a matrix with rational entries.
|
|
27
|
+
*
|
|
28
|
+
* Numbers are converted with {@link Fraction.fromNumber} (continued fraction,
|
|
29
|
+
* denominator at most 10^6). Pass {@link Fraction} entries when the exponent
|
|
30
|
+
* is already an exact ratio, such as `1/3`.
|
|
31
|
+
*
|
|
32
|
+
* The numeric {@link nullspace} is unchanged. This function does not replace it.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // period, length, gravity — one dimensionless group T² · g / L
|
|
37
|
+
* rationalNullspace([
|
|
38
|
+
* [0, 1, 1],
|
|
39
|
+
* [1, 0, -2],
|
|
40
|
+
* ]);
|
|
41
|
+
* // { rank: 2, basis: [[2, -1, 1]] }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function rationalNullspace(matrix: ReadonlyArray<ReadonlyArray<number | Fraction>>): RationalNullspaceResult;
|
|
45
|
+
//# sourceMappingURL=rational-nullspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rational-nullspace.d.ts","sourceRoot":"","sources":["../../src/numeric/rational-nullspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAElE,uDAAuD;AACvD,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC;IAC7B,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAqFD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,GACtD,uBAAuB,CA+BzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmetic.d.ts","sourceRoot":"","sources":["../../src/typed/arithmetic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA0BH,OAAO,EAAe,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAU1E,4BAA4B;AAC5B,KAAK,GAAG,GAAG,MAAM,CAAC;AAkIlB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,GAAG,oDAgEd,CAAC;AAMH;;GAEG;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,IAAI,CAAC,CAEpD;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAEnD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,GAAG,GAAG,OAAO,CAE5D;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAMD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+E3B,CAAC"}
|
package/dist/typed/numeric.d.ts
CHANGED
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
*/
|
|
13
|
+
export { rationalNullspace, type RationalNullspaceResult } from '../numeric/rational-nullspace.js';
|
|
13
14
|
export { solveParabolicPDE, type SolveParabolicPDEOptions, type ParabolicPDESolution, type ParabolicBC, type SpaceCoefficient, type BoundaryDatum, type ParabolicSource, } from '../numeric/solveParabolicPDE.js';
|
|
14
15
|
export { solveDAE, type SolveDAEOptions, type DAESolution, type DAEDifferential, type DAEConstraint, type DAEJacobianBlocks, } from '../numeric/solveDAE.js';
|
|
15
16
|
export { solveDDE, type SolveDDEOptions, type DDESolution, type DDEForcing, type DDEHistory, } from '../numeric/solveDDE.js';
|
|
17
|
+
export { gaussLegendre4, GL4_A, GL4_B, GL4_C, GL4ConvergenceError, type GaussLegendre4Options, type GaussLegendre4Solution, } from '../numeric/gauss-legendre4.js';
|
|
16
18
|
type f64 = number;
|
|
17
19
|
type i32 = number;
|
|
18
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../../src/typed/numeric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../../src/typed/numeric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,i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,EAAE,MAAM,EAAE,CAAA;CAAE,CA+B9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielsimonjr/mathts-functions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
|
|
5
5
|
"author": "Daniel Simon Jr.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"build:prod": "tsup src/index.ts --format esm --clean --minify --treeshake && tsc -p tsconfig.dts.json && node scripts/copy-wasm.mjs"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@danielsimonjr/mathts-core": "^0.
|
|
38
|
-
"@danielsimonjr/mathts-expression": "^0.
|
|
37
|
+
"@danielsimonjr/mathts-core": "^0.16.0",
|
|
38
|
+
"@danielsimonjr/mathts-expression": "^0.9.0",
|
|
39
39
|
"@danielsimonjr/mathts-gpu": "^0.2.1",
|
|
40
|
-
"@danielsimonjr/mathts-matrix": "^0.7.
|
|
41
|
-
"@danielsimonjr/mathts-parallel": "^0.6.
|
|
40
|
+
"@danielsimonjr/mathts-matrix": "^0.7.6",
|
|
41
|
+
"@danielsimonjr/mathts-parallel": "^0.6.8",
|
|
42
42
|
"bignumber.js": "^11.1.5",
|
|
43
43
|
"complex.js": "^2.2.5",
|
|
44
44
|
"decimal.js": "^10.4.3",
|