@danielsimonjr/mathts-functions 0.5.0 → 0.7.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.
@@ -0,0 +1,71 @@
1
+ type Vec = readonly number[] | Float64Array;
2
+ /**
3
+ * Generalized eigenvalues of the pencil `A x = λ B x` (B nonsingular), via the
4
+ * eigendecomposition of `B⁻¹A` — reusing `inv`, `multiply`, and the corrected
5
+ * `eigs`. Eigenvalues match `scipy.linalg.eig(A, B)`. For ill-conditioned `B`
6
+ * prefer a QZ solver (not yet available).
7
+ */
8
+ export declare function generalizedEig(A: readonly number[][], B: readonly number[][]): {
9
+ values: Array<number | {
10
+ re: number;
11
+ im: number;
12
+ }>;
13
+ eigenvectors?: unknown;
14
+ };
15
+ /** Lower-triangular part of `A`, zeroing entries above the `k`-th diagonal. */
16
+ export declare function tril(A: readonly number[][], k?: number): number[][];
17
+ /** Upper-triangular part of `A`, zeroing entries below the `k`-th diagonal. */
18
+ export declare function triu(A: readonly number[][], k?: number): number[][];
19
+ /**
20
+ * Vandermonde matrix of `x`: column `j` is `xᵢ` to a power. With `increasing`
21
+ * false (default, NumPy convention) column `j` is `xᵢ^(N-1-j)`; `N` defaults to
22
+ * `x.length`.
23
+ */
24
+ export declare function vander(x: Vec, n?: number, increasing?: boolean): number[][];
25
+ /**
26
+ * Toeplitz matrix: first column `c`, first row `r` (defaults to `c`). Constant
27
+ * along each diagonal. `T[i][j] = c[i-j]` for `i ≥ j`, else `r[j-i]`.
28
+ */
29
+ export declare function toeplitz(c: Vec, r?: Vec): number[][];
30
+ /** Circulant matrix: each row is the previous one rotated right by one. */
31
+ export declare function circulant(c: Vec): number[][];
32
+ /**
33
+ * Companion matrix of a monic-normalized polynomial given by coefficients
34
+ * `[a₀, a₁, …, a_n]` (highest degree first, NumPy `np.companion` convention).
35
+ * Its eigenvalues are the polynomial's roots.
36
+ */
37
+ export declare function companion(coeffs: Vec): number[][];
38
+ /**
39
+ * Graph Laplacian of an adjacency matrix (bridge graph ↔ linear algebra — spectral
40
+ * graph theory). Combinatorial `L = D − A` by default (D = diagonal degree matrix);
41
+ * with `{ normalized: true }`, the symmetric normalized Laplacian
42
+ * `L_sym = I − D^(−1/2) A D^(−1/2)`. Eigen-analysis of `L` (via `eigs`) gives the
43
+ * Fiedler vector / spectral clustering.
44
+ */
45
+ export declare function laplacianMatrix(adjacency: readonly number[][], opts?: {
46
+ normalized?: boolean;
47
+ }): number[][];
48
+ /**
49
+ * Natural log of the absolute determinant via LU (the `logabsdet` component of
50
+ * `numpy.linalg.slogdet`), stable where `log(det(A))` would overflow. Returns
51
+ * `{ sign, value }` with `det = sign · exp(value)`.
52
+ */
53
+ export declare function logdet(A: readonly number[][]): {
54
+ sign: number;
55
+ value: number;
56
+ };
57
+ /**
58
+ * Generalized (QZ) Schur decomposition of the pencil `(A, B)` with `B` nonsingular:
59
+ * returns orthogonal `Q`, `Z` and upper-(quasi-)triangular `AA`, `BB` with
60
+ * `A = Q·AA·Zᵀ` and `B = Q·BB·Zᵀ`. Built from the real Schur of `B⁻¹A` (= Z S Zᵀ) and
61
+ * the QR of `B·Z` (= Q·BB): then `AA = Qᵀ·A·Z`. Robust for real spectra; matches the
62
+ * decomposition contract of `scipy.linalg.qz` (the factors are not unique).
63
+ */
64
+ export declare function qz(A: readonly number[][], B: readonly number[][]): {
65
+ AA: number[][];
66
+ BB: number[][];
67
+ Q: number[][];
68
+ Z: number[][];
69
+ };
70
+ export {};
71
+ //# sourceMappingURL=linalg-extra.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linalg-extra.d.ts","sourceRoot":"","sources":["../src/linalg-extra.ts"],"names":[],"mappings":"AA8DA,KAAK,GAAG,GAAG,SAAS,MAAM,EAAE,GAAG,YAAY,CAAC;AAG5C;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,EACtB,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,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ChB,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,EACtB,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,GACrB;IAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CASlE"}
@@ -18,4 +18,21 @@ export declare function acceleratedDet<T>(a: unknown, factoryDet: (m: unknown) =
18
18
  * Verified against numpy: max|inv−numpy| and max|A·inv−I| ~1e-15.
19
19
  */
20
20
  export declare function acceleratedInv<T>(a: unknown, factoryInv: (m: unknown) => T): T;
21
+ /** True for a square `number[][]` of any size ≥ 1. */
22
+ export declare function isNumericSquare(a: unknown): a is number[][];
23
+ /**
24
+ * Correct eigendecomposition for the public `eigs`.
25
+ *
26
+ * The activated mathjs factory `eigs` returns WRONG eigenvalues for *every*
27
+ * non-symmetric matrix — even trivial upper-triangular ones, whose eigenvalues
28
+ * are just the diagonal (e.g. [[2,1,0],[0,3,1],[0,0,4]] → [1.27, 3, 4.73]). The
29
+ * native `@danielsimonjr/mathts-matrix` `eig` (JAMA orthes/hqr2) is correct for
30
+ * symmetric, non-symmetric, and complex spectra (verified vs numpy), so route all
31
+ * numeric square matrices through it and emit the factory's `{ values,
32
+ * eigenvectors }` shape. Non-(numeric square) inputs and any native error fall
33
+ * back to the factory.
34
+ */
35
+ export declare function correctEigs(a: unknown, options: {
36
+ eigenvectors?: boolean;
37
+ } | undefined, factoryEigs: (m: unknown, o?: unknown) => unknown): unknown;
21
38
  //# sourceMappingURL=native-accel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"native-accel.d.ts","sourceRoot":"","sources":["../../src/matrix/native-accel.ts"],"names":[],"mappings":"AAkBA;gFACgF;AAChF,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC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"}
@@ -0,0 +1,28 @@
1
+ type Vec = readonly number[] | Float64Array;
2
+ /** Clamp a number — or each element of an array — to `[lo, hi]`. */
3
+ export declare function clamp(x: number, lo: number, hi: number): number;
4
+ export declare function clamp(x: readonly number[], lo: number, hi: number): number[];
5
+ /** Logistic sigmoid `1/(1+e^-x)`, computed in the numerically stable branch. */
6
+ export declare function sigmoid(x: number): number;
7
+ export declare function sigmoid(x: readonly number[]): number[];
8
+ /**
9
+ * Log-sum-exp: `log(Σ exp(xᵢ))`, shifted by the max for numerical stability.
10
+ * Reuses `max`/`sum`. The backbone of log-probability arithmetic.
11
+ */
12
+ export declare function logsumexp(x: Vec): number;
13
+ /** Softmax: `exp(xᵢ − max) / Σ exp(x − max)`. Returns a probability vector. */
14
+ export declare function softmax(x: Vec): number[];
15
+ /** Cumulative product (running ∏). Output has the same length as the input. */
16
+ export declare function cumprod(x: Vec): number[];
17
+ /** Cumulative maximum (running max). */
18
+ export declare function cummax(x: Vec): number[];
19
+ /** Cumulative minimum (running min). */
20
+ export declare function cummin(x: Vec): number[];
21
+ /**
22
+ * Cumulative trapezoidal integral of samples `y` (optionally over abscissae
23
+ * `x`, else unit spacing or a scalar `dx`). Output has the same length as `y`
24
+ * with a leading 0 (the MATLAB `cumtrapz` convention).
25
+ */
26
+ export declare function cumtrapz(y: Vec, x?: Vec | number): number[];
27
+ export {};
28
+ //# sourceMappingURL=numeric-extra.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric-extra.d.ts","sourceRoot":"","sources":["../src/numeric-extra.ts"],"names":[],"mappings":"AAUA,KAAK,GAAG,GAAG,SAAS,MAAM,EAAE,GAAG,YAAY,CAAC;AAG5C,oEAAoE;AACpE,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;AACjE,wBAAgB,KAAK,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;AAM9E,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;AAC3C,wBAAgB,OAAO,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AAMxD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAQxC;AAED,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,CAOxC;AAED,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,CASxC;AAED,wCAAwC;AACxC,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,CASvC;AAED,wCAAwC;AACxC,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,CASvC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,GAAG,MAAM,EAAE,CAe3D"}
@@ -0,0 +1,41 @@
1
+ export interface OptimizeResult {
2
+ x: number[];
3
+ fx: number;
4
+ iterations: number;
5
+ converged: boolean;
6
+ }
7
+ /**
8
+ * Nelder–Mead downhill-simplex minimization of `f: ℝⁿ → ℝ` from `x0`. Derivative-free.
9
+ * Matches `scipy.optimize.minimize(method='Nelder-Mead')` to the requested tolerance.
10
+ */
11
+ export declare function nelderMead(f: (x: number[]) => number, x0: readonly number[], opts?: {
12
+ maxIter?: number;
13
+ tol?: number;
14
+ step?: number;
15
+ }): OptimizeResult;
16
+ /**
17
+ * Gradient-descent minimization with optional backtracking line search. `grad` may
18
+ * be supplied; otherwise a central-difference gradient is used.
19
+ */
20
+ export declare function gradientDescent(f: (x: number[]) => number, x0: readonly number[], opts?: {
21
+ grad?: (x: number[]) => number[];
22
+ rate?: number;
23
+ maxIter?: number;
24
+ tol?: number;
25
+ }): OptimizeResult;
26
+ export interface LMResult {
27
+ x: number[];
28
+ residualNorm: number;
29
+ iterations: number;
30
+ converged: boolean;
31
+ }
32
+ /**
33
+ * Levenberg–Marquardt nonlinear least squares: minimize ½‖r(x)‖² for a vector
34
+ * residual `r`. Numeric Jacobian; damped normal equations `(JᵀJ + λI)δ = Jᵀr`
35
+ * solved via the matrix `inv`. Mirrors `scipy.optimize.least_squares(method='lm')`.
36
+ */
37
+ export declare function levenbergMarquardt(residual: (x: number[]) => number[], x0: readonly number[], opts?: {
38
+ maxIter?: number;
39
+ tol?: number;
40
+ }): LMResult;
41
+ //# sourceMappingURL=optimization-extra.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimization-extra.d.ts","sourceRoot":"","sources":["../src/optimization-extra.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,EAC1B,EAAE,EAAE,SAAS,MAAM,EAAE,EACrB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3D,cAAc,CA8DhB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,EAC1B,EAAE,EAAE,SAAS,MAAM,EAAE,EACrB,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7F,cAAc,CA6BhB;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,EACnC,EAAE,EAAE,SAAS,MAAM,EAAE,EACrB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC5C,QAAQ,CAgEV"}
@@ -0,0 +1,18 @@
1
+ type Vec = readonly number[] | Float64Array;
2
+ export interface LinregressResult {
3
+ slope: number;
4
+ intercept: number;
5
+ rValue: number;
6
+ rSquared: number;
7
+ pValue: number;
8
+ stdErr: number;
9
+ }
10
+ /**
11
+ * Simple linear regression `y ≈ slope·x + intercept` by ordinary least squares.
12
+ * `rValue` is Pearson's r; `pValue` is the two-sided test of slope = 0 (t with
13
+ * n−2 df); `stdErr` is the standard error of the slope. Mirrors
14
+ * `scipy.stats.linregress`.
15
+ */
16
+ export declare function linearRegression(x: Vec, y: Vec): LinregressResult;
17
+ export {};
18
+ //# sourceMappingURL=regression-extra.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regression-extra.d.ts","sourceRoot":"","sources":["../src/regression-extra.ts"],"names":[],"mappings":"AAQA,KAAK,GAAG,GAAG,SAAS,MAAM,EAAE,GAAG,YAAY,CAAC;AAI5C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,gBAAgB,CA0BjE"}
@@ -0,0 +1,35 @@
1
+ type Vec = readonly number[] | Float64Array;
2
+ /**
3
+ * FIR lowpass filter coefficients by the windowed-sinc method (Hamming window,
4
+ * normalized to unit DC gain) — `scipy.signal.firwin(numtaps, cutoff)` with the
5
+ * default window. `cutoff` is normalized to Nyquist (1 = Nyquist).
6
+ */
7
+ export declare function firwin(numtaps: number, cutoff: number): number[];
8
+ /**
9
+ * Apply an IIR/FIR filter with coefficients `b` (numerator), `a` (denominator) to
10
+ * `x` (direct form II transposed). `a[0]` normalizes. Matches `scipy.signal.lfilter`.
11
+ */
12
+ export declare function lfilter(b: Vec, a: Vec, x: Vec): number[];
13
+ /**
14
+ * Steady-state initial conditions for `lfilter` so a constant input is unchanged at
15
+ * the boundary — `scipy.signal.lfilter_zi`. Solves `(I − Aᵀ) zi = B` where `A` is the
16
+ * companion matrix of `a` and `B = b[1:] − a[1:]·b[0]`. Reuses `companion` + `inv`.
17
+ */
18
+ export declare function lfilterZi(b: Vec, a: Vec): number[];
19
+ /**
20
+ * Zero-phase forward–backward filtering (`scipy.signal.filtfilt`), with odd
21
+ * reflection padding (default pad length `3·max(len a, len b)`). The squared
22
+ * magnitude response is applied with no phase distortion.
23
+ */
24
+ export declare function filtfilt(b: Vec, a: Vec, x: Vec): number[];
25
+ /**
26
+ * Butterworth IIR filter design — returns `{ b, a }` transfer-function coefficients.
27
+ * `N` is the order, `Wn` the cutoff normalized to Nyquist (0..1). Lowpass only
28
+ * (`btype='low'`, the common case). Matches `scipy.signal.butter(N, Wn)`.
29
+ */
30
+ export declare function butter(N: number, Wn: number): {
31
+ b: number[];
32
+ a: number[];
33
+ };
34
+ export {};
35
+ //# sourceMappingURL=signal-filter-extra.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal-filter-extra.d.ts","sourceRoot":"","sources":["../src/signal-filter-extra.ts"],"names":[],"mappings":"AAYA,KAAK,GAAG,GAAG,SAAS,MAAM,EAAE,GAAG,YAAY,CAAC;AAK5C;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAShE;AAkCD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,CAExD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,CAUlD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,CAqBzD;AAuBD;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAyB1E"}
@@ -0,0 +1,24 @@
1
+ type Vec = readonly number[] | Float64Array;
2
+ /**
3
+ * Simple moving average over a trailing window of size `w`. Returns an array of
4
+ * length `n − w + 1` (the "valid" convolution, like `numpy.convolve(..., 'valid')`).
5
+ */
6
+ export declare function movingAverage(x: Vec, w: number): number[];
7
+ /**
8
+ * Exponentially-weighted moving average with smoothing factor `alpha ∈ (0,1]`
9
+ * (`yₜ = α·xₜ + (1−α)·yₜ₋₁`, seeded with `x₀`). Matches `pandas.ewm(alpha=…,
10
+ * adjust=False).mean()`. Output has the same length as the input.
11
+ */
12
+ export declare function ewma(x: Vec, alpha: number): number[];
13
+ /**
14
+ * Remove a trend from `x`. `'linear'` (default) subtracts the least-squares line;
15
+ * `'constant'` subtracts the mean. Matches `scipy.signal.detrend`.
16
+ */
17
+ export declare function detrend(x: Vec, type?: 'linear' | 'constant'): number[];
18
+ /**
19
+ * Autocorrelation function up to `nlags` (inclusive), biased estimator
20
+ * (÷n, like `statsmodels.tsa.stattools.acf`). `acf[0] = 1`.
21
+ */
22
+ export declare function acf(x: Vec, nlags: number): number[];
23
+ export {};
24
+ //# sourceMappingURL=timeseries-extra.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeseries-extra.d.ts","sourceRoot":"","sources":["../src/timeseries-extra.ts"],"names":[],"mappings":"AAQA,KAAK,GAAG,GAAG,SAAS,MAAM,EAAE,GAAG,YAAY,CAAC;AAI5C;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAWzD;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAWpD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,GAAE,QAAQ,GAAG,UAAqB,GAAG,MAAM,EAAE,CAoBhF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAcnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielsimonjr/mathts-functions",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
5
5
  "author": "Daniel Simon Jr.",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "build:prod": "tsup src/index.ts --format esm --clean --minify --treeshake"
34
34
  },
35
35
  "dependencies": {
36
- "@danielsimonjr/mathts-core": "^0.3.0",
36
+ "@danielsimonjr/mathts-core": "^0.3.1",
37
37
  "@danielsimonjr/mathts-expression": "^0.4.2",
38
38
  "@danielsimonjr/mathts-matrix": "^0.1.12",
39
39
  "@danielsimonjr/mathts-parallel": "^0.3.0",