@danielsimonjr/mathts-functions 0.3.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/index.js CHANGED
@@ -468,7 +468,7 @@ __export(typed_exports, {
468
468
  });
469
469
 
470
470
  // src/typed/arithmetic.ts
471
- import { mathTyped, Complex, Fraction, BigNumber } from "@danielsimonjr/mathts-core";
471
+ import { mathTyped, Complex, Fraction, BigNumber, Dual } from "@danielsimonjr/mathts-core";
472
472
  import { DenseMatrix, backendManager } from "@danielsimonjr/mathts-matrix";
473
473
  import { computePool } from "@danielsimonjr/mathts-parallel";
474
474
 
@@ -510,6 +510,10 @@ var add = mathTyped("add", {
510
510
  "BigNumber, BigNumber": (a, b) => a.add(b),
511
511
  // Unit arithmetic (mathjs parity): same-dimension units add (e.g. 5 cm + 3 mm).
512
512
  "Unit, Unit": (a, b) => a.add(b),
513
+ // Dual numbers (forward-mode AD).
514
+ "Dual, Dual": (a, b) => a.add(b),
515
+ "Dual, number": (a, b) => a.add(Dual.constant(b)),
516
+ "number, Dual": (a, b) => Dual.constant(a).add(b),
513
517
  // Mixed type operations (auto-coercion via conversions)
514
518
  "number, Complex": (a, b) => Complex.fromNumber(a).add(b),
515
519
  "Complex, number": (a, b) => a.add(Complex.fromNumber(b)),
@@ -544,6 +548,10 @@ var subtract = mathTyped("subtract", {
544
548
  "BigNumber, BigNumber": (a, b) => a.subtract(b),
545
549
  // Unit subtraction (same dimension): 5 cm − 3 mm.
546
550
  "Unit, Unit": (a, b) => a.sub(b),
551
+ // Dual numbers (forward-mode AD).
552
+ "Dual, Dual": (a, b) => a.sub(b),
553
+ "Dual, number": (a, b) => a.sub(Dual.constant(b)),
554
+ "number, Dual": (a, b) => Dual.constant(a).sub(b),
547
555
  "number, Complex": (a, b) => Complex.fromNumber(a).subtract(b),
548
556
  "Complex, number": (a, b) => a.subtract(Complex.fromNumber(b)),
549
557
  "number, Fraction": (a, b) => Fraction.fromNumber(a).subtract(b),
@@ -566,6 +574,10 @@ var multiply = mathTyped("multiply", {
566
574
  "Unit, Unit": (a, b) => a.mul(b),
567
575
  "Unit, number": (a, b) => a.mul(b),
568
576
  "number, Unit": (a, b) => b.mul(a),
577
+ // Dual numbers (forward-mode AD).
578
+ "Dual, Dual": (a, b) => a.mul(b),
579
+ "Dual, number": (a, b) => a.mul(Dual.constant(b)),
580
+ "number, Dual": (a, b) => Dual.constant(a).mul(b),
569
581
  // Matrix × matrix (2-D arrays) routed through the native DenseMatrix +
570
582
  // BackendManager — i.e. WASM/GPU acceleration for large matrices (GC7).
571
583
  // Previously `multiply(2DArray, 2DArray)` threw; this is additive. Non-2-D
@@ -621,6 +633,10 @@ var divide = mathTyped("divide", {
621
633
  // Unit division / scaling (mathjs parity). Unit ÷ Unit may be dimensionless.
622
634
  "Unit, Unit": (a, b) => a.div(b),
623
635
  "Unit, number": (a, b) => a.div(b),
636
+ // Dual numbers (forward-mode AD).
637
+ "Dual, Dual": (a, b) => a.div(b),
638
+ "Dual, number": (a, b) => a.div(Dual.constant(b)),
639
+ "number, Dual": (a, b) => Dual.constant(a).div(b),
624
640
  "number, Complex": (a, b) => Complex.fromNumber(a).divide(b),
625
641
  "Complex, number": (a, b) => a.divide(Complex.fromNumber(b)),
626
642
  "number, Fraction": (a, b) => Fraction.fromNumber(a).divide(b),
@@ -660,6 +676,7 @@ var abs = mathTyped("abs", {
660
676
  Complex: (a) => a.abs(),
661
677
  Fraction: (a) => a.abs(),
662
678
  BigNumber: (a) => a.abs(),
679
+ Dual: (a) => a.abs(),
663
680
  // Parallel array abs
664
681
  Float64Array: async (a) => {
665
682
  const wasm = elementwiseUnaryDispatch("abs", a);
@@ -696,7 +713,10 @@ var pow = mathTyped("pow", {
696
713
  "Complex, Complex": (a, b) => a.pow(b),
697
714
  "Fraction, number": (a, b) => a.pow(Math.floor(b)),
698
715
  "BigNumber, number": (a, b) => a.pow(b),
699
- "BigNumber, BigNumber": (a, b) => a.pow(b.valueOf())
716
+ "BigNumber, BigNumber": (a, b) => a.pow(b.valueOf()),
717
+ // Dual numbers (forward-mode AD): constant or variable exponent.
718
+ "Dual, number": (a, b) => a.powConst(b),
719
+ "Dual, Dual": (a, b) => a.pow(b)
700
720
  });
701
721
  var sqrt = mathTyped("sqrt", {
702
722
  number: (a) => {
@@ -707,6 +727,7 @@ var sqrt = mathTyped("sqrt", {
707
727
  },
708
728
  Complex: (a) => a.sqrt(),
709
729
  BigNumber: (a) => a.sqrt(),
730
+ Dual: (a) => a.sqrt(),
710
731
  // Parallel array sqrt
711
732
  Float64Array: async (a) => {
712
733
  const result = await computePool.sqrt(a);
@@ -719,6 +740,7 @@ var square = mathTyped("square", {
719
740
  Complex: (a) => a.multiply(a),
720
741
  Fraction: (a) => a.multiply(a),
721
742
  BigNumber: (a) => a.multiply(a),
743
+ Dual: (a) => a.square(),
722
744
  // Parallel array square
723
745
  Float64Array: async (a) => {
724
746
  const result = await computePool.square(a);
@@ -731,6 +753,7 @@ var cube = mathTyped("cube", {
731
753
  Complex: (a) => a.multiply(a).multiply(a),
732
754
  Fraction: (a) => a.multiply(a).multiply(a),
733
755
  BigNumber: (a) => a.multiply(a).multiply(a),
756
+ Dual: (a) => a.powConst(3),
734
757
  // Parallel array cube
735
758
  Float64Array: async (a) => {
736
759
  if (computePool.shouldParallelize(a.length)) {
@@ -746,6 +769,7 @@ var cbrt = mathTyped("cbrt", {
746
769
  number: (a) => Math.cbrt(a),
747
770
  Complex: (a) => a.pow(1 / 3),
748
771
  BigNumber: (a) => a.cbrt(),
772
+ Dual: (a) => a.powConst(1 / 3),
749
773
  // Parallel array cbrt
750
774
  Float64Array: async (a) => {
751
775
  if (computePool.shouldParallelize(a.length)) {
@@ -766,6 +790,7 @@ var exp = mathTyped("exp", {
766
790
  number: (a) => Math.exp(a),
767
791
  Complex: (a) => a.exp(),
768
792
  BigNumber: (a) => a.exp(),
793
+ Dual: (a) => a.exp(),
769
794
  // Parallel array exp
770
795
  Float64Array: async (a) => {
771
796
  const wasm = elementwiseUnaryDispatch("exp", a);
@@ -778,6 +803,7 @@ var log = mathTyped("log", {
778
803
  number: (a) => Math.log(a),
779
804
  Complex: (a) => a.log(),
780
805
  BigNumber: (a) => a.ln(),
806
+ Dual: (a) => a.log(),
781
807
  "number, number": (a, base) => Math.log(a) / Math.log(base),
782
808
  // Parallel array log
783
809
  Float64Array: async (a) => {
@@ -1349,6 +1375,7 @@ var sin = mathTyped2("sin", {
1349
1375
  number: (a) => Math.sin(a),
1350
1376
  Complex: (a) => a.sin(),
1351
1377
  BigNumber: (a) => a.sin(),
1378
+ Dual: (a) => a.sin(),
1352
1379
  // Parallel Float64Array sin
1353
1380
  Float64Array: async (a) => {
1354
1381
  const wasm = elementwiseUnaryDispatch("sin", a);
@@ -1361,6 +1388,7 @@ var cos = mathTyped2("cos", {
1361
1388
  number: (a) => Math.cos(a),
1362
1389
  Complex: (a) => a.cos(),
1363
1390
  BigNumber: (a) => a.cos(),
1391
+ Dual: (a) => a.cos(),
1364
1392
  // Parallel Float64Array cos
1365
1393
  Float64Array: async (a) => {
1366
1394
  const wasm = elementwiseUnaryDispatch("cos", a);
@@ -1373,6 +1401,7 @@ var tan = mathTyped2("tan", {
1373
1401
  number: (a) => Math.tan(a),
1374
1402
  Complex: (a) => a.tan(),
1375
1403
  BigNumber: (a) => a.tan(),
1404
+ Dual: (a) => a.tan(),
1376
1405
  // Parallel Float64Array tan
1377
1406
  Float64Array: async (a) => {
1378
1407
  const wasm = elementwiseUnaryDispatch("tan", a);
@@ -14910,7 +14939,18 @@ import {
14910
14939
  createEvaluate,
14911
14940
  compileExpression as _compileExpression
14912
14941
  } from "@danielsimonjr/mathts-expression";
14913
- import { Complex as Complex8, Fraction as Fraction4 } from "@danielsimonjr/mathts-core";
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";
14914
14954
 
14915
14955
  // src/factories/scope.ts
14916
14956
  import { mathTyped as mathTyped17, Complex as Complex7, Fraction as Fraction3, BigNumber as BigNumber8 } from "@danielsimonjr/mathts-core";
@@ -16761,13 +16801,13 @@ function clone2(array) {
16761
16801
  // src/utils/switch.ts
16762
16802
  function _switch(mat) {
16763
16803
  const rows = mat;
16764
- const I = rows.length;
16804
+ const I2 = rows.length;
16765
16805
  const J = rows[0].length;
16766
16806
  let i, j;
16767
16807
  const ret = [];
16768
16808
  for (j = 0; j < J; j++) {
16769
16809
  const tmp = [];
16770
- for (i = 0; i < I; i++) {
16810
+ for (i = 0; i < I2; i++) {
16771
16811
  tmp.push(rows[i][j]);
16772
16812
  }
16773
16813
  ret.push(tmp);
@@ -19717,17 +19757,17 @@ var createDot = /* @__PURE__ */ factory(
19717
19757
  let i = 0;
19718
19758
  let j = 0;
19719
19759
  while (i < xindex.length && j < yindex.length) {
19720
- const I = xindex[i];
19760
+ const I2 = xindex[i];
19721
19761
  const J = yindex[j];
19722
- if (I < J) {
19762
+ if (I2 < J) {
19723
19763
  i++;
19724
19764
  continue;
19725
19765
  }
19726
- if (I > J) {
19766
+ if (I2 > J) {
19727
19767
  j++;
19728
19768
  continue;
19729
19769
  }
19730
- if (I === J) {
19770
+ if (I2 === J) {
19731
19771
  c = add2(c, mul(xvalues[i], yvalues[j]));
19732
19772
  i++;
19733
19773
  j++;
@@ -20260,7 +20300,7 @@ var dependencies85 = ["typed", "config", "matrix", "BigNumber", "DenseMatrix", "
20260
20300
  var createIdentity = /* @__PURE__ */ factory(
20261
20301
  name85,
20262
20302
  dependencies85,
20263
- ({ typed: typed3, config, matrix: matrix2, BigNumber: BigNumber9, DenseMatrix: DenseMatrix4, SparseMatrix }) => {
20303
+ ({ typed: typed3, config, matrix: matrix2, BigNumber: BigNumber9, DenseMatrix: DenseMatrix5, SparseMatrix }) => {
20264
20304
  return typed3(name85, {
20265
20305
  "": function() {
20266
20306
  return config.matrix === "Matrix" ? matrix2([]) : [];
@@ -20323,7 +20363,7 @@ var createIdentity = /* @__PURE__ */ factory(
20323
20363
  return SparseMatrix.diagonal(size2, one, 0, defaultValue);
20324
20364
  }
20325
20365
  if (format6 === "dense") {
20326
- return DenseMatrix4.diagonal(size2, one, 0, defaultValue);
20366
+ return DenseMatrix5.diagonal(size2, one, 0, defaultValue);
20327
20367
  }
20328
20368
  throw new TypeError(`Unknown matrix type "${format6}"`);
20329
20369
  }
@@ -20431,7 +20471,7 @@ var dependencies88 = ["typed", "matrix", "DenseMatrix", "SparseMatrix"];
20431
20471
  var createDiag = /* @__PURE__ */ factory(
20432
20472
  name88,
20433
20473
  dependencies88,
20434
- ({ typed: typed3, matrix: matrix2, DenseMatrix: DenseMatrix4, SparseMatrix }) => {
20474
+ ({ typed: typed3, matrix: matrix2, DenseMatrix: DenseMatrix5, SparseMatrix }) => {
20435
20475
  return typed3(name88, {
20436
20476
  // FIXME: simplify this huge amount of signatures as soon as typed-function supports optional arguments
20437
20477
  Array: function(x) {
@@ -20490,7 +20530,7 @@ var createDiag = /* @__PURE__ */ factory(
20490
20530
  if (format6 && format6 !== "sparse" && format6 !== "dense") {
20491
20531
  throw new TypeError(`Unknown matrix type ${format6}"`);
20492
20532
  }
20493
- const m = format6 === "sparse" ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix4.diagonal(ms, x, k);
20533
+ const m = format6 === "sparse" ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix5.diagonal(ms, x, k);
20494
20534
  return format6 !== null ? m : m.valueOf();
20495
20535
  }
20496
20536
  function _getDiagonal(x, k, format6, s, kSub, kSuper) {
@@ -21052,6 +21092,79 @@ var createDet = /* @__PURE__ */ factory(
21052
21092
  }
21053
21093
  );
21054
21094
 
21095
+ // src/matrix/native-accel.ts
21096
+ import { DenseMatrix as DenseMatrix4, lu } from "@danielsimonjr/mathts-matrix";
21097
+ var NATIVE_MATRIX_THRESHOLD = 8;
21098
+ function isLargeNumericSquare(a) {
21099
+ if (!Array.isArray(a) || a.length < NATIVE_MATRIX_THRESHOLD) return false;
21100
+ const n = a.length;
21101
+ for (const row2 of a) {
21102
+ if (!Array.isArray(row2) || row2.length !== n) return false;
21103
+ for (let j = 0; j < n; j++) if (typeof row2[j] !== "number") return false;
21104
+ }
21105
+ return true;
21106
+ }
21107
+ function permutationParity(P2) {
21108
+ let sign3 = 1;
21109
+ const seen = new Array(P2.length).fill(false);
21110
+ for (let i = 0; i < P2.length; i++) {
21111
+ if (seen[i]) continue;
21112
+ let j = i;
21113
+ let len = 0;
21114
+ while (!seen[j]) {
21115
+ seen[j] = true;
21116
+ j = P2[j];
21117
+ len++;
21118
+ }
21119
+ if (len % 2 === 0) sign3 = -sign3;
21120
+ }
21121
+ return sign3;
21122
+ }
21123
+ var SINGULAR = /singular|zero pivot/i;
21124
+ function acceleratedDet(a, factoryDet2) {
21125
+ if (!isLargeNumericSquare(a)) return factoryDet2(a);
21126
+ try {
21127
+ const { U, P: P2 } = lu(DenseMatrix4.fromArray(a));
21128
+ const Ud = U.toArray();
21129
+ let d = permutationParity(P2);
21130
+ for (let i = 0; i < a.length; i++) d *= Ud[i][i];
21131
+ return d;
21132
+ } catch (e) {
21133
+ if (e instanceof Error && SINGULAR.test(e.message)) return 0;
21134
+ return factoryDet2(a);
21135
+ }
21136
+ }
21137
+ function acceleratedInv(a, factoryInv2) {
21138
+ if (!isLargeNumericSquare(a)) return factoryInv2(a);
21139
+ try {
21140
+ const { L, U, P: P2 } = lu(DenseMatrix4.fromArray(a));
21141
+ const Ld = L.toArray();
21142
+ const Ud = U.toArray();
21143
+ const n = a.length;
21144
+ const inv2 = Array.from({ length: n }, () => new Array(n).fill(0));
21145
+ for (let j = 0; j < n; j++) {
21146
+ const b = new Array(n).fill(0);
21147
+ for (let i = 0; i < n; i++) if (P2[i] === j) b[i] = 1;
21148
+ const y = new Array(n).fill(0);
21149
+ for (let i = 0; i < n; i++) {
21150
+ let s = b[i];
21151
+ for (let k = 0; k < i; k++) s -= Ld[i][k] * y[k];
21152
+ y[i] = s / Ld[i][i];
21153
+ }
21154
+ const x = new Array(n).fill(0);
21155
+ for (let i = n - 1; i >= 0; i--) {
21156
+ let s = y[i];
21157
+ for (let k = i + 1; k < n; k++) s -= Ud[i][k] * x[k];
21158
+ x[i] = s / Ud[i][i];
21159
+ }
21160
+ for (let i = 0; i < n; i++) inv2[i][j] = x[i];
21161
+ }
21162
+ return inv2;
21163
+ } catch {
21164
+ return factoryInv2(a);
21165
+ }
21166
+ }
21167
+
21055
21168
  // src/matrix/reshape.ts
21056
21169
  var name96 = "reshape";
21057
21170
  var dependencies96 = ["typed", "isInteger", "matrix"];
@@ -21958,7 +22071,7 @@ var createCsSymperm = /* @__PURE__ */ factory(
21958
22071
  );
21959
22072
 
21960
22073
  // src/algebra/solver/utils/solveValidation.ts
21961
- function createSolveValidation({ DenseMatrix: DenseMatrix4 }) {
22074
+ function createSolveValidation({ DenseMatrix: DenseMatrix5 }) {
21962
22075
  return function solveValidation(m, b, copy) {
21963
22076
  const mSize = m.size();
21964
22077
  if (mSize.length !== 2) {
@@ -21981,7 +22094,7 @@ function createSolveValidation({ DenseMatrix: DenseMatrix4 }) {
21981
22094
  for (let i = 0; i < rows; i++) {
21982
22095
  data[i] = [bdata[i]];
21983
22096
  }
21984
- return new DenseMatrix4({
22097
+ return new DenseMatrix5({
21985
22098
  data,
21986
22099
  size: [rows, 1],
21987
22100
  datatype: bm._datatype
@@ -21997,7 +22110,7 @@ function createSolveValidation({ DenseMatrix: DenseMatrix4 }) {
21997
22110
  for (let i = 0; i < rows; i++) {
21998
22111
  data[i] = [bdata[i][0]];
21999
22112
  }
22000
- return new DenseMatrix4({
22113
+ return new DenseMatrix5({
22001
22114
  data,
22002
22115
  size: [rows, 1],
22003
22116
  datatype: bm._datatype
@@ -22016,7 +22129,7 @@ function createSolveValidation({ DenseMatrix: DenseMatrix4 }) {
22016
22129
  const i = index[k];
22017
22130
  data[i][0] = values[k];
22018
22131
  }
22019
- return new DenseMatrix4({
22132
+ return new DenseMatrix5({
22020
22133
  data,
22021
22134
  size: [rows, 1],
22022
22135
  datatype: bm._datatype
@@ -22036,7 +22149,7 @@ function createSolveValidation({ DenseMatrix: DenseMatrix4 }) {
22036
22149
  for (let i = 0; i < rows; i++) {
22037
22150
  data[i] = [b[i]];
22038
22151
  }
22039
- return new DenseMatrix4({
22152
+ return new DenseMatrix5({
22040
22153
  data,
22041
22154
  size: [rows, 1]
22042
22155
  });
@@ -22048,7 +22161,7 @@ function createSolveValidation({ DenseMatrix: DenseMatrix4 }) {
22048
22161
  for (let i = 0; i < rows; i++) {
22049
22162
  data[i] = [b[i][0]];
22050
22163
  }
22051
- return new DenseMatrix4({
22164
+ return new DenseMatrix5({
22052
22165
  data,
22053
22166
  size: [rows, 1]
22054
22167
  });
@@ -22118,10 +22231,10 @@ var createLsolve = /* @__PURE__ */ factory(
22118
22231
  multiplyScalar: multiplyScalar2,
22119
22232
  subtractScalar: subtractScalar2,
22120
22233
  equalScalar: equalScalar3,
22121
- DenseMatrix: DenseMatrix4
22234
+ DenseMatrix: DenseMatrix5
22122
22235
  }) => {
22123
22236
  const solveValidation = createSolveValidation({
22124
- DenseMatrix: DenseMatrix4
22237
+ DenseMatrix: DenseMatrix5
22125
22238
  });
22126
22239
  return typed3(name101, {
22127
22240
  "SparseMatrix, Array | Matrix": function(m, b) {
@@ -22159,7 +22272,7 @@ var createLsolve = /* @__PURE__ */ factory(
22159
22272
  for (let i = 0; i < rows; i++) {
22160
22273
  x2[i] = [resultAlloc.array[i]];
22161
22274
  }
22162
- return new DenseMatrix4({
22275
+ return new DenseMatrix5({
22163
22276
  data: x2,
22164
22277
  size: [rows, 1]
22165
22278
  });
@@ -22192,7 +22305,7 @@ var createLsolve = /* @__PURE__ */ factory(
22192
22305
  }
22193
22306
  x[j] = [xj];
22194
22307
  }
22195
- return new DenseMatrix4({
22308
+ return new DenseMatrix5({
22196
22309
  data: x,
22197
22310
  size: [rows, 1]
22198
22311
  });
@@ -22236,7 +22349,7 @@ var createLsolve = /* @__PURE__ */ factory(
22236
22349
  x[j] = [0];
22237
22350
  }
22238
22351
  }
22239
- return new DenseMatrix4({
22352
+ return new DenseMatrix5({
22240
22353
  data: x,
22241
22354
  size: [rows, 1]
22242
22355
  });
@@ -22265,10 +22378,10 @@ var createLsolveAll = /* @__PURE__ */ factory(
22265
22378
  multiplyScalar: multiplyScalar2,
22266
22379
  subtractScalar: subtractScalar2,
22267
22380
  equalScalar: equalScalar3,
22268
- DenseMatrix: DenseMatrix4
22381
+ DenseMatrix: DenseMatrix5
22269
22382
  }) => {
22270
22383
  const solveValidation = createSolveValidation({
22271
- DenseMatrix: DenseMatrix4
22384
+ DenseMatrix: DenseMatrix5
22272
22385
  });
22273
22386
  return typed3(name102, {
22274
22387
  "SparseMatrix, Array | Matrix": function(m, b) {
@@ -22318,7 +22431,7 @@ var createLsolveAll = /* @__PURE__ */ factory(
22318
22431
  }
22319
22432
  }
22320
22433
  return B.map(
22321
- (x) => new DenseMatrix4({
22434
+ (x) => new DenseMatrix5({
22322
22435
  data: x.map((e) => [e]),
22323
22436
  size: [rows, 1]
22324
22437
  })
@@ -22377,7 +22490,7 @@ var createLsolveAll = /* @__PURE__ */ factory(
22377
22490
  }
22378
22491
  }
22379
22492
  return B.map(
22380
- (x) => new DenseMatrix4({
22493
+ (x) => new DenseMatrix5({
22381
22494
  data: x.map((e) => [e]),
22382
22495
  size: [rows, 1]
22383
22496
  })
@@ -22443,10 +22556,10 @@ var createUsolve = /* @__PURE__ */ factory(
22443
22556
  multiplyScalar: multiplyScalar2,
22444
22557
  subtractScalar: subtractScalar2,
22445
22558
  equalScalar: equalScalar3,
22446
- DenseMatrix: DenseMatrix4
22559
+ DenseMatrix: DenseMatrix5
22447
22560
  }) => {
22448
22561
  const solveValidation = createSolveValidation({
22449
- DenseMatrix: DenseMatrix4
22562
+ DenseMatrix: DenseMatrix5
22450
22563
  });
22451
22564
  return typed3(name103, {
22452
22565
  "SparseMatrix, Array | Matrix": function(m, b) {
@@ -22484,7 +22597,7 @@ var createUsolve = /* @__PURE__ */ factory(
22484
22597
  for (let i = 0; i < rows; i++) {
22485
22598
  x2[i] = [resultAlloc.array[i]];
22486
22599
  }
22487
- return new DenseMatrix4({
22600
+ return new DenseMatrix5({
22488
22601
  data: x2,
22489
22602
  size: [rows, 1]
22490
22603
  });
@@ -22517,7 +22630,7 @@ var createUsolve = /* @__PURE__ */ factory(
22517
22630
  }
22518
22631
  x[j] = [xj];
22519
22632
  }
22520
- return new DenseMatrix4({
22633
+ return new DenseMatrix5({
22521
22634
  data: x,
22522
22635
  size: [rows, 1]
22523
22636
  });
@@ -22561,7 +22674,7 @@ var createUsolve = /* @__PURE__ */ factory(
22561
22674
  x[j] = [0];
22562
22675
  }
22563
22676
  }
22564
- return new DenseMatrix4({
22677
+ return new DenseMatrix5({
22565
22678
  data: x,
22566
22679
  size: [rows, 1]
22567
22680
  });
@@ -22590,10 +22703,10 @@ var createUsolveAll = /* @__PURE__ */ factory(
22590
22703
  multiplyScalar: multiplyScalar2,
22591
22704
  subtractScalar: subtractScalar2,
22592
22705
  equalScalar: equalScalar3,
22593
- DenseMatrix: DenseMatrix4
22706
+ DenseMatrix: DenseMatrix5
22594
22707
  }) => {
22595
22708
  const solveValidation = createSolveValidation({
22596
- DenseMatrix: DenseMatrix4
22709
+ DenseMatrix: DenseMatrix5
22597
22710
  });
22598
22711
  return typed3(name104, {
22599
22712
  "SparseMatrix, Array | Matrix": function(m, b) {
@@ -22643,7 +22756,7 @@ var createUsolveAll = /* @__PURE__ */ factory(
22643
22756
  }
22644
22757
  }
22645
22758
  return B.map(
22646
- (x) => new DenseMatrix4({
22759
+ (x) => new DenseMatrix5({
22647
22760
  data: x.map((e) => [e]),
22648
22761
  size: [rows, 1]
22649
22762
  })
@@ -22702,7 +22815,7 @@ var createUsolveAll = /* @__PURE__ */ factory(
22702
22815
  }
22703
22816
  }
22704
22817
  return B.map(
22705
- (x) => new DenseMatrix4({
22818
+ (x) => new DenseMatrix5({
22706
22819
  data: x.map((e) => [e]),
22707
22820
  size: [rows, 1]
22708
22821
  })
@@ -22920,7 +23033,7 @@ var dependencies108 = ["typed", "DenseMatrix"];
22920
23033
  var createMatAlgo12xSfs = /* @__PURE__ */ factory(
22921
23034
  name108,
22922
23035
  dependencies108,
22923
- ({ typed: typed3, DenseMatrix: DenseMatrix4 }) => {
23036
+ ({ typed: typed3, DenseMatrix: DenseMatrix5 }) => {
22924
23037
  return function matAlgo12xSfs(s, b, callback, inverse) {
22925
23038
  const avalues = s._values;
22926
23039
  const aindex = s._index;
@@ -22960,7 +23073,7 @@ var createMatAlgo12xSfs = /* @__PURE__ */ factory(
22960
23073
  }
22961
23074
  }
22962
23075
  }
22963
- return new DenseMatrix4({
23076
+ return new DenseMatrix5({
22964
23077
  data: cdata,
22965
23078
  size: [rows, columns],
22966
23079
  datatype: dt
@@ -23033,9 +23146,9 @@ var dependencies110 = [
23033
23146
  var createRound = /* @__PURE__ */ factory(
23034
23147
  name110,
23035
23148
  dependencies110,
23036
- ({ typed: typed3, config, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, BigNumber: BigNumber9, DenseMatrix: DenseMatrix4 }) => {
23149
+ ({ typed: typed3, config, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, BigNumber: BigNumber9, DenseMatrix: DenseMatrix5 }) => {
23037
23150
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
23038
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
23151
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
23039
23152
  const matAlgo14xDs = createMatAlgo14xDs({ typed: typed3 });
23040
23153
  function toExponent(epsilon) {
23041
23154
  return Math.abs(splitNumber(epsilon).exponent);
@@ -23619,13 +23732,13 @@ function _mapSlices(mat, dim, callback) {
23619
23732
  }
23620
23733
  }
23621
23734
  function _switch2(mat) {
23622
- const I = mat.length;
23735
+ const I2 = mat.length;
23623
23736
  const J = mat[0].length;
23624
23737
  let i, j;
23625
23738
  const ret = [];
23626
23739
  for (j = 0; j < J; j++) {
23627
23740
  const tmp = [];
23628
- for (i = 0; i < I; i++) {
23741
+ for (i = 0; i < I2; i++) {
23629
23742
  tmp.push(mat[i][j]);
23630
23743
  }
23631
23744
  ret.push(tmp);
@@ -24444,13 +24557,13 @@ var createEqual = /* @__PURE__ */ factory(
24444
24557
  typed: typed3,
24445
24558
  matrix: matrix2,
24446
24559
  equalScalar: equalScalar3,
24447
- DenseMatrix: DenseMatrix4,
24560
+ DenseMatrix: DenseMatrix5,
24448
24561
  concat: _concat,
24449
24562
  SparseMatrix
24450
24563
  }) => {
24451
24564
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
24452
24565
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
24453
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
24566
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
24454
24567
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed: typed3, matrix: matrix2 });
24455
24568
  return typed3(
24456
24569
  name124,
@@ -24840,7 +24953,7 @@ var createDotDivide = /* @__PURE__ */ factory(
24840
24953
  matrix: matrix2,
24841
24954
  equalScalar: equalScalar3,
24842
24955
  divideScalar: divideScalar2,
24843
- DenseMatrix: DenseMatrix4,
24956
+ DenseMatrix: DenseMatrix5,
24844
24957
  concat: concat3,
24845
24958
  SparseMatrix
24846
24959
  }) => {
@@ -24848,7 +24961,7 @@ var createDotDivide = /* @__PURE__ */ factory(
24848
24961
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
24849
24962
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
24850
24963
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
24851
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
24964
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
24852
24965
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
24853
24966
  typed: typed3,
24854
24967
  matrix: matrix2,
@@ -25017,9 +25130,9 @@ var createFloorNumber = /* @__PURE__ */ factory(
25017
25130
  var createFloor = /* @__PURE__ */ factory(
25018
25131
  name133,
25019
25132
  dependencies133,
25020
- ({ typed: typed3, config, round: round2, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix4 }) => {
25133
+ ({ typed: typed3, config, round: round2, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix5 }) => {
25021
25134
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
25022
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
25135
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
25023
25136
  const matAlgo14xDs = createMatAlgo14xDs({ typed: typed3 });
25024
25137
  const floorNumber = createFloorNumber({ typed: typed3, config, round: round2 });
25025
25138
  function _bigFloor(x) {
@@ -25230,7 +25343,7 @@ var dependencies135 = [
25230
25343
  var createMod = /* @__PURE__ */ factory(
25231
25344
  name135,
25232
25345
  dependencies135,
25233
- ({ typed: typed3, config, round: round2, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix4, concat: concat3 }) => {
25346
+ ({ typed: typed3, config, round: round2, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix5, concat: concat3 }) => {
25234
25347
  const floor2 = createFloor({
25235
25348
  typed: typed3,
25236
25349
  config,
@@ -25238,13 +25351,13 @@ var createMod = /* @__PURE__ */ factory(
25238
25351
  matrix: matrix2,
25239
25352
  equalScalar: equalScalar3,
25240
25353
  zeros: zeros3,
25241
- DenseMatrix: DenseMatrix4
25354
+ DenseMatrix: DenseMatrix5
25242
25355
  });
25243
25356
  const matAlgo02xDS0 = createMatAlgo02xDS0({ typed: typed3, equalScalar: equalScalar3 });
25244
25357
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
25245
25358
  const matAlgo05xSfSf = createMatAlgo05xSfSf({ typed: typed3, equalScalar: equalScalar3 });
25246
25359
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
25247
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
25360
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
25248
25361
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
25249
25362
  typed: typed3,
25250
25363
  matrix: matrix2,
@@ -25457,7 +25570,7 @@ var dependencies138 = ["typed", "DenseMatrix"];
25457
25570
  var createMatAlgo10xSids = /* @__PURE__ */ factory(
25458
25571
  name138,
25459
25572
  dependencies138,
25460
- ({ typed: typed3, DenseMatrix: DenseMatrix4 }) => {
25573
+ ({ typed: typed3, DenseMatrix: DenseMatrix5 }) => {
25461
25574
  return function matAlgo10xSids(s, b, callback, inverse) {
25462
25575
  const avalues = s._values;
25463
25576
  const aindex = s._index;
@@ -25497,7 +25610,7 @@ var createMatAlgo10xSids = /* @__PURE__ */ factory(
25497
25610
  }
25498
25611
  }
25499
25612
  }
25500
- return new DenseMatrix4({
25613
+ return new DenseMatrix5({
25501
25614
  data: cdata,
25502
25615
  size: [rows, columns],
25503
25616
  datatype: dt
@@ -25536,7 +25649,7 @@ var createGcd = /* @__PURE__ */ factory(
25536
25649
  equalScalar: equalScalar3,
25537
25650
  zeros: zeros3,
25538
25651
  BigNumber: BigNumber9,
25539
- DenseMatrix: DenseMatrix4,
25652
+ DenseMatrix: DenseMatrix5,
25540
25653
  concat: concat3
25541
25654
  }) => {
25542
25655
  const mod2 = createMod({
@@ -25546,12 +25659,12 @@ var createGcd = /* @__PURE__ */ factory(
25546
25659
  matrix: matrix2,
25547
25660
  equalScalar: equalScalar3,
25548
25661
  zeros: zeros3,
25549
- DenseMatrix: DenseMatrix4,
25662
+ DenseMatrix: DenseMatrix5,
25550
25663
  concat: concat3
25551
25664
  });
25552
25665
  const matAlgo01xDSid = createMatAlgo01xDSid({ typed: typed3 });
25553
25666
  const matAlgo04xSidSid = createMatAlgo04xSidSid({ typed: typed3, equalScalar: equalScalar3 });
25554
- const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix4 });
25667
+ const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix5 });
25555
25668
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
25556
25669
  typed: typed3,
25557
25670
  matrix: matrix2,
@@ -26118,9 +26231,9 @@ var createCeilNumber = /* @__PURE__ */ factory(
26118
26231
  var createCeil = /* @__PURE__ */ factory(
26119
26232
  name145,
26120
26233
  dependencies145,
26121
- ({ typed: typed3, config, round: round2, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix4 }) => {
26234
+ ({ typed: typed3, config, round: round2, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix5 }) => {
26122
26235
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
26123
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
26236
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
26124
26237
  const matAlgo14xDs = createMatAlgo14xDs({ typed: typed3 });
26125
26238
  const ceilNumber = createCeilNumber({ typed: typed3, config, round: round2 });
26126
26239
  function _bigCeil(x) {
@@ -26254,10 +26367,10 @@ var dependencies147 = ["typed", "matrix", "equalScalar", "DenseMatrix", "concat"
26254
26367
  var createBitOr = /* @__PURE__ */ factory(
26255
26368
  name147,
26256
26369
  dependencies147,
26257
- ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, DenseMatrix: DenseMatrix4, concat: concat3 }) => {
26370
+ ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, DenseMatrix: DenseMatrix5, concat: concat3 }) => {
26258
26371
  const matAlgo01xDSid = createMatAlgo01xDSid({ typed: typed3 });
26259
26372
  const matAlgo04xSidSid = createMatAlgo04xSidSid({ typed: typed3, equalScalar: equalScalar3 });
26260
- const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix4 });
26373
+ const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix5 });
26261
26374
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
26262
26375
  typed: typed3,
26263
26376
  matrix: matrix2,
@@ -26285,10 +26398,10 @@ var dependencies148 = ["typed", "matrix", "DenseMatrix", "concat", "SparseMatrix
26285
26398
  var createBitXor = /* @__PURE__ */ factory(
26286
26399
  name148,
26287
26400
  dependencies148,
26288
- ({ typed: typed3, matrix: matrix2, DenseMatrix: DenseMatrix4, concat: concat3, SparseMatrix }) => {
26401
+ ({ typed: typed3, matrix: matrix2, DenseMatrix: DenseMatrix5, concat: concat3, SparseMatrix }) => {
26289
26402
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
26290
26403
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
26291
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
26404
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
26292
26405
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
26293
26406
  typed: typed3,
26294
26407
  matrix: matrix2,
@@ -26429,11 +26542,11 @@ var dependencies150 = ["typed", "matrix", "equalScalar", "zeros", "DenseMatrix",
26429
26542
  var createLeftShift = /* @__PURE__ */ factory(
26430
26543
  name150,
26431
26544
  dependencies150,
26432
- ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix4, concat: concat3 }) => {
26545
+ ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix5, concat: concat3 }) => {
26433
26546
  const matAlgo01xDSid = createMatAlgo01xDSid({ typed: typed3 });
26434
26547
  const matAlgo02xDS0 = createMatAlgo02xDS0({ typed: typed3, equalScalar: equalScalar3 });
26435
26548
  const matAlgo08xS0Sid = createMatAlgo08xS0Sid({ typed: typed3, equalScalar: equalScalar3 });
26436
- const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix4 });
26549
+ const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix5 });
26437
26550
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
26438
26551
  const matAlgo14xDs = createMatAlgo14xDs({ typed: typed3 });
26439
26552
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
@@ -26500,11 +26613,11 @@ var dependencies151 = ["typed", "matrix", "equalScalar", "zeros", "DenseMatrix",
26500
26613
  var createRightArithShift = /* @__PURE__ */ factory(
26501
26614
  name151,
26502
26615
  dependencies151,
26503
- ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix4, concat: concat3 }) => {
26616
+ ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix5, concat: concat3 }) => {
26504
26617
  const matAlgo01xDSid = createMatAlgo01xDSid({ typed: typed3 });
26505
26618
  const matAlgo02xDS0 = createMatAlgo02xDS0({ typed: typed3, equalScalar: equalScalar3 });
26506
26619
  const matAlgo08xS0Sid = createMatAlgo08xS0Sid({ typed: typed3, equalScalar: equalScalar3 });
26507
- const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix4 });
26620
+ const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix5 });
26508
26621
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
26509
26622
  const matAlgo14xDs = createMatAlgo14xDs({ typed: typed3 });
26510
26623
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
@@ -26571,11 +26684,11 @@ var dependencies152 = ["typed", "matrix", "equalScalar", "zeros", "DenseMatrix",
26571
26684
  var createRightLogShift = /* @__PURE__ */ factory(
26572
26685
  name152,
26573
26686
  dependencies152,
26574
- ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix4, concat: concat3 }) => {
26687
+ ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix5, concat: concat3 }) => {
26575
26688
  const matAlgo01xDSid = createMatAlgo01xDSid({ typed: typed3 });
26576
26689
  const matAlgo02xDS0 = createMatAlgo02xDS0({ typed: typed3, equalScalar: equalScalar3 });
26577
26690
  const matAlgo08xS0Sid = createMatAlgo08xS0Sid({ typed: typed3, equalScalar: equalScalar3 });
26578
- const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix4 });
26691
+ const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix5 });
26579
26692
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
26580
26693
  const matAlgo14xDs = createMatAlgo14xDs({ typed: typed3 });
26581
26694
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
@@ -26641,10 +26754,10 @@ var dependencies153 = ["typed", "matrix", "equalScalar", "DenseMatrix", "concat"
26641
26754
  var createOr = /* @__PURE__ */ factory(
26642
26755
  name153,
26643
26756
  dependencies153,
26644
- ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, DenseMatrix: DenseMatrix4, concat: concat3 }) => {
26757
+ ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, DenseMatrix: DenseMatrix5, concat: concat3 }) => {
26645
26758
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
26646
26759
  const matAlgo05xSfSf = createMatAlgo05xSfSf({ typed: typed3, equalScalar: equalScalar3 });
26647
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
26760
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
26648
26761
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
26649
26762
  typed: typed3,
26650
26763
  matrix: matrix2,
@@ -26680,10 +26793,10 @@ var dependencies154 = ["typed", "matrix", "DenseMatrix", "concat", "SparseMatrix
26680
26793
  var createXor = /* @__PURE__ */ factory(
26681
26794
  name154,
26682
26795
  dependencies154,
26683
- ({ typed: typed3, matrix: matrix2, DenseMatrix: DenseMatrix4, concat: concat3, SparseMatrix }) => {
26796
+ ({ typed: typed3, matrix: matrix2, DenseMatrix: DenseMatrix5, concat: concat3, SparseMatrix }) => {
26684
26797
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
26685
26798
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
26686
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
26799
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
26687
26800
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
26688
26801
  typed: typed3,
26689
26802
  matrix: matrix2,
@@ -26870,12 +26983,12 @@ var createCompare = /* @__PURE__ */ factory(
26870
26983
  matrix: matrix2,
26871
26984
  BigNumber: BigNumber9,
26872
26985
  Fraction: Fraction5,
26873
- DenseMatrix: DenseMatrix4,
26986
+ DenseMatrix: DenseMatrix5,
26874
26987
  concat: concat3
26875
26988
  }) => {
26876
26989
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
26877
26990
  const matAlgo05xSfSf = createMatAlgo05xSfSf({ typed: typed3, equalScalar: equalScalar3 });
26878
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
26991
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
26879
26992
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
26880
26993
  typed: typed3,
26881
26994
  matrix: matrix2,
@@ -27000,10 +27113,10 @@ var dependencies159 = [
27000
27113
  var createLarger = /* @__PURE__ */ factory(
27001
27114
  name159,
27002
27115
  dependencies159,
27003
- ({ typed: typed3, config, bignumber: bignumber2, matrix: matrix2, DenseMatrix: DenseMatrix4, concat: concat3, SparseMatrix }) => {
27116
+ ({ typed: typed3, config, bignumber: bignumber2, matrix: matrix2, DenseMatrix: DenseMatrix5, concat: concat3, SparseMatrix }) => {
27004
27117
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
27005
27118
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
27006
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
27119
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
27007
27120
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
27008
27121
  typed: typed3,
27009
27122
  matrix: matrix2,
@@ -27058,10 +27171,10 @@ var dependencies160 = ["typed", "config", "matrix", "DenseMatrix", "concat", "Sp
27058
27171
  var createLargerEq = /* @__PURE__ */ factory(
27059
27172
  name160,
27060
27173
  dependencies160,
27061
- ({ typed: typed3, config, matrix: matrix2, DenseMatrix: DenseMatrix4, concat: concat3, SparseMatrix }) => {
27174
+ ({ typed: typed3, config, matrix: matrix2, DenseMatrix: DenseMatrix5, concat: concat3, SparseMatrix }) => {
27062
27175
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
27063
27176
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
27064
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
27177
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
27065
27178
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
27066
27179
  typed: typed3,
27067
27180
  matrix: matrix2,
@@ -27124,13 +27237,13 @@ var createSmaller = /* @__PURE__ */ factory(
27124
27237
  config,
27125
27238
  bignumber: bignumber2,
27126
27239
  matrix: matrix2,
27127
- DenseMatrix: DenseMatrix4,
27240
+ DenseMatrix: DenseMatrix5,
27128
27241
  concat: concat3,
27129
27242
  SparseMatrix
27130
27243
  }) => {
27131
27244
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
27132
27245
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
27133
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
27246
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
27134
27247
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
27135
27248
  typed: typed3,
27136
27249
  matrix: matrix2,
@@ -27185,10 +27298,10 @@ var dependencies162 = ["typed", "config", "matrix", "DenseMatrix", "concat", "Sp
27185
27298
  var createSmallerEq = /* @__PURE__ */ factory(
27186
27299
  name162,
27187
27300
  dependencies162,
27188
- ({ typed: typed3, config, matrix: matrix2, DenseMatrix: DenseMatrix4, concat: concat3, SparseMatrix }) => {
27301
+ ({ typed: typed3, config, matrix: matrix2, DenseMatrix: DenseMatrix5, concat: concat3, SparseMatrix }) => {
27189
27302
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
27190
27303
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
27191
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
27304
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
27192
27305
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
27193
27306
  typed: typed3,
27194
27307
  matrix: matrix2,
@@ -27249,13 +27362,13 @@ var createUnequal = /* @__PURE__ */ factory(
27249
27362
  config: _config,
27250
27363
  equalScalar: equalScalar3,
27251
27364
  matrix: matrix2,
27252
- DenseMatrix: DenseMatrix4,
27365
+ DenseMatrix: DenseMatrix5,
27253
27366
  concat: concat3,
27254
27367
  SparseMatrix
27255
27368
  }) => {
27256
27369
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
27257
27370
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
27258
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
27371
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
27259
27372
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
27260
27373
  typed: typed3,
27261
27374
  matrix: matrix2,
@@ -27306,12 +27419,12 @@ var dependencies164 = ["typed", "matrix", "equalScalar", "BigNumber", "DenseMatr
27306
27419
  var createAtan2 = /* @__PURE__ */ factory(
27307
27420
  name164,
27308
27421
  dependencies164,
27309
- ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, BigNumber: BigNumber9, DenseMatrix: DenseMatrix4, concat: concat3 }) => {
27422
+ ({ typed: typed3, matrix: matrix2, equalScalar: equalScalar3, BigNumber: BigNumber9, DenseMatrix: DenseMatrix5, concat: concat3 }) => {
27310
27423
  const matAlgo02xDS0 = createMatAlgo02xDS0({ typed: typed3, equalScalar: equalScalar3 });
27311
27424
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
27312
27425
  const matAlgo09xS0Sf = createMatAlgo09xS0Sf({ typed: typed3, equalScalar: equalScalar3 });
27313
27426
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
27314
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
27427
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
27315
27428
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
27316
27429
  typed: typed3,
27317
27430
  matrix: matrix2,
@@ -27380,14 +27493,14 @@ var createDotPow = /* @__PURE__ */ factory(
27380
27493
  equalScalar: equalScalar3,
27381
27494
  matrix: matrix2,
27382
27495
  pow: pow2,
27383
- DenseMatrix: DenseMatrix4,
27496
+ DenseMatrix: DenseMatrix5,
27384
27497
  concat: concat3,
27385
27498
  SparseMatrix
27386
27499
  }) => {
27387
27500
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
27388
27501
  const matAlgo07xSSf = createMatAlgo07xSSf({ typed: typed3, SparseMatrix });
27389
27502
  const matAlgo11xS0s = createMatAlgo11xS0s({ typed: typed3, equalScalar: equalScalar3 });
27390
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
27503
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
27391
27504
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
27392
27505
  typed: typed3,
27393
27506
  matrix: matrix2,
@@ -27444,8 +27557,8 @@ var createFixNumber = /* @__PURE__ */ factory(
27444
27557
  var createFix = /* @__PURE__ */ factory(
27445
27558
  name167,
27446
27559
  dependencies167,
27447
- ({ typed: typed3, Complex: Complex10, matrix: matrix2, ceil: ceil2, floor: floor2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix4 }) => {
27448
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
27560
+ ({ typed: typed3, Complex: Complex10, matrix: matrix2, ceil: ceil2, floor: floor2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix5 }) => {
27561
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
27449
27562
  const matAlgo14xDs = createMatAlgo14xDs({ typed: typed3 });
27450
27563
  const fixNumber = createFixNumber({ typed: typed3, ceil: ceil2, floor: floor2 });
27451
27564
  return typed3("fix", {
@@ -30448,7 +30561,7 @@ var createFft = /* @__PURE__ */ factory(
30448
30561
  divideScalar: divideScalar2,
30449
30562
  exp: exp2,
30450
30563
  tau: tau2,
30451
- i: I,
30564
+ i: I2,
30452
30565
  dotDivide: dotDivide2,
30453
30566
  conj: conj3,
30454
30567
  pow: pow2,
@@ -30496,7 +30609,7 @@ var createFft = /* @__PURE__ */ factory(
30496
30609
  }
30497
30610
  function _czt(arr) {
30498
30611
  const n = arr.length;
30499
- const w = exp2(divideScalar2(multiplyScalar2(-1, multiplyScalar2(I, tau2)), n));
30612
+ const w = exp2(divideScalar2(multiplyScalar2(-1, multiplyScalar2(I2, tau2)), n));
30500
30613
  const chirp = [];
30501
30614
  for (let i = 1 - n; i < n; i++) {
30502
30615
  chirp.push(pow2(w, divideScalar2(pow2(i, 2), 2)));
@@ -30563,7 +30676,7 @@ var createFft = /* @__PURE__ */ factory(
30563
30676
  const p = ret[k];
30564
30677
  const q = multiplyScalar2(
30565
30678
  ret[k + length / 2],
30566
- exp2(multiplyScalar2(multiplyScalar2(tau2, I), divideScalar2(-k, length)))
30679
+ exp2(multiplyScalar2(multiplyScalar2(tau2, I2), divideScalar2(-k, length)))
30567
30680
  );
30568
30681
  ret[k] = addScalar2(p, q);
30569
30682
  ret[k + length / 2] = addScalar2(p, multiplyScalar2(-1, q));
@@ -30709,15 +30822,15 @@ var createSubtract = /* @__PURE__ */ factory(
30709
30822
  equalScalar: equalScalar3,
30710
30823
  subtractScalar: subtractScalar2,
30711
30824
  unaryMinus: _unaryMinus,
30712
- DenseMatrix: DenseMatrix4,
30825
+ DenseMatrix: DenseMatrix5,
30713
30826
  concat: concat3,
30714
30827
  nodeOperations: nodeOperations2
30715
30828
  }) => {
30716
30829
  const matAlgo01xDSid = createMatAlgo01xDSid({ typed: typed3 });
30717
30830
  const matAlgo03xDSf = createMatAlgo03xDSf({ typed: typed3 });
30718
30831
  const matAlgo05xSfSf = createMatAlgo05xSfSf({ typed: typed3, equalScalar: equalScalar3 });
30719
- const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix4 });
30720
- const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix4 });
30832
+ const matAlgo10xSids = createMatAlgo10xSids({ typed: typed3, DenseMatrix: DenseMatrix5 });
30833
+ const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix5 });
30721
30834
  const matrixAlgorithmSuite = createMatrixAlgorithmSuite({
30722
30835
  typed: typed3,
30723
30836
  matrix: matrix2,
@@ -34457,8 +34570,8 @@ var dependencies207 = ["smaller", "DenseMatrix"];
34457
34570
  var createImmutableDenseMatrixClass = /* @__PURE__ */ factory(
34458
34571
  name207,
34459
34572
  dependencies207,
34460
- ({ smaller: smaller2, DenseMatrix: DenseMatrix4 }) => {
34461
- class ImmutableDenseMatrix extends DenseMatrix4 {
34573
+ ({ smaller: smaller2, DenseMatrix: DenseMatrix5 }) => {
34574
+ class ImmutableDenseMatrix extends DenseMatrix5 {
34462
34575
  /**
34463
34576
  * Type identifier
34464
34577
  */
@@ -34498,7 +34611,7 @@ var createImmutableDenseMatrixClass = /* @__PURE__ */ factory(
34498
34611
  throw new Error("Invalid datatype: " + datatype);
34499
34612
  }
34500
34613
  if (isMatrix(data) || isArray(data)) {
34501
- const matrix2 = new DenseMatrix4(data, datatype);
34614
+ const matrix2 = new DenseMatrix5(data, datatype);
34502
34615
  this._data = matrix2._data;
34503
34616
  this._size = matrix2._size;
34504
34617
  this._datatype = matrix2._datatype;
@@ -34537,7 +34650,7 @@ var createImmutableDenseMatrixClass = /* @__PURE__ */ factory(
34537
34650
  subset(index, _replacement, _defaultValue) {
34538
34651
  switch (arguments.length) {
34539
34652
  case 1: {
34540
- const m = DenseMatrix4.prototype.subset.call(this, index);
34653
+ const m = DenseMatrix5.prototype.subset.call(this, index);
34541
34654
  if (isMatrix(m)) {
34542
34655
  const mm = m;
34543
34656
  return new ImmutableDenseMatrix({
@@ -34649,7 +34762,7 @@ var createImmutableDenseMatrixClass = /* @__PURE__ */ factory(
34649
34762
  if (this._min === null) {
34650
34763
  let m = null;
34651
34764
  const smallerFn = smaller2;
34652
- DenseMatrix4.prototype.forEach.call(this, function(v) {
34765
+ DenseMatrix5.prototype.forEach.call(this, function(v) {
34653
34766
  if (m === null || smallerFn(v, m)) {
34654
34767
  m = v;
34655
34768
  }
@@ -34666,7 +34779,7 @@ var createImmutableDenseMatrixClass = /* @__PURE__ */ factory(
34666
34779
  if (this._max === null) {
34667
34780
  let m = null;
34668
34781
  const smallerFn = smaller2;
34669
- DenseMatrix4.prototype.forEach.call(this, function(v) {
34782
+ DenseMatrix5.prototype.forEach.call(this, function(v) {
34670
34783
  if (m === null || smallerFn(m, v)) {
34671
34784
  m = v;
34672
34785
  }
@@ -34676,7 +34789,7 @@ var createImmutableDenseMatrixClass = /* @__PURE__ */ factory(
34676
34789
  return this._max ?? void 0;
34677
34790
  }
34678
34791
  }
34679
- Object.setPrototypeOf(ImmutableDenseMatrix.prototype, DenseMatrix4.prototype);
34792
+ Object.setPrototypeOf(ImmutableDenseMatrix.prototype, DenseMatrix5.prototype);
34680
34793
  const proto = ImmutableDenseMatrix.prototype;
34681
34794
  proto.constructor = ImmutableDenseMatrix;
34682
34795
  proto.type = "ImmutableDenseMatrix";
@@ -35056,7 +35169,7 @@ var createLup = /* @__PURE__ */ factory(
35056
35169
  larger: larger2,
35057
35170
  equalScalar: equalScalar3,
35058
35171
  unaryMinus: unaryMinus2,
35059
- DenseMatrix: DenseMatrix4,
35172
+ DenseMatrix: DenseMatrix5,
35060
35173
  SparseMatrix,
35061
35174
  Spa
35062
35175
  }) => {
@@ -35115,11 +35228,11 @@ var createLup = /* @__PURE__ */ factory(
35115
35228
  for (let i2 = 0; i2 < rows; i2++) {
35116
35229
  p2[i2] = permAlloc.array[i2];
35117
35230
  }
35118
- const l2 = new DenseMatrix4({
35231
+ const l2 = new DenseMatrix5({
35119
35232
  data: ldata2,
35120
35233
  size: [rows, n]
35121
35234
  });
35122
- const u2 = new DenseMatrix4({
35235
+ const u2 = new DenseMatrix5({
35123
35236
  data: udata2,
35124
35237
  size: [n, columns]
35125
35238
  });
@@ -35176,7 +35289,7 @@ var createLup = /* @__PURE__ */ factory(
35176
35289
  }
35177
35290
  if (j !== pi) {
35178
35291
  p[j] = [p[pi], p[pi] = p[j]][0];
35179
- DenseMatrix4._swapRows(j, pi, data);
35292
+ DenseMatrix5._swapRows(j, pi, data);
35180
35293
  }
35181
35294
  if (j < rows) {
35182
35295
  for (i = j + 1; i < rows; i++) {
@@ -35221,11 +35334,11 @@ var createLup = /* @__PURE__ */ factory(
35221
35334
  }
35222
35335
  }
35223
35336
  }
35224
- const l = new DenseMatrix4({
35337
+ const l = new DenseMatrix5({
35225
35338
  data: ldata,
35226
35339
  size: lsize
35227
35340
  });
35228
- const u = new DenseMatrix4({
35341
+ const u = new DenseMatrix5({
35229
35342
  data: udata,
35230
35343
  size: usize
35231
35344
  });
@@ -36763,7 +36876,7 @@ var dependencies227 = ["typed", "size", "subset", "compareNatural", "Index", "De
36763
36876
  var createSetCartesian = /* @__PURE__ */ factory(
36764
36877
  name227,
36765
36878
  dependencies227,
36766
- ({ typed: typed3, size: size2, subset: subset2, compareNatural: compareNatural3, Index: Index2, DenseMatrix: DenseMatrix4 }) => {
36879
+ ({ typed: typed3, size: size2, subset: subset2, compareNatural: compareNatural3, Index: Index2, DenseMatrix: DenseMatrix5 }) => {
36767
36880
  return typed3(name227, {
36768
36881
  "Array | Matrix, Array | Matrix": function(a1, a2) {
36769
36882
  let result = [];
@@ -36780,7 +36893,7 @@ var createSetCartesian = /* @__PURE__ */ factory(
36780
36893
  if (Array.isArray(a1) && Array.isArray(a2)) {
36781
36894
  return result;
36782
36895
  }
36783
- return new DenseMatrix4(result);
36896
+ return new DenseMatrix5(result);
36784
36897
  }
36785
36898
  });
36786
36899
  }
@@ -36792,7 +36905,7 @@ var dependencies228 = ["typed", "size", "subset", "compareNatural", "Index", "De
36792
36905
  var createSetDifference = /* @__PURE__ */ factory(
36793
36906
  name228,
36794
36907
  dependencies228,
36795
- ({ typed: typed3, size: size2, subset: subset2, compareNatural: compareNatural3, Index: Index2, DenseMatrix: DenseMatrix4 }) => {
36908
+ ({ typed: typed3, size: size2, subset: subset2, compareNatural: compareNatural3, Index: Index2, DenseMatrix: DenseMatrix5 }) => {
36796
36909
  return typed3(name228, {
36797
36910
  "Array | Matrix, Array | Matrix": function(a1, a2) {
36798
36911
  let result;
@@ -36821,7 +36934,7 @@ var createSetDifference = /* @__PURE__ */ factory(
36821
36934
  if (Array.isArray(a1) && Array.isArray(a2)) {
36822
36935
  return generalize(result);
36823
36936
  }
36824
- return new DenseMatrix4(generalize(result));
36937
+ return new DenseMatrix5(generalize(result));
36825
36938
  }
36826
36939
  });
36827
36940
  }
@@ -36833,7 +36946,7 @@ var dependencies229 = ["typed", "size", "subset", "compareNatural", "Index", "De
36833
36946
  var createSetDistinct = /* @__PURE__ */ factory(
36834
36947
  name229,
36835
36948
  dependencies229,
36836
- ({ typed: typed3, size: size2, subset: subset2, compareNatural: compareNatural3, Index: Index2, DenseMatrix: DenseMatrix4 }) => {
36949
+ ({ typed: typed3, size: size2, subset: subset2, compareNatural: compareNatural3, Index: Index2, DenseMatrix: DenseMatrix5 }) => {
36837
36950
  return typed3(name229, {
36838
36951
  "Array | Matrix": function(a) {
36839
36952
  let result;
@@ -36852,7 +36965,7 @@ var createSetDistinct = /* @__PURE__ */ factory(
36852
36965
  if (Array.isArray(a)) {
36853
36966
  return result;
36854
36967
  }
36855
- return new DenseMatrix4(result);
36968
+ return new DenseMatrix5(result);
36856
36969
  }
36857
36970
  });
36858
36971
  }
@@ -36864,7 +36977,7 @@ var dependencies230 = ["typed", "size", "subset", "compareNatural", "Index", "De
36864
36977
  var createSetIntersect = /* @__PURE__ */ factory(
36865
36978
  name230,
36866
36979
  dependencies230,
36867
- ({ typed: typed3, size: size2, subset: subset2, compareNatural: compareNatural3, Index: Index2, DenseMatrix: DenseMatrix4 }) => {
36980
+ ({ typed: typed3, size: size2, subset: subset2, compareNatural: compareNatural3, Index: Index2, DenseMatrix: DenseMatrix5 }) => {
36868
36981
  return typed3(name230, {
36869
36982
  "Array | Matrix, Array | Matrix": function(a1, a2) {
36870
36983
  let result;
@@ -36886,7 +36999,7 @@ var createSetIntersect = /* @__PURE__ */ factory(
36886
36999
  if (Array.isArray(a1) && Array.isArray(a2)) {
36887
37000
  return generalize(result);
36888
37001
  }
36889
- return new DenseMatrix4(generalize(result));
37002
+ return new DenseMatrix5(generalize(result));
36890
37003
  }
36891
37004
  });
36892
37005
  }
@@ -38552,15 +38665,15 @@ function createComplexEigs({
38552
38665
  for (let i = 0; i < N; i++) {
38553
38666
  M[i] = Array(N).fill(0);
38554
38667
  }
38555
- let I = 0;
38668
+ let I2 = 0;
38556
38669
  for (const sub of arr) {
38557
38670
  const n = sub.length;
38558
38671
  for (let i = 0; i < n; i++) {
38559
38672
  for (let j = 0; j < n; j++) {
38560
- M[I + i][I + j] = sub[i][j];
38673
+ M[I2 + i][I2 + j] = sub[i][j];
38561
38674
  }
38562
38675
  }
38563
- I += n;
38676
+ I2 += n;
38564
38677
  }
38565
38678
  return M;
38566
38679
  }
@@ -39309,9 +39422,9 @@ var dependencies240 = ["typed", "matrix", "lup", "slu", "usolve", "lsolve", "Den
39309
39422
  var createLusolve = /* @__PURE__ */ factory(
39310
39423
  name240,
39311
39424
  dependencies240,
39312
- ({ typed: typed3, matrix: matrix2, lup: lup2, slu: slu2, usolve: usolve2, lsolve: lsolve2, DenseMatrix: DenseMatrix4 }) => {
39425
+ ({ typed: typed3, matrix: matrix2, lup: lup2, slu: slu2, usolve: usolve2, lsolve: lsolve2, DenseMatrix: DenseMatrix5 }) => {
39313
39426
  const solveValidation = createSolveValidation({
39314
- DenseMatrix: DenseMatrix4
39427
+ DenseMatrix: DenseMatrix5
39315
39428
  });
39316
39429
  return typed3(name240, {
39317
39430
  "Array, Array | Matrix": function(a, b) {
@@ -39394,7 +39507,7 @@ var createLusolve = /* @__PURE__ */ factory(
39394
39507
  for (let i = 0; i < rows; i++) {
39395
39508
  x[i] = [resultAlloc.array[i]];
39396
39509
  }
39397
- return new DenseMatrix4({
39510
+ return new DenseMatrix5({
39398
39511
  data: x,
39399
39512
  size: [rows, 1]
39400
39513
  });
@@ -41856,7 +41969,7 @@ var createRotationMatrix = /* @__PURE__ */ factory(
41856
41969
  norm: norm3,
41857
41970
  BigNumber: BigNumber9,
41858
41971
  matrix: matrix2,
41859
- DenseMatrix: DenseMatrix4,
41972
+ DenseMatrix: DenseMatrix5,
41860
41973
  SparseMatrix,
41861
41974
  cos: cos2,
41862
41975
  sin: sin2
@@ -41920,7 +42033,7 @@ var createRotationMatrix = /* @__PURE__ */ factory(
41920
42033
  return new SparseMatrix(data);
41921
42034
  }
41922
42035
  if (format6 === "dense") {
41923
- return new DenseMatrix4(data);
42036
+ return new DenseMatrix5(data);
41924
42037
  }
41925
42038
  throw new TypeError(`Unknown matrix type "${format6}"`);
41926
42039
  }
@@ -42687,8 +42800,9 @@ factoryScope.add = factoryScope.addScalar;
42687
42800
  var trace2 = createTrace(factoryScope);
42688
42801
  factoryScope.trace = trace2;
42689
42802
  factoryScope.multiply = factoryScope.multiplyScalar;
42690
- var det = createDet(factoryScope);
42691
- factoryScope.det = det;
42803
+ var factoryDet = createDet(factoryScope);
42804
+ factoryScope.det = factoryDet;
42805
+ var det = ((m) => acceleratedDet(m, factoryDet));
42692
42806
  factoryScope.isInteger = (x) => typeof x === "number" && Number.isInteger(x);
42693
42807
  var reshape2 = createReshape(factoryScope);
42694
42808
  factoryScope.reshape = reshape2;
@@ -42704,8 +42818,9 @@ var resize2 = createResize(factoryScope);
42704
42818
  factoryScope.resize = resize2;
42705
42819
  var subset = createSubset(factoryScope);
42706
42820
  factoryScope.subset = subset;
42707
- var inv = createInv(factoryScope);
42708
- factoryScope.inv = inv;
42821
+ var factoryInv = createInv(factoryScope);
42822
+ factoryScope.inv = factoryInv;
42823
+ var inv = ((m) => acceleratedInv(m, factoryInv));
42709
42824
  var factory_cbrt = createCbrt(factoryScope);
42710
42825
  factoryScope.cbrt = factory_cbrt;
42711
42826
  var nthRoots = createNthRoots(factoryScope);
@@ -43145,6 +43260,14 @@ var mathScope = {
43145
43260
  pi: Math.PI,
43146
43261
  e: Math.E,
43147
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,
43148
43271
  Infinity: Infinity,
43149
43272
  NaN: NaN,
43150
43273
  null: null,
@@ -44950,6 +45073,24 @@ function help(search) {
44950
45073
  }
44951
45074
  return new Help(doc);
44952
45075
  }
45076
+
45077
+ // src/grad-forward.ts
45078
+ import { Dual as Dual3 } from "@danielsimonjr/mathts-core";
45079
+ function derivativeAt(fn, x0) {
45080
+ return fn(Dual3.variable(x0)).deriv;
45081
+ }
45082
+ function valueAndDerivativeAt(fn, x0) {
45083
+ const r = fn(Dual3.variable(x0));
45084
+ return { value: r.value, deriv: r.deriv };
45085
+ }
45086
+ function gradientAt(fn, x) {
45087
+ const grad = new Array(x.length);
45088
+ for (let k = 0; k < x.length; k++) {
45089
+ const duals = x.map((xi, i) => i === k ? Dual3.variable(xi) : Dual3.constant(xi));
45090
+ grad[k] = fn(duals).deriv;
45091
+ }
45092
+ return grad;
45093
+ }
44953
45094
  export {
44954
45095
  ARRAY_WORKER_THRESHOLD,
44955
45096
  CAS_BATCH_THRESHOLD,
@@ -45109,6 +45250,7 @@ export {
45109
45250
  degree,
45110
45251
  delaunayTriangulation,
45111
45252
  derivative,
45253
+ derivativeAt,
45112
45254
  det,
45113
45255
  deuteronMass,
45114
45256
  diag,
@@ -45279,6 +45421,7 @@ export {
45279
45421
  gpuMatmul,
45280
45422
  gpuScale,
45281
45423
  gpuTranspose,
45424
+ gradientAt,
45282
45425
  gradientSymbolic,
45283
45426
  graphDistance,
45284
45427
  gravitationConstant,
@@ -45678,6 +45821,7 @@ export {
45678
45821
  usolveAll,
45679
45822
  vacuumImpedance,
45680
45823
  validateClosureSource,
45824
+ valueAndDerivativeAt,
45681
45825
  variables,
45682
45826
  variance,
45683
45827
  voronoiDiagram,