@danielsimonjr/mathts-functions 0.41.0 → 0.43.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/error/DimensionError.d.ts +11 -12
- package/dist/error/DimensionError.d.ts.map +1 -1
- package/dist/error/IndexError.d.ts +13 -19
- package/dist/error/IndexError.d.ts.map +1 -1
- package/dist/factories/index.d.ts.map +1 -1
- package/dist/factories/matrix-bridge.d.ts +1 -1
- package/dist/factories/scope.d.ts +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +736 -1341
- package/dist/numeric/bspline.d.ts +47 -0
- package/dist/numeric/bspline.d.ts.map +1 -0
- package/dist/numeric/monte-carlo.d.ts +40 -0
- package/dist/numeric/monte-carlo.d.ts.map +1 -0
- package/dist/special/niche.d.ts +139 -0
- package/dist/special/niche.d.ts.map +1 -0
- package/dist/typed/arithmetic.d.ts.map +1 -1
- package/dist/typed/bitwise.d.ts +1 -1
- package/dist/typed/probability.d.ts +2 -2
- package/dist/typed/relational.d.ts +3 -3
- package/dist/typed/string.d.ts +3 -3
- package/dist/typed/typed-bridge.d.ts +1 -1
- package/dist/utils/array.d.ts +20 -237
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/collection.d.ts +12 -64
- package/dist/utils/collection.d.ts.map +1 -1
- package/dist/utils/factory.d.ts +42 -53
- package/dist/utils/factory.d.ts.map +1 -1
- package/dist/utils/map.d.ts +30 -103
- package/dist/utils/map.d.ts.map +1 -1
- package/dist/utils/string.d.ts +15 -59
- package/dist/utils/string.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/error/MathjsError.d.ts +0 -13
- package/dist/error/MathjsError.d.ts.map +0 -1
- package/dist/utils/bignumber/formatter.d.ts +0 -136
- package/dist/utils/bignumber/formatter.d.ts.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
type f64 = number;
|
|
2
|
+
type i32 = number;
|
|
3
|
+
/** Options for {@link bsplineFit}. */
|
|
4
|
+
export interface BSplineFitOptions {
|
|
5
|
+
/** Spline degree (default 3, cubic). */
|
|
6
|
+
k?: i32;
|
|
7
|
+
/** Smoothing factor. `0` (default) fits an interpolating spline that
|
|
8
|
+
* passes through every data point exactly. `s > 0` requests a
|
|
9
|
+
* least-squares smoothing spline with fewer basis functions than data
|
|
10
|
+
* points — the number of interior knots shrinks roughly in proportion to
|
|
11
|
+
* `s`. Use `nknots` to control the knot count directly instead. */
|
|
12
|
+
s?: f64;
|
|
13
|
+
/** Explicit number of interior knots for a smoothing fit (used whenever
|
|
14
|
+
* `s > 0`, or set this directly with `s` left at 0). Overrides the
|
|
15
|
+
* `s`-derived heuristic. */
|
|
16
|
+
nknots?: i32;
|
|
17
|
+
}
|
|
18
|
+
/** A fitted B-spline in scipy's `tck` tuple shape: knot vector `t`,
|
|
19
|
+
* coefficients `c`, and degree `k`. */
|
|
20
|
+
export interface BSplineTuple {
|
|
21
|
+
t: f64[];
|
|
22
|
+
c: f64[];
|
|
23
|
+
k: i32;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Fit a B-spline of degree `k` (default cubic) to data `(x, y)`, returned
|
|
27
|
+
* in scipy's `tck` tuple shape `{ t, c, k }`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const xs = Array.from({ length: 15 }, (_, i) => (i * 2 * Math.PI) / 14);
|
|
31
|
+
* const ys = xs.map(Math.sin);
|
|
32
|
+
* const tck = bsplineFit(xs, ys); // cubic interpolating spline (s=0)
|
|
33
|
+
* bsplineEval(tck, xs[3]); // === ys[3] exactly (interpolation)
|
|
34
|
+
*/
|
|
35
|
+
export declare function bsplineFit(x: readonly f64[], y: readonly f64[], opts?: BSplineFitOptions): BSplineTuple;
|
|
36
|
+
/**
|
|
37
|
+
* Evaluate a fitted B-spline (de Boor's algorithm) at one point or an array
|
|
38
|
+
* of points.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* bsplineEval(bsplineFit(xs, ys), 1.0); // spline value at x=1
|
|
42
|
+
* bsplineEval(bsplineFit(xs, ys), [1, 2, 3]); // vectorized
|
|
43
|
+
*/
|
|
44
|
+
export declare function bsplineEval(spline: BSplineTuple, xnew: f64): f64;
|
|
45
|
+
export declare function bsplineEval(spline: BSplineTuple, xnew: readonly f64[]): f64[];
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=bspline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bspline.d.ts","sourceRoot":"","sources":["../../src/numeric/bspline.ts"],"names":[],"mappings":"AAgCA,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,GAAG,GAAG,MAAM,CAAC;AAElB,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,CAAC,CAAC,EAAE,GAAG,CAAC;IACR;;;;uEAImE;IACnE,CAAC,CAAC,EAAE,GAAG,CAAC;IACR;;gCAE4B;IAC5B,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED;uCACuC;AACvC,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,GAAG,EAAE,CAAC;IACT,CAAC,EAAE,GAAG,EAAE,CAAC;IACT,CAAC,EAAE,GAAG,CAAC;CACR;AAmED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,SAAS,GAAG,EAAE,EACjB,CAAC,EAAE,SAAS,GAAG,EAAE,EACjB,IAAI,GAAE,iBAAsB,GAC3B,YAAY,CAgDd;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;AAClE,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type f64 = number;
|
|
2
|
+
type i32 = number;
|
|
3
|
+
/** An axis-aligned integration bound `[lo, hi]`. */
|
|
4
|
+
export type Bound = readonly [f64, f64];
|
|
5
|
+
/** Options for {@link monteCarloIntegrate}. */
|
|
6
|
+
export interface MonteCarloOptions {
|
|
7
|
+
/** Number of sample points (default 1e5). */
|
|
8
|
+
n?: i32;
|
|
9
|
+
/** Sampling method (default `'uniform'`). */
|
|
10
|
+
method?: 'uniform' | 'halton' | 'sobol';
|
|
11
|
+
/** Seed for the deterministic RNG, `method: 'uniform'` only (reproducible
|
|
12
|
+
* draws). Omit for a time-seeded, non-reproducible generator. */
|
|
13
|
+
seed?: string | number;
|
|
14
|
+
}
|
|
15
|
+
/** Result of {@link monteCarloIntegrate}. */
|
|
16
|
+
export interface MonteCarloResult {
|
|
17
|
+
/** The estimated integral. */
|
|
18
|
+
estimate: f64;
|
|
19
|
+
/** Standard error of `estimate` (uniform MC only; 0 for QMC methods —
|
|
20
|
+
* see the module doc). */
|
|
21
|
+
stderr: f64;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Estimate `∫ f` over the axis-aligned box `bounds` (one `[lo, hi]` pair
|
|
25
|
+
* per dimension) by Monte-Carlo or quasi-Monte-Carlo sampling.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* monteCarloIntegrate((x) => x[0] ** 2, [[0, 1]], { n: 1e5, seed: 42 });
|
|
29
|
+
* // estimate ~ 1/3, stderr ~ 6e-4
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // unit-disk area via the indicator function, ~ pi
|
|
33
|
+
* monteCarloIntegrate((x) => (x[0] ** 2 + x[1] ** 2 <= 1 ? 1 : 0), [
|
|
34
|
+
* [-1, 1],
|
|
35
|
+
* [-1, 1],
|
|
36
|
+
* ]);
|
|
37
|
+
*/
|
|
38
|
+
export declare function monteCarloIntegrate(f: (x: f64[]) => f64, bounds: readonly Bound[], opts?: MonteCarloOptions): MonteCarloResult;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=monte-carlo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monte-carlo.d.ts","sourceRoot":"","sources":["../../src/numeric/monte-carlo.ts"],"names":[],"mappings":"AAqCA,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,GAAG,GAAG,MAAM,CAAC;AAElB,oDAAoD;AACpD,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAExC,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,CAAC,CAAC,EAAE,GAAG,CAAC;IACR,6CAA6C;IAC7C,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC;qEACiE;IACjE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAC/B,8BAA8B;IAC9B,QAAQ,EAAE,GAAG,CAAC;IACd;8BAC0B;IAC1B,MAAM,EAAE,GAAG,CAAC;CACb;AA2GD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,GAAG,EACpB,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,IAAI,GAAE,iBAAsB,GAC3B,gBAAgB,CA0ClB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Niche special functions: polylogarithm, Struve H/L, Kelvin ber/bei (order
|
|
3
|
+
* 0), and the Barnes G-function.
|
|
4
|
+
*
|
|
5
|
+
* These are lower-traffic special functions with narrower validity domains
|
|
6
|
+
* than the Bessel/Airy/elliptic families in `typed/special.ts`. They follow
|
|
7
|
+
* the same plain-exported-function pattern as `hypergeometric.ts` and
|
|
8
|
+
* `polygamma-orthopoly.ts` — pure `number -> number` (or `number, number ->
|
|
9
|
+
* number`) math, no typed-function array/WASM dispatch overloads.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
/** 64-bit float (default for decimals) */
|
|
14
|
+
type f64 = number;
|
|
15
|
+
/**
|
|
16
|
+
* Polylogarithm Li_s(z), computed via its defining series (DLMF 25.12.10):
|
|
17
|
+
*
|
|
18
|
+
* Li_s(z) = sum_{k=1}^inf z^k / k^s
|
|
19
|
+
*
|
|
20
|
+
* which converges for `|z| < 1` (any real `s`). Analytic continuation to
|
|
21
|
+
* `|z| >= 1` (needed for e.g. the dilogarithm's reflection formulas) is
|
|
22
|
+
* **out of scope** — this throws rather than silently returning a wrong or
|
|
23
|
+
* divergent value.
|
|
24
|
+
*
|
|
25
|
+
* Special value: `Li_1(z) = -ln(1 - z)`.
|
|
26
|
+
*
|
|
27
|
+
* @param s - Order (any real number)
|
|
28
|
+
* @param z - Argument, must satisfy `|z| < 1`
|
|
29
|
+
* @returns Li_s(z)
|
|
30
|
+
* @throws {Error} If `|z| >= 1`
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* polylog(2, 0.5) // ~0.5822405265 (dilogarithm)
|
|
34
|
+
* polylog(1, 0.5) // ~0.6931471806 (= -ln(0.5) = ln 2)
|
|
35
|
+
*/
|
|
36
|
+
export declare function polylog(s: f64, z: f64): f64;
|
|
37
|
+
/**
|
|
38
|
+
* Struve function H_v(z), via its power series (DLMF 11.2.1):
|
|
39
|
+
*
|
|
40
|
+
* H_v(z) = sum_{k=0}^inf (-1)^k / (Gamma(k+3/2) Gamma(k+v+3/2)) * (z/2)^(2k+v+1)
|
|
41
|
+
*
|
|
42
|
+
* Evaluated by the standard term-recurrence ratio
|
|
43
|
+
* `term_{k+1}/term_k = -(z/2)^2 / ((k+3/2)(k+v+3/2))`, seeded by a single
|
|
44
|
+
* pair of `lgamma` evaluations (avoids recomputing Gamma at every order and
|
|
45
|
+
* avoids overflow from large individual Gamma values).
|
|
46
|
+
*
|
|
47
|
+
* Valid for `z >= 0` and `v > -3/2` (so that `Gamma(v+3/2)` has no pole).
|
|
48
|
+
*
|
|
49
|
+
* @param v - Order (real, `v > -3/2`)
|
|
50
|
+
* @param z - Argument (real, `z >= 0`)
|
|
51
|
+
* @returns H_v(z)
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* struveH(0, 1) // ~0.5686566270
|
|
55
|
+
* struveH(1, 2) // ~0.6467637283
|
|
56
|
+
*/
|
|
57
|
+
export declare function struveH(v: f64, z: f64): f64;
|
|
58
|
+
/**
|
|
59
|
+
* Modified Struve function L_v(z), via its power series (DLMF 11.2.1):
|
|
60
|
+
*
|
|
61
|
+
* L_v(z) = sum_{k=0}^inf 1 / (Gamma(k+3/2) Gamma(k+v+3/2)) * (z/2)^(2k+v+1)
|
|
62
|
+
*
|
|
63
|
+
* Same as `struveH` but without the alternating `(-1)^k` sign, so every term
|
|
64
|
+
* is positive and the series grows monotonically for `z > 0` (like a
|
|
65
|
+
* modified Bessel function).
|
|
66
|
+
*
|
|
67
|
+
* Valid for `z >= 0` and `v > -3/2`.
|
|
68
|
+
*
|
|
69
|
+
* @param v - Order (real, `v > -3/2`)
|
|
70
|
+
* @param z - Argument (real, `z >= 0`)
|
|
71
|
+
* @returns L_v(z)
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* struveL(0, 1) // ~0.7102431859
|
|
75
|
+
*/
|
|
76
|
+
export declare function struveL(v: f64, z: f64): f64;
|
|
77
|
+
/**
|
|
78
|
+
* Kelvin function ber(x) (order 0), via its power series (DLMF 10.65.1):
|
|
79
|
+
*
|
|
80
|
+
* ber(x) = sum_{k=0}^inf (-1)^k (x/2)^(4k) / ((2k)!)^2
|
|
81
|
+
*
|
|
82
|
+
* Evaluated by the term-recurrence ratio
|
|
83
|
+
* `term_{k+1}/term_k = -(x/2)^4 / ((2k+1)(2k+2))^2`.
|
|
84
|
+
*
|
|
85
|
+
* @param x - Argument (real)
|
|
86
|
+
* @returns ber(x)
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* kelvinBer(0) // 1
|
|
90
|
+
* kelvinBer(2) // ~0.7517341827
|
|
91
|
+
*/
|
|
92
|
+
export declare function kelvinBer(x: f64): f64;
|
|
93
|
+
/**
|
|
94
|
+
* Kelvin function bei(x) (order 0), via its power series (DLMF 10.65.1):
|
|
95
|
+
*
|
|
96
|
+
* bei(x) = sum_{k=0}^inf (-1)^k (x/2)^(4k+2) / ((2k+1)!)^2
|
|
97
|
+
*
|
|
98
|
+
* Evaluated by the term-recurrence ratio
|
|
99
|
+
* `term_{k+1}/term_k = -(x/2)^4 / ((2k+2)(2k+3))^2`.
|
|
100
|
+
*
|
|
101
|
+
* @param x - Argument (real)
|
|
102
|
+
* @returns bei(x)
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* kelvinBei(0) // 0
|
|
106
|
+
* kelvinBei(2) // ~0.9722916273
|
|
107
|
+
*/
|
|
108
|
+
export declare function kelvinBei(x: f64): f64;
|
|
109
|
+
/**
|
|
110
|
+
* Barnes G-function G(z), for real `z > 0`.
|
|
111
|
+
*
|
|
112
|
+
* Uses the functional equation `G(z+1) = Gamma(z) * G(z)` to shift `z` up
|
|
113
|
+
* until it is large enough for the asymptotic expansion of `ln G` (DLMF
|
|
114
|
+
* 5.17.5) to converge to machine precision, then unwinds the shift:
|
|
115
|
+
*
|
|
116
|
+
* ln G(z) = ln G(z + n) - sum_{k=0}^{n-1} lgamma(z + k)
|
|
117
|
+
*
|
|
118
|
+
* Verified against `mpmath.barnesg` (dps=25) to relative error ~1e-14 across
|
|
119
|
+
* the anchored integer/half-integer test values. Not extended to `z <= 0`
|
|
120
|
+
* (Barnes G has zeros/sign changes on the non-positive real axis that this
|
|
121
|
+
* shift-and-asymptotic approach does not handle) — that domain is out of
|
|
122
|
+
* scope.
|
|
123
|
+
*
|
|
124
|
+
* Known integer values: `G(1) = G(2) = 1`, and in general
|
|
125
|
+
* `G(n+3) = prod_{k=1}^{n} k!` for nonnegative integers `n`
|
|
126
|
+
* (e.g. `G(4) = 2`, `G(5) = 12`, `G(6) = 288`).
|
|
127
|
+
*
|
|
128
|
+
* @param z - Argument (real, `z > 0`)
|
|
129
|
+
* @returns G(z)
|
|
130
|
+
* @throws {Error} If `z <= 0`
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* barnesG(4) // 2 (= 1!)
|
|
134
|
+
* barnesG(5) // 12 (= 1! * 2!)
|
|
135
|
+
* barnesG(4.5) // ~4.1862532590
|
|
136
|
+
*/
|
|
137
|
+
export declare function barnesG(z: f64): f64;
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=niche.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"niche.d.ts","sourceRoot":"","sources":["../../src/special/niche.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAIH,0CAA0C;AAC1C,KAAK,GAAG,GAAG,MAAM,CAAC;AAYlB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,CAe3C;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,CAiB3C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,CAiB3C;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAYrC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAYrC;AAsCD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAcnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmetic.d.ts","sourceRoot":"","sources":["../../src/typed/arithmetic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"arithmetic.d.ts","sourceRoot":"","sources":["../../src/typed/arithmetic.ts"],"names":[],"mappings":"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"}
|
package/dist/typed/bitwise.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Use the `ComputePool` for ALL `Int32Array` transformations.
|
|
9
9
|
* - Use native ops on scalar inputs (no worker dispatch overhead).
|
|
10
10
|
*
|
|
11
|
-
* BigNumber bitwise semantics: the mathjs-
|
|
11
|
+
* BigNumber bitwise semantics: the mathjs-derived helpers in
|
|
12
12
|
* `functions/src/utils/bignumber/bitwise.ts` operate on the
|
|
13
13
|
* `decimal.js`-internal coefficient layout (`x.d` / `x.e` / `x.s`),
|
|
14
14
|
* which `@danielsimonjr/mathts-core`'s `BigNumber` does not expose.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Typed Probability & Combinatorics Functions
|
|
3
3
|
*
|
|
4
|
-
* Promotes genuinely-missing exports from the
|
|
4
|
+
* Promotes genuinely-missing exports from the activated `probability/` layer that
|
|
5
5
|
* are not already surfaced by `typed/distributions.ts` (PDF/PMF/CDF/entropy) or
|
|
6
6
|
* `typed/special.ts` (erf, beta, bessel, …).
|
|
7
7
|
*
|
|
8
8
|
* After dedup audit (2026-05-24):
|
|
9
9
|
*
|
|
10
|
-
* |
|
|
10
|
+
* | mathjs name | Promote? | Existing surface (if any) | Rationale |
|
|
11
11
|
* | ------------------ | -------- | ---------------------------------------------- | ------------------------------------------------ |
|
|
12
12
|
* | bernoulli | YES | — | genuinely missing (bernoulliPMF ≠ Bernoulli number) |
|
|
13
13
|
* | combinations | YES | — | genuinely missing |
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Polymorphic relational operations using typed-function for runtime dispatch.
|
|
5
5
|
* Supports number, BigNumber, Fraction, Complex, bigint, boolean, string, and Array types.
|
|
6
6
|
*
|
|
7
|
-
* These are clean implementations using mathTyped dispatch — the
|
|
8
|
-
* layer under functions/src/relational/ is left untouched
|
|
9
|
-
* algorithm reference.
|
|
7
|
+
* These are clean implementations using mathTyped dispatch — the activated
|
|
8
|
+
* mathjs-derived layer under functions/src/relational/ is left untouched here
|
|
9
|
+
* and used only as an algorithm reference.
|
|
10
10
|
*
|
|
11
11
|
* Semantics follow the mathjs convention:
|
|
12
12
|
* - nearlyEqual tolerance uses DEFAULT_CONFIG.relTol / absTol.
|
package/dist/typed/string.d.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Polymorphic string-formatting operations using typed-function for runtime dispatch.
|
|
5
5
|
* Supports `number`, `BigNumber`, and `string` types as appropriate for each op.
|
|
6
6
|
*
|
|
7
|
-
* These are clean implementations using mathTyped dispatch — the
|
|
8
|
-
* layer under functions/src/string/ is left untouched
|
|
9
|
-
* algorithm reference.
|
|
7
|
+
* These are clean implementations using mathTyped dispatch — the activated
|
|
8
|
+
* mathjs-derived layer under functions/src/string/ is left untouched here
|
|
9
|
+
* and used only as an algorithm reference.
|
|
10
10
|
*
|
|
11
11
|
* Semantics follow the mathjs convention:
|
|
12
12
|
* - bin/hex/oct: sign-magnitude representation for negative numbers (NOT two's-complement),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Initialize the type bridge for mathjs factory compatibility.
|
|
3
|
-
* Call once before using any
|
|
3
|
+
* Call once before using any activated mathjs-derived factories.
|
|
4
4
|
*/
|
|
5
5
|
export declare function initTypeBridge(): void;
|
|
6
6
|
//# sourceMappingURL=typed-bridge.d.ts.map
|
package/dist/utils/array.d.ts
CHANGED
|
@@ -1,242 +1,25 @@
|
|
|
1
|
-
import { Index, Matrix } from './is.js';
|
|
2
|
-
export type NestedArray<T> = T | NestedArray<T>[];
|
|
3
|
-
export interface IdentifiedValue<T> {
|
|
4
|
-
value: T;
|
|
5
|
-
identifier: number;
|
|
6
|
-
}
|
|
7
1
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* whether all dimensions match. (use function `validate` for that)
|
|
11
|
-
* @param {Array} x
|
|
12
|
-
* @return {number[]} size
|
|
13
|
-
*/
|
|
14
|
-
export declare function arraySize<T>(x: NestedArray<T>): number[];
|
|
15
|
-
/**
|
|
16
|
-
* Validate whether each element in a multi dimensional array has
|
|
17
|
-
* a size corresponding to the provided size array.
|
|
18
|
-
* @param {Array} array Array to be validated
|
|
19
|
-
* @param {number[]} size Array with the size of each dimension
|
|
20
|
-
* @throws DimensionError
|
|
21
|
-
*/
|
|
22
|
-
export declare function validate<T>(array: NestedArray<T>, size: number[]): void;
|
|
23
|
-
/**
|
|
24
|
-
* Validate whether the source of the index matches the size of the Array
|
|
25
|
-
* @param {Array | Matrix} value Array to be validated
|
|
26
|
-
* @param {Index} index Index with the source information to validate
|
|
27
|
-
* @throws DimensionError
|
|
28
|
-
*/
|
|
29
|
-
export declare function validateIndexSourceSize(value: unknown[] | Matrix, index: Index): void;
|
|
30
|
-
/**
|
|
31
|
-
* Test whether index is an integer number with index >= 0 and index < length
|
|
32
|
-
* when length is provided
|
|
33
|
-
* @param {number} index Zero-based index
|
|
34
|
-
* @param {number} [length] Length of the array
|
|
35
|
-
*/
|
|
36
|
-
export declare function validateIndex(index: number | undefined, length?: number): void;
|
|
37
|
-
/**
|
|
38
|
-
* Test if an index has empty values
|
|
39
|
-
* @param {Index} index Zero-based index
|
|
40
|
-
*/
|
|
41
|
-
export declare function isEmptyIndex(index: Index): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Resize a multi dimensional array. The resized array is returned.
|
|
44
|
-
* @param {Array | number} array Array to be resized
|
|
45
|
-
* @param {number[]} size Array with the size of each dimension
|
|
46
|
-
* @param {*} [defaultValue=0] Value to be filled in new entries,
|
|
47
|
-
* zero by default. Specify for example `null`,
|
|
48
|
-
* to clearly see entries that are not explicitly
|
|
49
|
-
* set.
|
|
50
|
-
* @return {Array} array The resized array
|
|
51
|
-
*/
|
|
52
|
-
export declare function resize<T = unknown>(array: T | T[] | NestedArray<T>, size: number[], defaultValue?: T): NestedArray<T>;
|
|
53
|
-
/**
|
|
54
|
-
* Re-shape a multi dimensional array to fit the specified dimensions
|
|
55
|
-
* @param {Array} array Array to be reshaped
|
|
56
|
-
* @param {number[]} sizes List of sizes for each dimension
|
|
57
|
-
* @returns {Array} Array whose data has been formatted to fit the
|
|
58
|
-
* specified dimensions
|
|
2
|
+
* Cold array utilities (size/validate/reshape/resize/squeeze/broadcast/deepMap/
|
|
3
|
+
* deepForEach/clone/...).
|
|
59
4
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* @param {number} currentLength Number of elements in the array.
|
|
68
|
-
* @throws {Error} If more than one wildcard or unable to replace it.
|
|
69
|
-
* @returns {number[]} The sizes array with wildcard replaced.
|
|
70
|
-
*/
|
|
71
|
-
export declare function processSizesWildcard(sizes: number[], currentLength: number): number[];
|
|
72
|
-
/**
|
|
73
|
-
* Squeeze a multi dimensional array
|
|
74
|
-
* @param {Array} array
|
|
75
|
-
* @param {Array} [size]
|
|
76
|
-
* @returns {Array} returns the array itself
|
|
77
|
-
*/
|
|
78
|
-
export declare function squeeze<T>(array: NestedArray<T>, size?: number[]): T | NestedArray<T>;
|
|
79
|
-
/**
|
|
80
|
-
* Unsqueeze a multi dimensional array: add dimensions when missing
|
|
5
|
+
* Consolidated onto core: the implementation lives once in
|
|
6
|
+
* `@danielsimonjr/mathts-core/internal` (see `core/src/array.ts` and the
|
|
7
|
+
* `project-all-libraries-build-on-core` principle). Thin re-export so existing
|
|
8
|
+
* `../utils/array.js` imports keep working while the single source of truth lives
|
|
9
|
+
* in core. Proven equivalent to the prior local copy (and to `expression`'s copy)
|
|
10
|
+
* via a fast-check property harness before the redirect — see
|
|
11
|
+
* `functions/tests/dedup-bucketB-equivalence.test.ts`.
|
|
81
12
|
*
|
|
82
|
-
*
|
|
13
|
+
* This package never had `initial` (unlike `expression`'s prior copy, where it was
|
|
14
|
+
* dead code even there), so it is intentionally not re-exported here — this shim
|
|
15
|
+
* preserves exactly the original export surface.
|
|
83
16
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export
|
|
92
|
-
/**
|
|
93
|
-
* Flatten a multi dimensional array, put all elements in a one dimensional
|
|
94
|
-
* array
|
|
95
|
-
* @param {Array} array A multi dimensional array
|
|
96
|
-
* @param {boolean} isRectangular Optional. If the array is rectangular (not jagged)
|
|
97
|
-
* @return {Array} The flattened array (1 dimensional)
|
|
98
|
-
*/
|
|
99
|
-
export declare function flatten<T>(array: NestedArray<T>, isRectangular?: boolean): T[];
|
|
100
|
-
/**
|
|
101
|
-
* A safe map
|
|
102
|
-
* @param {Array} array
|
|
103
|
-
* @param {function} callback
|
|
104
|
-
*/
|
|
105
|
-
export declare function map<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U): U[];
|
|
106
|
-
/**
|
|
107
|
-
* A safe forEach
|
|
108
|
-
* @param {Array} array
|
|
109
|
-
* @param {function} callback
|
|
110
|
-
*/
|
|
111
|
-
export declare function forEach<T>(array: T[], callback: (value: T, index: number, array: T[]) => void): void;
|
|
112
|
-
/**
|
|
113
|
-
* A safe filter
|
|
114
|
-
* @param {Array} array
|
|
115
|
-
* @param {function} callback
|
|
116
|
-
*/
|
|
117
|
-
export declare function filter<T>(array: T[], callback: (value: T, index: number, array: T[]) => boolean): T[];
|
|
118
|
-
/**
|
|
119
|
-
* Filter values in an array given a regular expression
|
|
120
|
-
* @param {Array} array
|
|
121
|
-
* @param {RegExp} regexp
|
|
122
|
-
* @return {Array} Returns the filtered array
|
|
123
|
-
* @private
|
|
124
|
-
*/
|
|
125
|
-
export declare function filterRegExp(array: string[], regexp: RegExp): string[];
|
|
126
|
-
/**
|
|
127
|
-
* A safe join
|
|
128
|
-
* @param {Array} array
|
|
129
|
-
* @param {string} separator
|
|
130
|
-
*/
|
|
131
|
-
export declare function join<T>(array: T[], separator: string): string;
|
|
132
|
-
/**
|
|
133
|
-
* Assign a numeric identifier to every element of a sorted array
|
|
134
|
-
* @param {Array} a An array
|
|
135
|
-
* @return {Array} An array of objects containing the original value and its identifier
|
|
136
|
-
*/
|
|
137
|
-
export declare function identify<T>(a: T[]): IdentifiedValue<T>[];
|
|
138
|
-
/**
|
|
139
|
-
* Remove the numeric identifier from the elements
|
|
140
|
-
* @param {array} a An array
|
|
141
|
-
* @return {array} An array of values without identifiers
|
|
142
|
-
*/
|
|
143
|
-
export declare function generalize<T>(a: IdentifiedValue<T>[]): T[];
|
|
144
|
-
/**
|
|
145
|
-
* Check the datatype of a given object
|
|
146
|
-
* This is a low level implementation that should only be used by
|
|
147
|
-
* parent Matrix classes such as SparseMatrix or DenseMatrix
|
|
148
|
-
* This method does not validate Array Matrix shape
|
|
149
|
-
* @param {Array} array
|
|
150
|
-
* @param {function} typeOf Callback function to use to determine the type of a value
|
|
151
|
-
* @return {string}
|
|
152
|
-
*/
|
|
153
|
-
export declare function getArrayDataType(array: unknown[], typeOf: (value: unknown) => string): string | undefined;
|
|
154
|
-
/**
|
|
155
|
-
* Return the last item from an array
|
|
156
|
-
* @param {Array} array
|
|
157
|
-
* @returns {*}
|
|
158
|
-
*/
|
|
159
|
-
export declare function last<T>(array: T[]): T;
|
|
160
|
-
/**
|
|
161
|
-
* Concatenates many arrays in the specified direction
|
|
162
|
-
* @param {...Array} arrays All the arrays to concatenate
|
|
163
|
-
* @param {number} concatDim The dimension on which to concatenate (zero-based)
|
|
164
|
-
* @returns {Array}
|
|
165
|
-
*/
|
|
166
|
-
export declare function concat<T>(...args: [...NestedArray<T>[], number]): NestedArray<T>[];
|
|
167
|
-
/**
|
|
168
|
-
* Receives two or more sizes and gets the broadcasted size for both.
|
|
169
|
-
* @param {...number[]} sizes Sizes to broadcast together
|
|
170
|
-
* @returns {number[]} The broadcasted size
|
|
171
|
-
*/
|
|
172
|
-
export declare function broadcastSizes(...sizes: number[][]): number[];
|
|
173
|
-
/**
|
|
174
|
-
* Checks if it's possible to broadcast a size to another size
|
|
175
|
-
* @param {number[]} size The size of the array to check
|
|
176
|
-
* @param {number[]} toSize The size of the array to validate if it can be broadcasted to
|
|
177
|
-
*/
|
|
178
|
-
export declare function checkBroadcastingRules(size: number[], toSize: number[]): void;
|
|
179
|
-
/**
|
|
180
|
-
* Broadcasts a single array to a certain size
|
|
181
|
-
* @param {Array} array Array to be broadcasted
|
|
182
|
-
* @param {number[]} toSize Size to broadcast the array
|
|
183
|
-
* @returns {Array} The broadcasted array
|
|
184
|
-
*/
|
|
185
|
-
export declare function broadcastTo<T>(array: NestedArray<T>, toSize: number[]): NestedArray<T>;
|
|
186
|
-
/**
|
|
187
|
-
* Broadcasts arrays and returns the broadcasted arrays in an array
|
|
188
|
-
* @param {...Array | any} arrays
|
|
189
|
-
* @returns {Array[]} The broadcasted arrays
|
|
190
|
-
*/
|
|
191
|
-
export declare function broadcastArrays<T>(...arrays: NestedArray<T>[]): NestedArray<T>[];
|
|
192
|
-
/**
|
|
193
|
-
* Stretches a matrix up to a certain size in a certain dimension
|
|
194
|
-
* @param {Array} arrayToStretch
|
|
195
|
-
* @param {number[]} sizeToStretch
|
|
196
|
-
* @param {number} dimToStretch
|
|
197
|
-
* @returns {Array} The stretched array
|
|
198
|
-
*/
|
|
199
|
-
export declare function stretch<T>(arrayToStretch: NestedArray<T>, sizeToStretch: number, dimToStretch: number): NestedArray<T>;
|
|
200
|
-
/**
|
|
201
|
-
* Retrieves a single element from an array given an index.
|
|
202
|
-
*
|
|
203
|
-
* @param {Array} array - The array from which to retrieve the value.
|
|
204
|
-
* @param {Array<number>} index - An array of indices specifying the position of the desired element in each dimension.
|
|
205
|
-
* @returns {*} - The value at the specified position in the array.
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* const arr = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];
|
|
209
|
-
* const index = [1, 0, 1];
|
|
210
|
-
* console.log(get(arr, index)); // 6
|
|
211
|
-
*/
|
|
212
|
-
export declare function get<T>(array: NestedArray<T>, index: number[]): T;
|
|
213
|
-
/**
|
|
214
|
-
* Recursively maps over each element of nested array using a provided callback function.
|
|
215
|
-
*
|
|
216
|
-
* @param {Array} array - The array to be mapped.
|
|
217
|
-
* @param {Function} callback - The function to execute on each element, taking three arguments:
|
|
218
|
-
* - `value` (any): The current element being processed in the array.
|
|
219
|
-
* - `index` (Array<number>): The index of the current element being processed in the array.
|
|
220
|
-
* - `array` (Array): The array `deepMap` was called upon.
|
|
221
|
-
* @param {boolean} [skipIndex=false] - If true, the callback function is called with only the value.
|
|
222
|
-
* @returns {Array} A new array with each element being the result of the callback function.
|
|
223
|
-
*/
|
|
224
|
-
export declare function deepMap<T, U>(array: NestedArray<T>, callback: ((value: T, index: number[], array: NestedArray<T>) => U) | ((value: T) => U), skipIndex?: boolean): NestedArray<U>;
|
|
225
|
-
/**
|
|
226
|
-
* Recursively iterates over each element in a multi-dimensional array and applies a callback function.
|
|
227
|
-
*
|
|
228
|
-
* @param {Array} array - The multi-dimensional array to iterate over.
|
|
229
|
-
* @param {Function} callback - The function to execute for each element. It receives three arguments:
|
|
230
|
-
* - {any} value: The current element being processed in the array.
|
|
231
|
-
* - {Array<number>} index: The index of the current element in each dimension.
|
|
232
|
-
* - {Array} array: The original array being processed.
|
|
233
|
-
* @param {boolean} [skipIndex=false] - If true, the callback function is called with only the value.
|
|
234
|
-
*/
|
|
235
|
-
export declare function deepForEach<T>(array: NestedArray<T>, callback: ((value: T, index: number[], array: NestedArray<T>) => void) | ((value: T) => void), skipIndex?: boolean): void;
|
|
236
|
-
/**
|
|
237
|
-
* Deep clones a multidimensional array
|
|
238
|
-
* @param {Array} array
|
|
239
|
-
* @returns {Array} cloned array
|
|
240
|
-
*/
|
|
241
|
-
export declare function clone<T>(array: T[]): T[];
|
|
17
|
+
* core re-exports this file's `clone`/`get`/`deepMap`/`deepForEach` under aliased
|
|
18
|
+
* names (`cloneArray`/`getArrayElement`/`deepMapArray`/`deepForEachArray`) to avoid
|
|
19
|
+
* collisions with `object.ts`'s generic `clone`/`get` and `collection.ts`'s
|
|
20
|
+
* Matrix-aware `deepMap`/`deepForEach` in its own barrel — re-imported here under
|
|
21
|
+
* THIS file's original local names.
|
|
22
|
+
*/
|
|
23
|
+
export type { NestedArray, IdentifiedValue } from '@danielsimonjr/mathts-core/internal';
|
|
24
|
+
export { arraySize, validate, validateIndexSourceSize, validateIndex, isEmptyIndex, resize, reshape, processSizesWildcard, squeeze, unsqueeze, flatten, map, forEach, filter, filterRegExp, join, identify, generalize, getArrayDataType, last, concat, broadcastSizes, checkBroadcastingRules, broadcastTo, broadcastArrays, stretch, getArrayElement as get, deepMapArray as deepMap, deepForEachArray as deepForEach, cloneArray as clone, } from '@danielsimonjr/mathts-core/internal';
|
|
242
25
|
//# sourceMappingURL=array.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EACL,SAAS,EACT,QAAQ,EACR,uBAAuB,EACvB,aAAa,EACb,YAAY,EACZ,MAAM,EACN,OAAO,EACP,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,OAAO,EACP,GAAG,EACH,OAAO,EACP,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,MAAM,EACN,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,OAAO,EACP,eAAe,IAAI,GAAG,EACtB,YAAY,IAAI,OAAO,EACvB,gBAAgB,IAAI,WAAW,EAC/B,UAAU,IAAI,KAAK,GACpB,MAAM,qCAAqC,CAAC"}
|