@danielsimonjr/mathts-functions 0.66.0 → 0.68.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/README.md +1 -0
- package/dist/factories/evaluate.d.ts +23 -20
- 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 +260 -45
- package/dist/numeric/gauss-legendre4.d.ts +5 -0
- package/dist/numeric/gauss-legendre4.d.ts.map +1 -1
- package/dist/numeric/propagate-uncertainty.d.ts +31 -7
- package/dist/numeric/propagate-uncertainty.d.ts.map +1 -1
- package/dist/numeric/rational-nullspace.d.ts +15 -1
- package/dist/numeric/rational-nullspace.d.ts.map +1 -1
- package/dist/scalar-eval.d.ts +37 -0
- package/dist/scalar-eval.d.ts.map +1 -0
- package/dist/typed/numeric.d.ts +1 -1
- package/dist/typed/numeric.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ npm install @danielsimonjr/mathts-functions
|
|
|
14
14
|
|
|
15
15
|
- Hundreds of typed functions (`add`, `sin`, `svd`-aware ops, `parallelFFT`, …).
|
|
16
16
|
- A wired `parse` / `evaluate` against the full activated math scope.
|
|
17
|
+
- `scalar` / `evaluateScalar` — evaluate a typed scalar tree (`+ - * / ^`, `ln` → natural `log`, `log` → `log10`, and the other scalar calls). A formula string is rejected.
|
|
17
18
|
- Per-domain focused entry points are also published: `@danielsimonjr/mathts-{arithmetic,trigonometry,statistics,signal}`.
|
|
18
19
|
|
|
19
20
|
## License
|
|
@@ -22,6 +22,13 @@ interface Scope {
|
|
|
22
22
|
* typed-function conversion registrations.
|
|
23
23
|
*/
|
|
24
24
|
export declare const parse: Parameters<typeof createEvaluate>[0];
|
|
25
|
+
/**
|
|
26
|
+
* How physics mode binds bare `e`.
|
|
27
|
+
*
|
|
28
|
+
* `unit` is a `Unit` of `1.602176634e-19 C`. `scalar` is that same SI
|
|
29
|
+
* magnitude as a plain number, so `1 - e^2` is ordinary arithmetic.
|
|
30
|
+
*/
|
|
31
|
+
export type PhysicsCharge = 'unit' | 'scalar';
|
|
25
32
|
/**
|
|
26
33
|
* Options for {@link evaluate}, {@link compileExpr}, and {@link parser}.
|
|
27
34
|
*/
|
|
@@ -34,38 +41,33 @@ export interface PhysicsEvaluateOptions {
|
|
|
34
41
|
/**
|
|
35
42
|
* Opt-in physics reading of bare `e`.
|
|
36
43
|
*
|
|
37
|
-
* When `true`, `e` is the elementary charge
|
|
44
|
+
* When `true`, `e` is the elementary charge. The default binding is the
|
|
45
|
+
* Unit `1.602176634e-19 C`. Pass `charge: 'scalar'` for the plain SI
|
|
46
|
+
* magnitude, so a dimensionless formula such as `1 - e^2` can subtract.
|
|
38
47
|
* `E` stays unbound so a formula can use it for energy. Euler's number is
|
|
39
48
|
* only `exp(x)`, for example `exp(1)`. An explicit scope binding for `e`
|
|
40
49
|
* still wins. Default `false`: `e` is Euler's number.
|
|
41
50
|
*/
|
|
42
51
|
physics?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Binding of bare `e` when {@link physics} is `true`. Default `'unit'`.
|
|
54
|
+
* Setting this without `physics: true` throws.
|
|
55
|
+
*/
|
|
56
|
+
charge?: PhysicsCharge;
|
|
57
|
+
}
|
|
58
|
+
/** Options for {@link physicsScope}. */
|
|
59
|
+
export interface PhysicsScopeOptions {
|
|
60
|
+
/** Default `'unit'`. `'scalar'` binds the SI magnitude instead of a Unit. */
|
|
61
|
+
charge?: PhysicsCharge;
|
|
43
62
|
}
|
|
44
63
|
/**
|
|
45
64
|
* Scope in which bare `e` is the elementary charge.
|
|
46
65
|
*
|
|
47
66
|
* Pass the result as `evaluate`'s scope, or use `{ physics: true }`.
|
|
48
67
|
* Entries already present on `scope` win, including an explicit `e`.
|
|
68
|
+
* `{ charge: 'scalar' }` binds the SI magnitude instead of a Unit.
|
|
49
69
|
*/
|
|
50
|
-
export declare function physicsScope(scope?: Record<string, unknown> | Scope): Record<string, unknown> | Scope;
|
|
51
|
-
/**
|
|
52
|
-
* Evaluate a math expression string against the full activated math scope.
|
|
53
|
-
*
|
|
54
|
-
* @param expr - Expression string (e.g., '2 + 3', 'sin(pi/2)', 'x^2')
|
|
55
|
-
* @param scope - Optional variable bindings (e.g., { x: 3 })
|
|
56
|
-
* @param options - Optional flags. `{ physics: true }` reads bare `e` as the elementary charge.
|
|
57
|
-
* @returns The result of evaluating the expression
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```ts
|
|
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
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
70
|
+
export declare function physicsScope(scope?: Record<string, unknown> | Scope, options?: PhysicsScopeOptions): Record<string, unknown> | Scope;
|
|
69
71
|
export declare function evaluate(expr: string, scope?: Record<string, unknown> | Scope, options?: PhysicsEvaluateOptions): unknown;
|
|
70
72
|
export declare function evaluate(exprs: string[], scope?: Record<string, unknown> | Scope, options?: PhysicsEvaluateOptions): unknown[];
|
|
71
73
|
/**
|
|
@@ -84,6 +86,7 @@ export declare function evaluate(exprs: string[], scope?: Record<string, unknown
|
|
|
84
86
|
* compiled.evaluate({ x: 2, y: 1 }); // 5
|
|
85
87
|
* compiled.evaluate({ x: 3, y: 2 }); // 11
|
|
86
88
|
* compileExpr('e', { physics: true }).evaluate(); // 1.602176634e-19 C
|
|
89
|
+
* compileExpr('1 - e^2', { physics: true, charge: 'scalar' }).evaluate(); // near 1
|
|
87
90
|
* ```
|
|
88
91
|
*/
|
|
89
92
|
export declare function compileExpr(expr: string, options?: PhysicsEvaluateOptions): import("@danielsimonjr/mathts-expression").CompiledExpression;
|
|
@@ -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;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,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAqFD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAyB,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAmBhF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB
|
|
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,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAqFD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAyB,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAmBhF;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;O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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
|
@@ -16,7 +16,9 @@ export { loadWasm, isWasmLoaded } from './wasm/WasmLoader.js';
|
|
|
16
16
|
export { to, toBest } from './typed/unit.js';
|
|
17
17
|
export { evaluate, compileExpr, parse, parser, physicsScope, reviver, replacer, } from './factories/evaluate.js';
|
|
18
18
|
export type { PhysicsEvaluateOptions } from './factories/evaluate.js';
|
|
19
|
-
export {
|
|
19
|
+
export { evaluateScalar, scalar, ScalarEvalError } from './scalar-eval.js';
|
|
20
|
+
export type { ScalarScope } from './scalar-eval.js';
|
|
21
|
+
export { propagateUncertainty, type UncertaintyExpression, type UncertaintyPropagationOptions, type UncertaintyPropagationResult, } from './numeric/propagate-uncertainty.js';
|
|
20
22
|
export { help } from './help.js';
|
|
21
23
|
export { continuedFraction, eulerNumbers, stirlingS1, discreteLog, primitiveRoot, multiplicativeOrder, kroneckerSymbol, permutationsGen, combinationsGen, } from './numbertheory/extra.js';
|
|
22
24
|
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,sBAAsB,CAAC;AAO9D,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MA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,OAAO,EACL,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,MAAM,+BAA+B,CAAC;AAKvC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAK7E,OAAO,EAAE,MAAM,EAAE,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
|
@@ -1559,12 +1559,12 @@ var multiply = mathTyped2("multiply", {
|
|
|
1559
1559
|
return result.result;
|
|
1560
1560
|
},
|
|
1561
1561
|
// Parallel scalar multiplication (scale)
|
|
1562
|
-
"Float64Array, number": async (a,
|
|
1563
|
-
const result = await computePool.scale(a,
|
|
1562
|
+
"Float64Array, number": async (a, scalar2) => {
|
|
1563
|
+
const result = await computePool.scale(a, scalar2);
|
|
1564
1564
|
return result.result;
|
|
1565
1565
|
},
|
|
1566
|
-
"number, Float64Array": async (
|
|
1567
|
-
const result = await computePool.scale(a,
|
|
1566
|
+
"number, Float64Array": async (scalar2, a) => {
|
|
1567
|
+
const result = await computePool.scale(a, scalar2);
|
|
1568
1568
|
return result.result;
|
|
1569
1569
|
},
|
|
1570
1570
|
// Scalar × collection = element-wise scaling (mathjs parity). Matrix × matrix
|
|
@@ -5981,13 +5981,13 @@ ${deps.map((d) => d.toString()).join("\n")}
|
|
|
5981
5981
|
return (${body});
|
|
5982
5982
|
})()`;
|
|
5983
5983
|
}
|
|
5984
|
-
async function mapArray(x,
|
|
5984
|
+
async function mapArray(x, scalar2, buildKernel) {
|
|
5985
5985
|
if (computePool6.shouldParallelize(x.length)) {
|
|
5986
5986
|
const r = await computePool6.applyKernel(x, buildKernel());
|
|
5987
5987
|
return r.result;
|
|
5988
5988
|
}
|
|
5989
5989
|
const out = new Float64Array(x.length);
|
|
5990
|
-
for (let i = 0; i < x.length; i++) out[i] =
|
|
5990
|
+
for (let i = 0; i < x.length; i++) out[i] = scalar2(x[i]);
|
|
5991
5991
|
return out;
|
|
5992
5992
|
}
|
|
5993
5993
|
|
|
@@ -7710,7 +7710,7 @@ var WGSL_REDUCE = {
|
|
|
7710
7710
|
min: { identity: "pos_inf()", combine: "min(a, b)" }
|
|
7711
7711
|
};
|
|
7712
7712
|
function wgslForReduce(r) {
|
|
7713
|
-
const { identity: identity2, combine:
|
|
7713
|
+
const { identity: identity2, combine: combine3 } = WGSL_REDUCE[r];
|
|
7714
7714
|
return `
|
|
7715
7715
|
@group(0) @binding(0) var<storage, read> inp: array<f32>;
|
|
7716
7716
|
@group(0) @binding(1) var<storage, read_write> partials: array<f32>;
|
|
@@ -7722,7 +7722,7 @@ function wgslForReduce(r) {
|
|
|
7722
7722
|
var<workgroup> sdata: array<f32, ${WORKGROUP_SIZE2}>;
|
|
7723
7723
|
|
|
7724
7724
|
fn identity() -> f32 { return ${identity2}; }
|
|
7725
|
-
fn combine(a: f32, b: f32) -> f32 { return ${
|
|
7725
|
+
fn combine(a: f32, b: f32) -> f32 { return ${combine3}; }
|
|
7726
7726
|
|
|
7727
7727
|
@compute @workgroup_size(${WORKGROUP_SIZE2})
|
|
7728
7728
|
fn main(@builtin(global_invocation_id) gid: vec3<u32>,
|
|
@@ -14198,9 +14198,26 @@ function rref(matrix2) {
|
|
|
14198
14198
|
}
|
|
14199
14199
|
return pivotCols;
|
|
14200
14200
|
}
|
|
14201
|
-
function rationalNullspace(matrix2) {
|
|
14202
|
-
if (matrix2.length === 0)
|
|
14201
|
+
function rationalNullspace(matrix2, options) {
|
|
14202
|
+
if (matrix2.length === 0) {
|
|
14203
|
+
const cols2 = options?.columns ?? 0;
|
|
14204
|
+
if (!Number.isInteger(cols2) || cols2 < 0) {
|
|
14205
|
+
throw new TypeError("rationalNullspace: columns must be a non-negative integer");
|
|
14206
|
+
}
|
|
14207
|
+
const basis2 = [];
|
|
14208
|
+
for (let free = 0; free < cols2; free++) {
|
|
14209
|
+
const vec = [];
|
|
14210
|
+
for (let j = 0; j < cols2; j++) vec.push(new Fraction2(j === free ? 1n : 0n, 1n));
|
|
14211
|
+
basis2.push(vec);
|
|
14212
|
+
}
|
|
14213
|
+
return { basis: basis2, rank: 0 };
|
|
14214
|
+
}
|
|
14203
14215
|
const cols = matrix2[0].length;
|
|
14216
|
+
if (options?.columns !== void 0 && options.columns !== cols) {
|
|
14217
|
+
throw new TypeError(
|
|
14218
|
+
`rationalNullspace: columns ${options.columns} does not match row length ${cols}`
|
|
14219
|
+
);
|
|
14220
|
+
}
|
|
14204
14221
|
for (let i = 0; i < matrix2.length; i++) {
|
|
14205
14222
|
if (!Array.isArray(matrix2[i]) || matrix2[i].length !== cols) {
|
|
14206
14223
|
throw new TypeError(
|
|
@@ -14832,7 +14849,7 @@ function gaussLegendre4(f, y0, tspan, options) {
|
|
|
14832
14849
|
throw new TypeError("picardMaxIter must be a positive integer");
|
|
14833
14850
|
}
|
|
14834
14851
|
if (t0 === t1) {
|
|
14835
|
-
return { t: [t0], y: [y0.slice()] };
|
|
14852
|
+
return { t: [t0], y: [y0.slice()], iterations: [] };
|
|
14836
14853
|
}
|
|
14837
14854
|
const span = t1 - t0;
|
|
14838
14855
|
let nSteps;
|
|
@@ -14862,14 +14879,17 @@ function gaussLegendre4(f, y0, tspan, options) {
|
|
|
14862
14879
|
const b1 = GL4_B[1];
|
|
14863
14880
|
const t = [t0];
|
|
14864
14881
|
const y = [y0.slice()];
|
|
14882
|
+
const iterations = [];
|
|
14865
14883
|
let tn = t0;
|
|
14866
14884
|
let yn = y0.slice();
|
|
14867
14885
|
for (let step = 0; step < nSteps; step++) {
|
|
14868
14886
|
let Y0 = yn.slice();
|
|
14869
14887
|
let Y1 = yn.slice();
|
|
14870
14888
|
let converged = false;
|
|
14889
|
+
let used = 0;
|
|
14871
14890
|
const next = new Array(n);
|
|
14872
14891
|
for (let iter = 0; iter < picardMaxIter; iter++) {
|
|
14892
|
+
used = iter + 1;
|
|
14873
14893
|
const k0 = f(tn + c0 * h, Y0);
|
|
14874
14894
|
const k1 = f(tn + c1 * h, Y1);
|
|
14875
14895
|
if (k0.length !== n || k1.length !== n) {
|
|
@@ -14907,8 +14927,9 @@ function gaussLegendre4(f, y0, tspan, options) {
|
|
|
14907
14927
|
yn = next;
|
|
14908
14928
|
t.push(tn);
|
|
14909
14929
|
y.push(yn.slice());
|
|
14930
|
+
iterations.push(used);
|
|
14910
14931
|
}
|
|
14911
|
-
return { t, y };
|
|
14932
|
+
return { t, y, iterations };
|
|
14912
14933
|
}
|
|
14913
14934
|
|
|
14914
14935
|
// src/typed/numeric.ts
|
|
@@ -20334,9 +20355,9 @@ async function gpuTranspose(a) {
|
|
|
20334
20355
|
await ensureGpu();
|
|
20335
20356
|
return gpuMatrixBackend.transposeAsync(a);
|
|
20336
20357
|
}
|
|
20337
|
-
async function gpuScale(a,
|
|
20358
|
+
async function gpuScale(a, scalar2) {
|
|
20338
20359
|
await ensureGpu();
|
|
20339
|
-
return gpuMatrixBackend.scaleAsync(a,
|
|
20360
|
+
return gpuMatrixBackend.scaleAsync(a, scalar2);
|
|
20340
20361
|
}
|
|
20341
20362
|
|
|
20342
20363
|
// src/typed/index.ts
|
|
@@ -28072,11 +28093,11 @@ var createResize = /* @__PURE__ */ factory(
|
|
|
28072
28093
|
}
|
|
28073
28094
|
const asMatrix = Array.isArray(x) ? false : config2.matrix !== "Array";
|
|
28074
28095
|
if (sz.length === 0) {
|
|
28075
|
-
let
|
|
28076
|
-
while (Array.isArray(
|
|
28077
|
-
|
|
28096
|
+
let scalar2 = x;
|
|
28097
|
+
while (Array.isArray(scalar2)) {
|
|
28098
|
+
scalar2 = scalar2[0];
|
|
28078
28099
|
}
|
|
28079
|
-
return clone(
|
|
28100
|
+
return clone(scalar2);
|
|
28080
28101
|
} else {
|
|
28081
28102
|
let arr10 = !Array.isArray(x) ? [x] : x;
|
|
28082
28103
|
arr10 = clone(arr10);
|
|
@@ -28792,36 +28813,36 @@ var createMatrixAlgorithmSuite = /* @__PURE__ */ factory(
|
|
|
28792
28813
|
);
|
|
28793
28814
|
}
|
|
28794
28815
|
}
|
|
28795
|
-
const
|
|
28816
|
+
const scalar2 = options.scalar || "any";
|
|
28796
28817
|
const Ds = options.Ds || options.Ss;
|
|
28797
28818
|
if (Ds) {
|
|
28798
28819
|
if (elop) {
|
|
28799
|
-
matrixSignatures["DenseMatrix," +
|
|
28800
|
-
matrixSignatures[
|
|
28801
|
-
matrixSignatures["Array," +
|
|
28820
|
+
matrixSignatures["DenseMatrix," + scalar2] = (x, y) => matAlgo14xDs(x, y, elop, false);
|
|
28821
|
+
matrixSignatures[scalar2 + ", DenseMatrix"] = (x, y) => matAlgo14xDs(y, x, elop, true);
|
|
28822
|
+
matrixSignatures["Array," + scalar2] = (x, y) => matAlgo14xDs(
|
|
28802
28823
|
matrix2(x),
|
|
28803
28824
|
y,
|
|
28804
28825
|
elop,
|
|
28805
28826
|
false
|
|
28806
28827
|
).valueOf();
|
|
28807
|
-
matrixSignatures[
|
|
28828
|
+
matrixSignatures[scalar2 + ", Array"] = (x, y) => matAlgo14xDs(
|
|
28808
28829
|
matrix2(y),
|
|
28809
28830
|
x,
|
|
28810
28831
|
elop,
|
|
28811
28832
|
true
|
|
28812
28833
|
).valueOf();
|
|
28813
28834
|
} else {
|
|
28814
|
-
matrixSignatures["DenseMatrix," +
|
|
28835
|
+
matrixSignatures["DenseMatrix," + scalar2] = typed3.referToSelf(
|
|
28815
28836
|
(self) => (x, y) => {
|
|
28816
28837
|
return matAlgo14xDs(x, y, self, false);
|
|
28817
28838
|
}
|
|
28818
28839
|
);
|
|
28819
|
-
matrixSignatures[
|
|
28840
|
+
matrixSignatures[scalar2 + ", DenseMatrix"] = typed3.referToSelf(
|
|
28820
28841
|
(self) => (x, y) => {
|
|
28821
28842
|
return matAlgo14xDs(y, x, self, true);
|
|
28822
28843
|
}
|
|
28823
28844
|
);
|
|
28824
|
-
matrixSignatures["Array," +
|
|
28845
|
+
matrixSignatures["Array," + scalar2] = typed3.referToSelf(
|
|
28825
28846
|
(self) => (x, y) => {
|
|
28826
28847
|
return matAlgo14xDs(
|
|
28827
28848
|
matrix2(x),
|
|
@@ -28831,7 +28852,7 @@ var createMatrixAlgorithmSuite = /* @__PURE__ */ factory(
|
|
|
28831
28852
|
).valueOf();
|
|
28832
28853
|
}
|
|
28833
28854
|
);
|
|
28834
|
-
matrixSignatures[
|
|
28855
|
+
matrixSignatures[scalar2 + ", Array"] = typed3.referToSelf(
|
|
28835
28856
|
(self) => (x, y) => {
|
|
28836
28857
|
return matAlgo14xDs(
|
|
28837
28858
|
matrix2(y),
|
|
@@ -28846,21 +28867,21 @@ var createMatrixAlgorithmSuite = /* @__PURE__ */ factory(
|
|
|
28846
28867
|
const sS = options.sS !== void 0 ? options.sS : options.Ss;
|
|
28847
28868
|
if (elop) {
|
|
28848
28869
|
if (options.Ss) {
|
|
28849
|
-
matrixSignatures["SparseMatrix," +
|
|
28870
|
+
matrixSignatures["SparseMatrix," + scalar2] = (x, y) => options.Ss(x, y, elop, false);
|
|
28850
28871
|
}
|
|
28851
28872
|
if (sS) {
|
|
28852
|
-
matrixSignatures[
|
|
28873
|
+
matrixSignatures[scalar2 + ", SparseMatrix"] = (x, y) => sS(y, x, elop, true);
|
|
28853
28874
|
}
|
|
28854
28875
|
} else {
|
|
28855
28876
|
if (options.Ss) {
|
|
28856
|
-
matrixSignatures["SparseMatrix," +
|
|
28877
|
+
matrixSignatures["SparseMatrix," + scalar2] = typed3.referToSelf(
|
|
28857
28878
|
(self) => (x, y) => {
|
|
28858
28879
|
return options.Ss(x, y, self, false);
|
|
28859
28880
|
}
|
|
28860
28881
|
);
|
|
28861
28882
|
}
|
|
28862
28883
|
if (sS) {
|
|
28863
|
-
matrixSignatures[
|
|
28884
|
+
matrixSignatures[scalar2 + ", SparseMatrix"] = typed3.referToSelf(
|
|
28864
28885
|
(self) => (x, y) => {
|
|
28865
28886
|
return sS(y, x, self, true);
|
|
28866
28887
|
}
|
|
@@ -43799,8 +43820,11 @@ function isMapScope(scope) {
|
|
|
43799
43820
|
const candidate = scope;
|
|
43800
43821
|
return typeof candidate.has === "function" && typeof candidate.get === "function" && typeof candidate.set === "function";
|
|
43801
43822
|
}
|
|
43802
|
-
function
|
|
43803
|
-
|
|
43823
|
+
function physicsBinding(charge) {
|
|
43824
|
+
return charge === "scalar" ? ELEMENTARY_CHARGE_COULOMB : elementaryChargeUnit();
|
|
43825
|
+
}
|
|
43826
|
+
function physicsScope(scope, options) {
|
|
43827
|
+
const charge = physicsBinding(options?.charge);
|
|
43804
43828
|
if (scope == null) return { e: charge };
|
|
43805
43829
|
if (isMapScope(scope)) {
|
|
43806
43830
|
if (scope.has("e")) return scope;
|
|
@@ -43819,8 +43843,21 @@ function physicsScope(scope) {
|
|
|
43819
43843
|
if (Object.prototype.hasOwnProperty.call(scope, "e")) return scope;
|
|
43820
43844
|
return { e: charge, ...scope };
|
|
43821
43845
|
}
|
|
43846
|
+
function assertPhysicsOptions(options) {
|
|
43847
|
+
if (options?.charge !== void 0 && options.charge !== "unit" && options.charge !== "scalar") {
|
|
43848
|
+
throw new TypeError('charge must be "unit" or "scalar"');
|
|
43849
|
+
}
|
|
43850
|
+
if (options?.physics !== true) {
|
|
43851
|
+
if (options?.charge !== void 0) {
|
|
43852
|
+
throw new TypeError("charge requires { physics: true }");
|
|
43853
|
+
}
|
|
43854
|
+
return void 0;
|
|
43855
|
+
}
|
|
43856
|
+
return { charge: options.charge ?? "unit" };
|
|
43857
|
+
}
|
|
43822
43858
|
function evaluate(exprOrExprs, scope, options) {
|
|
43823
|
-
const
|
|
43859
|
+
const physics = assertPhysicsOptions(options);
|
|
43860
|
+
const bound = physics === void 0 ? scope : physicsScope(scope, physics);
|
|
43824
43861
|
const inner = options?.unsafe === true ? { unsafe: true } : void 0;
|
|
43825
43862
|
if (Array.isArray(exprOrExprs)) return _evaluate(exprOrExprs, bound, inner);
|
|
43826
43863
|
return _evaluate(exprOrExprs, bound, inner);
|
|
@@ -43832,16 +43869,17 @@ function compileExpr(expr, options) {
|
|
|
43832
43869
|
expr,
|
|
43833
43870
|
options?.unsafe === true ? { unsafe: true } : void 0
|
|
43834
43871
|
);
|
|
43835
|
-
|
|
43872
|
+
const physics = assertPhysicsOptions(options);
|
|
43873
|
+
if (physics === void 0) return compiled;
|
|
43836
43874
|
return {
|
|
43837
43875
|
evaluate(scope) {
|
|
43838
|
-
return compiled.evaluate(physicsScope(scope));
|
|
43876
|
+
return compiled.evaluate(physicsScope(scope, physics));
|
|
43839
43877
|
}
|
|
43840
43878
|
};
|
|
43841
43879
|
}
|
|
43842
43880
|
function parser(options) {
|
|
43843
43881
|
const scope = {};
|
|
43844
|
-
const callOptions = options?.physics === true || options?.unsafe === true ? { physics: options
|
|
43882
|
+
const callOptions = options?.physics === true || options?.unsafe === true || options?.charge !== void 0 ? { physics: options?.physics, unsafe: options?.unsafe, charge: options?.charge } : void 0;
|
|
43845
43883
|
return {
|
|
43846
43884
|
/** The live scope object — assignments during `evaluate` land here. */
|
|
43847
43885
|
scope,
|
|
@@ -45421,6 +45459,122 @@ function config(options) {
|
|
|
45421
45459
|
return { ...shared };
|
|
45422
45460
|
}
|
|
45423
45461
|
|
|
45462
|
+
// src/scalar-eval.ts
|
|
45463
|
+
import {
|
|
45464
|
+
ScalarBuildError,
|
|
45465
|
+
createScalarBuilder
|
|
45466
|
+
} from "@danielsimonjr/mathts-expression";
|
|
45467
|
+
var scalar = createScalarBuilder();
|
|
45468
|
+
var ScalarEvalError = class extends Error {
|
|
45469
|
+
constructor(message) {
|
|
45470
|
+
super(message);
|
|
45471
|
+
this.name = "ScalarEvalError";
|
|
45472
|
+
}
|
|
45473
|
+
};
|
|
45474
|
+
var UNARY = {
|
|
45475
|
+
exp,
|
|
45476
|
+
log,
|
|
45477
|
+
log10,
|
|
45478
|
+
log2,
|
|
45479
|
+
sin,
|
|
45480
|
+
cos,
|
|
45481
|
+
tan,
|
|
45482
|
+
sinh,
|
|
45483
|
+
cosh,
|
|
45484
|
+
tanh,
|
|
45485
|
+
abs
|
|
45486
|
+
};
|
|
45487
|
+
var NUMERIC_LITERAL = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
45488
|
+
function requireFinite(value, label) {
|
|
45489
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
45490
|
+
throw new ScalarEvalError(
|
|
45491
|
+
`evaluateScalar: '${label}' produced a non-finite value (${String(value)}).`
|
|
45492
|
+
);
|
|
45493
|
+
}
|
|
45494
|
+
return value;
|
|
45495
|
+
}
|
|
45496
|
+
function resolveSymbol(name254, scope) {
|
|
45497
|
+
if (Object.prototype.hasOwnProperty.call(scope, name254)) {
|
|
45498
|
+
const value = scope[name254];
|
|
45499
|
+
if (typeof value !== "number") {
|
|
45500
|
+
throw new ScalarEvalError(`evaluateScalar: scope['${name254}'] is not a number.`);
|
|
45501
|
+
}
|
|
45502
|
+
return value;
|
|
45503
|
+
}
|
|
45504
|
+
if (NUMERIC_LITERAL.test(name254)) {
|
|
45505
|
+
const literal = Number(name254);
|
|
45506
|
+
if (Number.isFinite(literal)) return literal;
|
|
45507
|
+
}
|
|
45508
|
+
throw new ScalarEvalError(
|
|
45509
|
+
`evaluateScalar: symbol '${name254}' has no value (not in scope, not a numeric literal).`
|
|
45510
|
+
);
|
|
45511
|
+
}
|
|
45512
|
+
function combine2(op, left, right) {
|
|
45513
|
+
switch (op) {
|
|
45514
|
+
case "+":
|
|
45515
|
+
return add(left, right);
|
|
45516
|
+
case "-":
|
|
45517
|
+
return subtract(left, right);
|
|
45518
|
+
case "*":
|
|
45519
|
+
return multiply(left, right);
|
|
45520
|
+
case "/":
|
|
45521
|
+
return divide(left, right);
|
|
45522
|
+
}
|
|
45523
|
+
}
|
|
45524
|
+
function evalOp(op, args, scope) {
|
|
45525
|
+
if (op === "^") {
|
|
45526
|
+
if (args.length !== 2) {
|
|
45527
|
+
throw new ScalarEvalError(`evaluateScalar: '^' needs exactly 2 args, got ${args.length}.`);
|
|
45528
|
+
}
|
|
45529
|
+
const base = evalNode(args[0], scope);
|
|
45530
|
+
const exponent = evalNode(args[1], scope);
|
|
45531
|
+
return requireFinite(pow(base, exponent), "^");
|
|
45532
|
+
}
|
|
45533
|
+
if (args.length === 0) return op === "*" || op === "/" ? 1 : 0;
|
|
45534
|
+
let acc = evalNode(args[0], scope);
|
|
45535
|
+
for (let i = 1; i < args.length; i++) {
|
|
45536
|
+
const right = evalNode(args[i], scope);
|
|
45537
|
+
acc = requireFinite(combine2(op, acc, right), op);
|
|
45538
|
+
}
|
|
45539
|
+
return requireFinite(acc, op);
|
|
45540
|
+
}
|
|
45541
|
+
function evalCall(fn, arg3) {
|
|
45542
|
+
const impl = UNARY[fn];
|
|
45543
|
+
if (impl === void 0) {
|
|
45544
|
+
throw new ScalarEvalError(`evaluateScalar: unknown scalar function '${String(fn)}'.`);
|
|
45545
|
+
}
|
|
45546
|
+
return requireFinite(impl(arg3), fn);
|
|
45547
|
+
}
|
|
45548
|
+
function evalNode(node, scope) {
|
|
45549
|
+
switch (node.kind) {
|
|
45550
|
+
case "number":
|
|
45551
|
+
return node.value;
|
|
45552
|
+
case "symbol":
|
|
45553
|
+
return resolveSymbol(node.name, scope);
|
|
45554
|
+
case "op":
|
|
45555
|
+
return evalOp(node.op, node.args, scope);
|
|
45556
|
+
case "call":
|
|
45557
|
+
return evalCall(node.fn, evalNode(node.arg, scope));
|
|
45558
|
+
}
|
|
45559
|
+
}
|
|
45560
|
+
function normalizeScope(scope) {
|
|
45561
|
+
if (scope === null || typeof scope !== "object" || Array.isArray(scope)) {
|
|
45562
|
+
throw new ScalarEvalError("evaluateScalar: scope must be an object of numbers.");
|
|
45563
|
+
}
|
|
45564
|
+
return scope;
|
|
45565
|
+
}
|
|
45566
|
+
function evaluateScalar(node, scope = {}) {
|
|
45567
|
+
const bound = normalizeScope(scope);
|
|
45568
|
+
let canonical;
|
|
45569
|
+
try {
|
|
45570
|
+
canonical = scalar.from(node);
|
|
45571
|
+
} catch (err) {
|
|
45572
|
+
if (err instanceof ScalarBuildError) throw new ScalarEvalError(err.message);
|
|
45573
|
+
throw err;
|
|
45574
|
+
}
|
|
45575
|
+
return evalNode(canonical, bound);
|
|
45576
|
+
}
|
|
45577
|
+
|
|
45424
45578
|
// src/numeric/propagate-uncertainty.ts
|
|
45425
45579
|
function asFiniteNumber(label, value) {
|
|
45426
45580
|
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
@@ -45432,9 +45586,49 @@ function partialDerivative2(expr, name254, values) {
|
|
|
45432
45586
|
const node = derivative2(expr, name254);
|
|
45433
45587
|
return asFiniteNumber(`partial of "${expr}" with respect to "${name254}"`, node.evaluate(values));
|
|
45434
45588
|
}
|
|
45589
|
+
function centralPartial(f, name254, point, relativeStep) {
|
|
45590
|
+
const x = point[name254];
|
|
45591
|
+
const h = relativeStep * Math.max(Math.abs(x), 1e-30);
|
|
45592
|
+
const plus = asFiniteNumber(
|
|
45593
|
+
`partial of function with respect to "${name254}"`,
|
|
45594
|
+
f({ ...point, [name254]: x + h })
|
|
45595
|
+
);
|
|
45596
|
+
const minus = asFiniteNumber(
|
|
45597
|
+
`partial of function with respect to "${name254}"`,
|
|
45598
|
+
f({ ...point, [name254]: x - h })
|
|
45599
|
+
);
|
|
45600
|
+
return (plus - minus) / (2 * h);
|
|
45601
|
+
}
|
|
45602
|
+
function curvatureRatio(evaluateAt, name254, point, partial, offset, value) {
|
|
45603
|
+
if (!Number.isFinite(offset)) {
|
|
45604
|
+
throw new TypeError(`curvatureOffsets.${name254} is not a finite number`);
|
|
45605
|
+
}
|
|
45606
|
+
const linear = partial * offset;
|
|
45607
|
+
if (linear === 0) return null;
|
|
45608
|
+
let up;
|
|
45609
|
+
let down;
|
|
45610
|
+
try {
|
|
45611
|
+
up = evaluateAt({ ...point, [name254]: point[name254] + offset });
|
|
45612
|
+
down = evaluateAt({ ...point, [name254]: point[name254] - offset });
|
|
45613
|
+
} catch {
|
|
45614
|
+
return null;
|
|
45615
|
+
}
|
|
45616
|
+
if (!Number.isFinite(up) || !Number.isFinite(down)) return null;
|
|
45617
|
+
return Math.abs(up + down - 2 * value) / 2 / Math.abs(linear);
|
|
45618
|
+
}
|
|
45435
45619
|
function propagateUncertainty(expr, values, sigmas, options) {
|
|
45436
|
-
|
|
45437
|
-
|
|
45620
|
+
const isFunction = typeof expr === "function";
|
|
45621
|
+
if (!isFunction && (typeof expr !== "string" || expr.length === 0)) {
|
|
45622
|
+
throw new TypeError("expr must be a non-empty string or a function");
|
|
45623
|
+
}
|
|
45624
|
+
if (options?.relativeStep !== void 0 && !isFunction) {
|
|
45625
|
+
throw new TypeError(
|
|
45626
|
+
"relativeStep applies only to a function; a string uses the symbolic derivative"
|
|
45627
|
+
);
|
|
45628
|
+
}
|
|
45629
|
+
const relativeStep = options?.relativeStep ?? 1e-6;
|
|
45630
|
+
if (isFunction && (!(relativeStep > 0) || !Number.isFinite(relativeStep))) {
|
|
45631
|
+
throw new TypeError("relativeStep must be a positive finite number");
|
|
45438
45632
|
}
|
|
45439
45633
|
if (values === null || typeof values !== "object") {
|
|
45440
45634
|
throw new TypeError("values must be an object of finite numbers");
|
|
@@ -45453,12 +45647,13 @@ function propagateUncertainty(expr, values, sigmas, options) {
|
|
|
45453
45647
|
}
|
|
45454
45648
|
const partials = {};
|
|
45455
45649
|
const gradient2 = [];
|
|
45650
|
+
const call = isFunction ? expr : void 0;
|
|
45456
45651
|
for (const name254 of names) {
|
|
45457
|
-
const d = partialDerivative2(expr, name254, point);
|
|
45652
|
+
const d = call ? centralPartial(call, name254, point, relativeStep) : partialDerivative2(expr, name254, point);
|
|
45458
45653
|
partials[name254] = d;
|
|
45459
45654
|
gradient2.push(d);
|
|
45460
45655
|
}
|
|
45461
|
-
const value = asFiniteNumber(
|
|
45656
|
+
const value = asFiniteNumber("value", call ? call(point) : evaluate(expr, point));
|
|
45462
45657
|
let variance2;
|
|
45463
45658
|
if (covariance !== void 0) {
|
|
45464
45659
|
const n = names.length;
|
|
@@ -45489,11 +45684,11 @@ function propagateUncertainty(expr, values, sigmas, options) {
|
|
|
45489
45684
|
for (let i = 0; i < names.length; i++) {
|
|
45490
45685
|
const name254 = names[i];
|
|
45491
45686
|
if (!Object.prototype.hasOwnProperty.call(sigmas, name254)) continue;
|
|
45492
|
-
const
|
|
45493
|
-
if (
|
|
45687
|
+
const sigma2 = asFiniteNumber(`sigmas.${name254}`, sigmas[name254]);
|
|
45688
|
+
if (sigma2 < 0) {
|
|
45494
45689
|
throw new RangeError(`sigmas.${name254} must be >= 0`);
|
|
45495
45690
|
}
|
|
45496
|
-
variance2 += (gradient2[i] *
|
|
45691
|
+
variance2 += (gradient2[i] * sigma2) ** 2;
|
|
45497
45692
|
}
|
|
45498
45693
|
}
|
|
45499
45694
|
}
|
|
@@ -45501,7 +45696,24 @@ function propagateUncertainty(expr, values, sigmas, options) {
|
|
|
45501
45696
|
if (variance2 > -1e-12) variance2 = 0;
|
|
45502
45697
|
else throw new RangeError("covariance produced a negative variance");
|
|
45503
45698
|
}
|
|
45504
|
-
|
|
45699
|
+
const sigma = Math.sqrt(variance2);
|
|
45700
|
+
const offsets = options?.curvatureOffsets;
|
|
45701
|
+
if (offsets === void 0) return { value, sigma, partials };
|
|
45702
|
+
if (offsets === null || typeof offsets !== "object") {
|
|
45703
|
+
throw new TypeError("curvatureOffsets must be an object of finite numbers");
|
|
45704
|
+
}
|
|
45705
|
+
const evaluateAt = (at) => {
|
|
45706
|
+
if (call) return call(at);
|
|
45707
|
+
return asFiniteNumber("curvature probe", evaluate(expr, at));
|
|
45708
|
+
};
|
|
45709
|
+
const curvature = {};
|
|
45710
|
+
for (const name254 of Object.keys(offsets)) {
|
|
45711
|
+
if (!Object.prototype.hasOwnProperty.call(point, name254)) {
|
|
45712
|
+
throw new TypeError(`curvatureOffsets.${name254} has no matching value`);
|
|
45713
|
+
}
|
|
45714
|
+
curvature[name254] = curvatureRatio(evaluateAt, name254, point, partials[name254], offsets[name254], value);
|
|
45715
|
+
}
|
|
45716
|
+
return { value, sigma, partials, curvature };
|
|
45505
45717
|
}
|
|
45506
45718
|
|
|
45507
45719
|
// src/help.ts
|
|
@@ -55644,6 +55856,7 @@ export {
|
|
|
55644
55856
|
GPU_MIN_ELEMENTS2 as GPU_MIN_ELEMENTS,
|
|
55645
55857
|
GPU_REDUCE_OPS,
|
|
55646
55858
|
Interval,
|
|
55859
|
+
ScalarEvalError,
|
|
55647
55860
|
WASM_INTERP_THRESHOLD,
|
|
55648
55861
|
abs,
|
|
55649
55862
|
acf,
|
|
@@ -55929,6 +56142,7 @@ export {
|
|
|
55929
56142
|
eulerNumbers,
|
|
55930
56143
|
eulerPhi,
|
|
55931
56144
|
evaluate,
|
|
56145
|
+
evaluateScalar,
|
|
55932
56146
|
eventDetection,
|
|
55933
56147
|
ewma,
|
|
55934
56148
|
exp,
|
|
@@ -56515,6 +56729,7 @@ export {
|
|
|
56515
56729
|
rydberg,
|
|
56516
56730
|
sackurTetrode,
|
|
56517
56731
|
savgol,
|
|
56732
|
+
scalar,
|
|
56518
56733
|
schur,
|
|
56519
56734
|
sec,
|
|
56520
56735
|
secant,
|
|
@@ -61,6 +61,11 @@ export interface GaussLegendre4Options {
|
|
|
61
61
|
export interface GaussLegendre4Solution {
|
|
62
62
|
t: number[];
|
|
63
63
|
y: number[][];
|
|
64
|
+
/**
|
|
65
|
+
* Picard iterations consumed on each completed step. Empty when `tspan`
|
|
66
|
+
* has no width. One entry per step, in step order.
|
|
67
|
+
*/
|
|
68
|
+
iterations: number[];
|
|
64
69
|
}
|
|
65
70
|
/**
|
|
66
71
|
* Integrate `y' = f(t, y)` with the 2-stage Gauss–Legendre method.
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"gauss-legendre4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16 +5,22 @@
|
|
|
5
5
|
*
|
|
6
6
|
* σ² = ∇f(x)ᵀ Σ ∇f(x)
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* A string expression takes partials from the symbolic {@link derivative}.
|
|
9
|
+
* A function takes central differences
|
|
10
|
+
* `h = relativeStep · max(|xᵢ|, 1e-30)` (default `relativeStep` is `1e-6`).
|
|
11
|
+
* Independent inputs are the shorthand `Σ = diag(σᵢ²)`; pass
|
|
10
12
|
* `options.covariance` for a full matrix, in `Object.keys(values)` order.
|
|
11
13
|
* Supplying both `sigmas` and `covariance` is rejected.
|
|
12
14
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
+
* `options.curvatureOffsets` reports the second-difference ratio
|
|
16
|
+
* `|f(x+u) + f(x−u) − 2f(x)| / 2 / |∂f/∂x · u|` and does not fold it into
|
|
17
|
+
* `sigma`. This is the linear (delta-method) term only. It does not depend
|
|
18
|
+
* on the autograd package.
|
|
15
19
|
*
|
|
16
20
|
* @packageDocumentation
|
|
17
21
|
*/
|
|
22
|
+
/** A scalar expression, or a black-box map of the same names. */
|
|
23
|
+
export type UncertaintyExpression = string | ((values: Record<string, number>) => number);
|
|
18
24
|
/** Result of {@link propagateUncertainty}. */
|
|
19
25
|
export interface UncertaintyPropagationResult {
|
|
20
26
|
/** `f` evaluated at `values`. */
|
|
@@ -23,6 +29,11 @@ export interface UncertaintyPropagationResult {
|
|
|
23
29
|
readonly sigma: number;
|
|
24
30
|
/** `∂f/∂xᵢ` at `values`, keyed by the names in `values`. */
|
|
25
31
|
readonly partials: Readonly<Record<string, number>>;
|
|
32
|
+
/**
|
|
33
|
+
* Present only when `curvatureOffsets` was passed. `null` means the probe
|
|
34
|
+
* left the domain or the linear term was zero.
|
|
35
|
+
*/
|
|
36
|
+
readonly curvature?: Readonly<Record<string, number | null>>;
|
|
26
37
|
}
|
|
27
38
|
/** Options for {@link propagateUncertainty}. */
|
|
28
39
|
export interface UncertaintyPropagationOptions {
|
|
@@ -31,16 +42,29 @@ export interface UncertaintyPropagationOptions {
|
|
|
31
42
|
* When this is set, `sigmas` must be omitted.
|
|
32
43
|
*/
|
|
33
44
|
covariance?: ReadonlyArray<ReadonlyArray<number>>;
|
|
45
|
+
/**
|
|
46
|
+
* Relative central-difference step for a function:
|
|
47
|
+
* `h = relativeStep * max(|x|, 1e-30)`. Default `1e-6`.
|
|
48
|
+
* A string expression uses the symbolic derivative and rejects this option.
|
|
49
|
+
*/
|
|
50
|
+
relativeStep?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Offsets `uᵢ` for the second-difference ratio, keyed like `values`.
|
|
53
|
+
* The ratio is reported on {@link UncertaintyPropagationResult.curvature}
|
|
54
|
+
* and is not added into `sigma`.
|
|
55
|
+
*/
|
|
56
|
+
curvatureOffsets?: Readonly<Record<string, number>>;
|
|
34
57
|
}
|
|
35
58
|
/**
|
|
36
59
|
* Propagate input uncertainty through a scalar expression to first order.
|
|
37
60
|
*
|
|
38
|
-
* @param expr - Expression in the names of `values` (for example `'x * y'`)
|
|
61
|
+
* @param expr - Expression in the names of `values` (for example `'x * y'`),
|
|
62
|
+
* or a function of that same record.
|
|
39
63
|
* @param values - Point at which `f` and `∇f` are evaluated.
|
|
40
64
|
* @param sigmas - Independent 1σ uncertainties, keyed like `values`. Omitted
|
|
41
65
|
* keys contribute no variance. Do not pass this together with
|
|
42
66
|
* `options.covariance`.
|
|
43
|
-
* @param options - Full covariance,
|
|
67
|
+
* @param options - Full covariance, a finite-difference step, or curvature probes.
|
|
44
68
|
*/
|
|
45
|
-
export declare function propagateUncertainty(expr:
|
|
69
|
+
export declare function propagateUncertainty(expr: UncertaintyExpression, values: Readonly<Record<string, number>>, sigmas?: Readonly<Record<string, number>>, options?: UncertaintyPropagationOptions): UncertaintyPropagationResult;
|
|
46
70
|
//# sourceMappingURL=propagate-uncertainty.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagate-uncertainty.d.ts","sourceRoot":"","sources":["../../src/numeric/propagate-uncertainty.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"propagate-uncertainty.d.ts","sourceRoot":"","sources":["../../src/numeric/propagate-uncertainty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,iEAAiE;AACjE,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,CAAC;AAE1F,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;IACpD;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CAC9D;AAED,gDAAgD;AAChD,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAClD;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD;AA8DD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,qBAAqB,EAC3B,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,CA4G9B"}
|
|
@@ -12,6 +12,16 @@
|
|
|
12
12
|
* @packageDocumentation
|
|
13
13
|
*/
|
|
14
14
|
import { Fraction } from '@danielsimonjr/mathts-core';
|
|
15
|
+
/** Options for {@link rationalNullspace}. */
|
|
16
|
+
export interface RationalNullspaceOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Column count of a matrix that has no rows. A `0×n` matrix (every row
|
|
19
|
+
* was dropped because it was zero) has null-space dimension `n`: the
|
|
20
|
+
* standard basis. An empty array does not record `n`, so pass `columns`.
|
|
21
|
+
* When the matrix has a row, `columns` must match that row length.
|
|
22
|
+
*/
|
|
23
|
+
columns?: number;
|
|
24
|
+
}
|
|
15
25
|
/** One exact null-space basis of a rational matrix. */
|
|
16
26
|
export interface RationalNullspaceResult {
|
|
17
27
|
/**
|
|
@@ -31,6 +41,10 @@ export interface RationalNullspaceResult {
|
|
|
31
41
|
*
|
|
32
42
|
* The numeric {@link nullspace} is unchanged. This function does not replace it.
|
|
33
43
|
*
|
|
44
|
+
* A matrix with no rows is the null space of a `0×n` system only when
|
|
45
|
+
* `options.columns` is `n`. With no `columns`, an empty array stays
|
|
46
|
+
* `{ basis: [], rank: 0 }`.
|
|
47
|
+
*
|
|
34
48
|
* @example
|
|
35
49
|
* ```ts
|
|
36
50
|
* // period, length, gravity — one dimensionless group T² · g / L
|
|
@@ -41,5 +55,5 @@ export interface RationalNullspaceResult {
|
|
|
41
55
|
* // { rank: 2, basis: [[2, -1, 1]] }
|
|
42
56
|
* ```
|
|
43
57
|
*/
|
|
44
|
-
export declare function rationalNullspace(matrix: ReadonlyArray<ReadonlyArray<number | Fraction
|
|
58
|
+
export declare function rationalNullspace(matrix: ReadonlyArray<ReadonlyArray<number | Fraction>>, options?: RationalNullspaceOptions): RationalNullspaceResult;
|
|
45
59
|
//# sourceMappingURL=rational-nullspace.d.ts.map
|
|
@@ -1 +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
|
|
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,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,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;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,EACvD,OAAO,CAAC,EAAE,wBAAwB,GACjC,uBAAuB,CAgDzB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluate a scalar node with MathTS numeric functions.
|
|
3
|
+
*
|
|
4
|
+
* {@link scalar} is a {@link createScalarBuilder} instance. {@link evaluateScalar}
|
|
5
|
+
* normalizes a typed tree (builder nodes, or `symbol` / `op` / `transcendental`
|
|
6
|
+
* / `abs`) and evaluates it. A formula string is rejected.
|
|
7
|
+
*
|
|
8
|
+
* Symbol lookup is the caller scope, then a decimal literal spelling of the
|
|
9
|
+
* name (`'2'`, `'-1'`, `'1e-3'`). Names such as `pi`, `e`, `c`, and `6pi` are
|
|
10
|
+
* unresolved unless the scope supplies them.
|
|
11
|
+
*
|
|
12
|
+
* `+ - * /` fold left to right. An empty `*` or `/` is 1; an empty `+` or `-`
|
|
13
|
+
* is 0. A single-argument `+ - * /` returns that argument. `^` requires two
|
|
14
|
+
* arguments and calls MathTS `pow`. One-argument `-` does not negate; a
|
|
15
|
+
* unary minus is `(-1) * x`.
|
|
16
|
+
*
|
|
17
|
+
* A non-finite operator or call result throws {@link ScalarEvalError}. A bare
|
|
18
|
+
* symbol or number is returned as stored, including a non-finite value.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
22
|
+
/** Scope for {@link evaluateScalar}. Caller bindings win over literal names. */
|
|
23
|
+
export type ScalarScope = Readonly<Record<string, number>>;
|
|
24
|
+
/** The shared scalar builder. `ln` lowers to natural `log`; `log` lowers to `log10`. */
|
|
25
|
+
export declare const scalar: import("@danielsimonjr/mathts-expression").ScalarBuilder;
|
|
26
|
+
/** A scalar node could not be evaluated. */
|
|
27
|
+
export declare class ScalarEvalError extends Error {
|
|
28
|
+
constructor(message: string);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Evaluate `node` with MathTS scalar functions.
|
|
32
|
+
*
|
|
33
|
+
* `node` may be a builder node or a typed `symbol` / `op` / `transcendental` /
|
|
34
|
+
* `abs` tree. `scalar.from` normalizes it first.
|
|
35
|
+
*/
|
|
36
|
+
export declare function evaluateScalar(node: unknown, scope?: ScalarScope): number;
|
|
37
|
+
//# sourceMappingURL=scalar-eval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalar-eval.d.ts","sourceRoot":"","sources":["../src/scalar-eval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AA0BH,gFAAgF;AAChF,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3D,wFAAwF;AACxF,eAAO,MAAM,MAAM,0DAAwB,CAAC;AAE5C,4CAA4C;AAC5C,qBAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAwGD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,GAAE,WAAgB,GAAG,MAAM,CAU7E"}
|
package/dist/typed/numeric.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
*/
|
|
13
|
-
export { rationalNullspace, type RationalNullspaceResult } from '../numeric/rational-nullspace.js';
|
|
13
|
+
export { rationalNullspace, type RationalNullspaceOptions, type RationalNullspaceResult, } from '../numeric/rational-nullspace.js';
|
|
14
14
|
export { solveParabolicPDE, type SolveParabolicPDEOptions, type ParabolicPDESolution, type ParabolicBC, type SpaceCoefficient, type BoundaryDatum, type ParabolicSource, } from '../numeric/solveParabolicPDE.js';
|
|
15
15
|
export { solveDAE, type SolveDAEOptions, type DAESolution, type DAEDifferential, type DAEConstraint, type DAEJacobianBlocks, } from '../numeric/solveDAE.js';
|
|
16
16
|
export { solveDDE, type SolveDDEOptions, type DDESolution, type DDEForcing, type DDEHistory, } from '../numeric/solveDDE.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../../src/typed/numeric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../../src/typed/numeric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EACL,iBAAiB,EACjB,KAAK,wB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AC,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.68.0",
|
|
4
4
|
"description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
|
|
5
5
|
"author": "Daniel Simon Jr.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@danielsimonjr/mathts-core": "^0.16.0",
|
|
38
|
-
"@danielsimonjr/mathts-expression": "^0.
|
|
38
|
+
"@danielsimonjr/mathts-expression": "^0.10.0",
|
|
39
39
|
"@danielsimonjr/mathts-gpu": "^0.2.1",
|
|
40
40
|
"@danielsimonjr/mathts-matrix": "^0.7.6",
|
|
41
41
|
"@danielsimonjr/mathts-parallel": "^0.6.8",
|