@danielsimonjr/mathts-functions 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/factories/evaluate.d.ts.map +1 -1
- package/dist/index.js +34 -15
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/factories/evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,cAAc,EAEf,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/factories/evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,cAAc,EAEf,MAAM,kCAAkC,CAAC;AAuD1C;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAyB,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAMhF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,EAAE,UAAU,CAAC,OAAO,cAAc,CAAoC,CAAC;AAE5F;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,iEAEvC;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM;IAGlB,uEAAuE;;IAEvE,yDAAyD;mBAC1C,MAAM,GAAG,OAAO;IAG/B,gCAAgC;cACtB,MAAM,GAAG,OAAO;IAG1B,+BAA+B;cACrB,MAAM,SAAS,OAAO,GAAG,IAAI;IAGvC,kCAAkC;iBACrB,MAAM,GAAG,IAAI;IAG1B,oCAAoC;aAC3B,IAAI;EAIhB;AAMD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAO9D;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAgB7D"}
|
package/dist/index.js
CHANGED
|
@@ -14939,7 +14939,18 @@ import {
|
|
|
14939
14939
|
createEvaluate,
|
|
14940
14940
|
compileExpression as _compileExpression
|
|
14941
14941
|
} from "@danielsimonjr/mathts-expression";
|
|
14942
|
-
import {
|
|
14942
|
+
import {
|
|
14943
|
+
Complex as Complex8,
|
|
14944
|
+
Fraction as Fraction4,
|
|
14945
|
+
I,
|
|
14946
|
+
PHI,
|
|
14947
|
+
SQRT2,
|
|
14948
|
+
SQRT1_2,
|
|
14949
|
+
LN2 as LN22,
|
|
14950
|
+
LN10,
|
|
14951
|
+
LOG2E,
|
|
14952
|
+
LOG10E
|
|
14953
|
+
} from "@danielsimonjr/mathts-core";
|
|
14943
14954
|
|
|
14944
14955
|
// src/factories/scope.ts
|
|
14945
14956
|
import { mathTyped as mathTyped17, Complex as Complex7, Fraction as Fraction3, BigNumber as BigNumber8 } from "@danielsimonjr/mathts-core";
|
|
@@ -16790,13 +16801,13 @@ function clone2(array) {
|
|
|
16790
16801
|
// src/utils/switch.ts
|
|
16791
16802
|
function _switch(mat) {
|
|
16792
16803
|
const rows = mat;
|
|
16793
|
-
const
|
|
16804
|
+
const I2 = rows.length;
|
|
16794
16805
|
const J = rows[0].length;
|
|
16795
16806
|
let i, j;
|
|
16796
16807
|
const ret = [];
|
|
16797
16808
|
for (j = 0; j < J; j++) {
|
|
16798
16809
|
const tmp = [];
|
|
16799
|
-
for (i = 0; i <
|
|
16810
|
+
for (i = 0; i < I2; i++) {
|
|
16800
16811
|
tmp.push(rows[i][j]);
|
|
16801
16812
|
}
|
|
16802
16813
|
ret.push(tmp);
|
|
@@ -19746,17 +19757,17 @@ var createDot = /* @__PURE__ */ factory(
|
|
|
19746
19757
|
let i = 0;
|
|
19747
19758
|
let j = 0;
|
|
19748
19759
|
while (i < xindex.length && j < yindex.length) {
|
|
19749
|
-
const
|
|
19760
|
+
const I2 = xindex[i];
|
|
19750
19761
|
const J = yindex[j];
|
|
19751
|
-
if (
|
|
19762
|
+
if (I2 < J) {
|
|
19752
19763
|
i++;
|
|
19753
19764
|
continue;
|
|
19754
19765
|
}
|
|
19755
|
-
if (
|
|
19766
|
+
if (I2 > J) {
|
|
19756
19767
|
j++;
|
|
19757
19768
|
continue;
|
|
19758
19769
|
}
|
|
19759
|
-
if (
|
|
19770
|
+
if (I2 === J) {
|
|
19760
19771
|
c = add2(c, mul(xvalues[i], yvalues[j]));
|
|
19761
19772
|
i++;
|
|
19762
19773
|
j++;
|
|
@@ -23721,13 +23732,13 @@ function _mapSlices(mat, dim, callback) {
|
|
|
23721
23732
|
}
|
|
23722
23733
|
}
|
|
23723
23734
|
function _switch2(mat) {
|
|
23724
|
-
const
|
|
23735
|
+
const I2 = mat.length;
|
|
23725
23736
|
const J = mat[0].length;
|
|
23726
23737
|
let i, j;
|
|
23727
23738
|
const ret = [];
|
|
23728
23739
|
for (j = 0; j < J; j++) {
|
|
23729
23740
|
const tmp = [];
|
|
23730
|
-
for (i = 0; i <
|
|
23741
|
+
for (i = 0; i < I2; i++) {
|
|
23731
23742
|
tmp.push(mat[i][j]);
|
|
23732
23743
|
}
|
|
23733
23744
|
ret.push(tmp);
|
|
@@ -30550,7 +30561,7 @@ var createFft = /* @__PURE__ */ factory(
|
|
|
30550
30561
|
divideScalar: divideScalar2,
|
|
30551
30562
|
exp: exp2,
|
|
30552
30563
|
tau: tau2,
|
|
30553
|
-
i:
|
|
30564
|
+
i: I2,
|
|
30554
30565
|
dotDivide: dotDivide2,
|
|
30555
30566
|
conj: conj3,
|
|
30556
30567
|
pow: pow2,
|
|
@@ -30598,7 +30609,7 @@ var createFft = /* @__PURE__ */ factory(
|
|
|
30598
30609
|
}
|
|
30599
30610
|
function _czt(arr) {
|
|
30600
30611
|
const n = arr.length;
|
|
30601
|
-
const w = exp2(divideScalar2(multiplyScalar2(-1, multiplyScalar2(
|
|
30612
|
+
const w = exp2(divideScalar2(multiplyScalar2(-1, multiplyScalar2(I2, tau2)), n));
|
|
30602
30613
|
const chirp = [];
|
|
30603
30614
|
for (let i = 1 - n; i < n; i++) {
|
|
30604
30615
|
chirp.push(pow2(w, divideScalar2(pow2(i, 2), 2)));
|
|
@@ -30665,7 +30676,7 @@ var createFft = /* @__PURE__ */ factory(
|
|
|
30665
30676
|
const p = ret[k];
|
|
30666
30677
|
const q = multiplyScalar2(
|
|
30667
30678
|
ret[k + length / 2],
|
|
30668
|
-
exp2(multiplyScalar2(multiplyScalar2(tau2,
|
|
30679
|
+
exp2(multiplyScalar2(multiplyScalar2(tau2, I2), divideScalar2(-k, length)))
|
|
30669
30680
|
);
|
|
30670
30681
|
ret[k] = addScalar2(p, q);
|
|
30671
30682
|
ret[k + length / 2] = addScalar2(p, multiplyScalar2(-1, q));
|
|
@@ -38654,15 +38665,15 @@ function createComplexEigs({
|
|
|
38654
38665
|
for (let i = 0; i < N; i++) {
|
|
38655
38666
|
M[i] = Array(N).fill(0);
|
|
38656
38667
|
}
|
|
38657
|
-
let
|
|
38668
|
+
let I2 = 0;
|
|
38658
38669
|
for (const sub of arr) {
|
|
38659
38670
|
const n = sub.length;
|
|
38660
38671
|
for (let i = 0; i < n; i++) {
|
|
38661
38672
|
for (let j = 0; j < n; j++) {
|
|
38662
|
-
M[
|
|
38673
|
+
M[I2 + i][I2 + j] = sub[i][j];
|
|
38663
38674
|
}
|
|
38664
38675
|
}
|
|
38665
|
-
|
|
38676
|
+
I2 += n;
|
|
38666
38677
|
}
|
|
38667
38678
|
return M;
|
|
38668
38679
|
}
|
|
@@ -43249,6 +43260,14 @@ var mathScope = {
|
|
|
43249
43260
|
pi: Math.PI,
|
|
43250
43261
|
e: Math.E,
|
|
43251
43262
|
tau: 2 * Math.PI,
|
|
43263
|
+
phi: PHI,
|
|
43264
|
+
i: I,
|
|
43265
|
+
SQRT2,
|
|
43266
|
+
SQRT1_2,
|
|
43267
|
+
LN2: LN22,
|
|
43268
|
+
LN10,
|
|
43269
|
+
LOG2E,
|
|
43270
|
+
LOG10E,
|
|
43252
43271
|
Infinity: Infinity,
|
|
43253
43272
|
NaN: NaN,
|
|
43254
43273
|
null: null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielsimonjr/mathts-functions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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,9 +33,9 @@
|
|
|
33
33
|
"build:prod": "tsup src/index.ts --format esm --clean --minify --treeshake"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@danielsimonjr/mathts-core": "^0.
|
|
37
|
-
"@danielsimonjr/mathts-expression": "^0.4.
|
|
38
|
-
"@danielsimonjr/mathts-matrix": "^0.1.
|
|
36
|
+
"@danielsimonjr/mathts-core": "^0.3.0",
|
|
37
|
+
"@danielsimonjr/mathts-expression": "^0.4.2",
|
|
38
|
+
"@danielsimonjr/mathts-matrix": "^0.1.12",
|
|
39
39
|
"@danielsimonjr/mathts-parallel": "^0.3.0",
|
|
40
40
|
"bignumber.js": "^9.1.2",
|
|
41
41
|
"complex.js": "^2.2.5",
|