mathjs 13.2.3 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. package/HISTORY.md +18 -0
  2. package/lib/browser/math.js +1 -1
  3. package/lib/browser/math.js.LICENSE.txt +1 -9
  4. package/lib/browser/math.js.map +1 -1
  5. package/lib/cjs/core/function/import.js +4 -1
  6. package/lib/cjs/core/function/typed.js +1 -1
  7. package/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js +2 -0
  8. package/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js +2 -0
  9. package/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js +2 -0
  10. package/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js +2 -0
  11. package/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js +2 -0
  12. package/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js +2 -0
  13. package/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js +2 -0
  14. package/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js +2 -0
  15. package/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js +2 -0
  16. package/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js +2 -0
  17. package/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js +2 -0
  18. package/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js +2 -0
  19. package/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js +2 -0
  20. package/lib/cjs/entry/impureFunctionsAny.generated.js +1 -0
  21. package/lib/cjs/entry/impureFunctionsNumber.generated.js +1 -0
  22. package/lib/cjs/entry/pureFunctionsAny.generated.js +11 -0
  23. package/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js +2 -2
  24. package/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js +2 -2
  25. package/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js +2 -2
  26. package/lib/cjs/expression/parse.js +26 -36
  27. package/lib/cjs/function/algebra/simplify.js +4 -3
  28. package/lib/cjs/function/algebra/simplifyConstant.js +5 -11
  29. package/lib/cjs/function/arithmetic/ceil.js +21 -2
  30. package/lib/cjs/function/arithmetic/dotDivide.js +4 -3
  31. package/lib/cjs/function/arithmetic/dotPow.js +4 -3
  32. package/lib/cjs/function/arithmetic/fix.js +24 -5
  33. package/lib/cjs/function/arithmetic/floor.js +21 -2
  34. package/lib/cjs/function/arithmetic/log.js +12 -4
  35. package/lib/cjs/function/arithmetic/pow.js +2 -2
  36. package/lib/cjs/function/arithmetic/round.js +3 -5
  37. package/lib/cjs/function/arithmetic/sign.js +1 -1
  38. package/lib/cjs/function/bitwise/bitXor.js +4 -3
  39. package/lib/cjs/function/logical/xor.js +4 -3
  40. package/lib/cjs/function/relational/equal.js +4 -3
  41. package/lib/cjs/function/relational/larger.js +4 -3
  42. package/lib/cjs/function/relational/largerEq.js +4 -3
  43. package/lib/cjs/function/relational/smaller.js +4 -3
  44. package/lib/cjs/function/relational/smallerEq.js +4 -3
  45. package/lib/cjs/function/relational/unequal.js +4 -3
  46. package/lib/cjs/function/utils/isInteger.js +1 -1
  47. package/lib/cjs/function/utils/isNegative.js +1 -1
  48. package/lib/cjs/function/utils/isPositive.js +1 -1
  49. package/lib/cjs/header.js +1 -1
  50. package/lib/cjs/type/bignumber/function/bignumber.js +2 -2
  51. package/lib/cjs/type/fraction/Fraction.js +4 -4
  52. package/lib/cjs/type/fraction/function/fraction.js +3 -0
  53. package/lib/cjs/type/matrix/utils/matAlgo07xSSf.js +39 -43
  54. package/lib/cjs/type/unit/Unit.js +1 -1
  55. package/lib/cjs/utils/string.js +2 -2
  56. package/lib/cjs/version.js +1 -1
  57. package/lib/esm/core/function/import.js +4 -1
  58. package/lib/esm/core/function/typed.js +1 -1
  59. package/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js +2 -0
  60. package/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js +2 -0
  61. package/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js +2 -0
  62. package/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js +2 -0
  63. package/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js +2 -0
  64. package/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js +2 -0
  65. package/lib/esm/entry/dependenciesAny/dependenciesLog.generated.js +2 -0
  66. package/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js +2 -0
  67. package/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js +2 -0
  68. package/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js +2 -0
  69. package/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js +2 -0
  70. package/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js +2 -0
  71. package/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js +2 -0
  72. package/lib/esm/entry/impureFunctionsAny.generated.js +1 -0
  73. package/lib/esm/entry/impureFunctionsNumber.generated.js +1 -0
  74. package/lib/esm/entry/pureFunctionsAny.generated.js +11 -0
  75. package/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js +2 -2
  76. package/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js +2 -2
  77. package/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js +2 -2
  78. package/lib/esm/expression/parse.js +26 -36
  79. package/lib/esm/function/algebra/simplify.js +4 -3
  80. package/lib/esm/function/algebra/simplifyConstant.js +5 -11
  81. package/lib/esm/function/arithmetic/ceil.js +21 -2
  82. package/lib/esm/function/arithmetic/dotDivide.js +4 -3
  83. package/lib/esm/function/arithmetic/dotPow.js +4 -3
  84. package/lib/esm/function/arithmetic/fix.js +24 -5
  85. package/lib/esm/function/arithmetic/floor.js +21 -2
  86. package/lib/esm/function/arithmetic/log.js +12 -4
  87. package/lib/esm/function/arithmetic/pow.js +2 -2
  88. package/lib/esm/function/arithmetic/round.js +3 -5
  89. package/lib/esm/function/arithmetic/sign.js +1 -1
  90. package/lib/esm/function/bitwise/bitXor.js +4 -3
  91. package/lib/esm/function/logical/xor.js +4 -3
  92. package/lib/esm/function/relational/equal.js +4 -3
  93. package/lib/esm/function/relational/larger.js +4 -3
  94. package/lib/esm/function/relational/largerEq.js +4 -3
  95. package/lib/esm/function/relational/smaller.js +4 -3
  96. package/lib/esm/function/relational/smallerEq.js +4 -3
  97. package/lib/esm/function/relational/unequal.js +4 -3
  98. package/lib/esm/function/utils/isInteger.js +1 -1
  99. package/lib/esm/function/utils/isNegative.js +1 -1
  100. package/lib/esm/function/utils/isPositive.js +1 -1
  101. package/lib/esm/type/bignumber/function/bignumber.js +2 -2
  102. package/lib/esm/type/fraction/Fraction.js +4 -4
  103. package/lib/esm/type/fraction/function/fraction.js +3 -0
  104. package/lib/esm/type/matrix/utils/matAlgo07xSSf.js +39 -43
  105. package/lib/esm/type/unit/Unit.js +1 -1
  106. package/lib/esm/utils/string.js +2 -2
  107. package/lib/esm/version.js +1 -1
  108. package/package.json +2 -2
  109. package/types/index.d.ts +110 -18
@@ -7,31 +7,30 @@ exports.createMatAlgo07xSSf = void 0;
7
7
  var _factory = require("../../../utils/factory.js");
8
8
  var _DimensionError = require("../../../error/DimensionError.js");
9
9
  const name = 'matAlgo07xSSf';
10
- const dependencies = ['typed', 'DenseMatrix'];
10
+ const dependencies = ['typed', 'SparseMatrix'];
11
11
  const createMatAlgo07xSSf = exports.createMatAlgo07xSSf = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => {
12
12
  let {
13
13
  typed,
14
- DenseMatrix
14
+ SparseMatrix
15
15
  } = _ref;
16
16
  /**
17
- * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij).
18
- * Callback function invoked MxN times.
19
- *
20
- * C(i,j) = f(Aij, Bij)
21
- *
22
- * @param {Matrix} a The SparseMatrix instance (A)
23
- * @param {Matrix} b The SparseMatrix instance (B)
24
- * @param {Function} callback The f(Aij,Bij) operation to invoke
25
- *
26
- * @return {Matrix} DenseMatrix (C)
27
- *
28
- * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294
29
- */
17
+ * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij).
18
+ * Callback function invoked MxN times.
19
+ *
20
+ * C(i,j) = f(Aij, Bij)
21
+ *
22
+ * @param {Matrix} a The SparseMatrix instance (A)
23
+ * @param {Matrix} b The SparseMatrix instance (B)
24
+ * @param {Function} callback The f(Aij,Bij) operation to invoke
25
+ *
26
+ * @return {Matrix} SparseMatrix (C)
27
+ *
28
+ * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294
29
+ */
30
30
  return function matAlgo07xSSf(a, b, callback) {
31
31
  // sparse matrix arrays
32
32
  const asize = a._size;
33
33
  const adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();
34
- // sparse matrix arrays
35
34
  const bsize = b._size;
36
35
  const bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();
37
36
 
@@ -39,8 +38,6 @@ const createMatAlgo07xSSf = exports.createMatAlgo07xSSf = /* #__PURE__ */(0, _fa
39
38
  if (asize.length !== bsize.length) {
40
39
  throw new _DimensionError.DimensionError(asize.length, bsize.length);
41
40
  }
42
-
43
- // check rows & columns
44
41
  if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {
45
42
  throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');
46
43
  }
@@ -51,59 +48,58 @@ const createMatAlgo07xSSf = exports.createMatAlgo07xSSf = /* #__PURE__ */(0, _fa
51
48
 
52
49
  // datatype
53
50
  let dt;
54
- // zero value
55
51
  let zero = 0;
56
- // callback signature to use
57
52
  let cf = callback;
58
53
 
59
54
  // process data types
60
55
  if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {
61
- // datatype
62
56
  dt = adt;
63
- // convert 0 to the same datatype
64
57
  zero = typed.convert(0, dt);
65
- // callback
66
58
  cf = typed.find(callback, [dt, dt]);
67
59
  }
68
60
 
69
- // vars
70
- let i, j;
71
-
72
- // result arrays
73
- const cdata = [];
74
- // initialize c
75
- for (i = 0; i < rows; i++) {
76
- cdata[i] = [];
77
- }
61
+ // result arrays for sparse format
62
+ const cvalues = [];
63
+ const cindex = [];
64
+ const cptr = new Array(columns + 1).fill(0); // Start with column pointer array
78
65
 
79
66
  // workspaces
80
67
  const xa = [];
81
68
  const xb = [];
82
- // marks indicating we have a value in x for a given column
83
69
  const wa = [];
84
70
  const wb = [];
85
71
 
86
72
  // loop columns
87
- for (j = 0; j < columns; j++) {
88
- // columns mark
73
+ for (let j = 0; j < columns; j++) {
89
74
  const mark = j + 1;
90
- // scatter the values of A(:,j) into workspace
75
+ let nonZeroCount = 0;
91
76
  _scatter(a, j, wa, xa, mark);
92
- // scatter the values of B(:,j) into workspace
93
77
  _scatter(b, j, wb, xb, mark);
78
+
94
79
  // loop rows
95
- for (i = 0; i < rows; i++) {
96
- // matrix values @ i,j
80
+ for (let i = 0; i < rows; i++) {
97
81
  const va = wa[i] === mark ? xa[i] : zero;
98
82
  const vb = wb[i] === mark ? xb[i] : zero;
83
+
99
84
  // invoke callback
100
- cdata[i][j] = cf(va, vb);
85
+ const cij = cf(va, vb);
86
+ // Store all non zero and true values
87
+ if (cij !== 0 && cij !== false) {
88
+ cindex.push(i); // row index
89
+ cvalues.push(cij); // computed value
90
+ nonZeroCount++;
91
+ }
101
92
  }
93
+
94
+ // Update column pointer with cumulative count of non-zero values
95
+ cptr[j + 1] = cptr[j] + nonZeroCount;
102
96
  }
103
97
 
104
- // return dense matrix
105
- return new DenseMatrix({
106
- data: cdata,
98
+ // Return the result as a sparse matrix
99
+ return new SparseMatrix({
100
+ values: cvalues,
101
+ index: cindex,
102
+ ptr: cptr,
107
103
  size: [rows, columns],
108
104
  datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined
109
105
  });
@@ -3540,7 +3540,7 @@ const createUnitClass = exports.createUnitClass = /* #__PURE__ */(0, _factory.fa
3540
3540
  */
3541
3541
  Unit.typeConverters = {
3542
3542
  BigNumber: function (x) {
3543
- if (x !== null && x !== void 0 && x.isFraction) return new BigNumber(x.n).div(x.d).times(x.s);
3543
+ if (x !== null && x !== void 0 && x.isFraction) return new BigNumber(String(x.n)).div(String(x.d)).times(String(x.s));
3544
3544
  return new BigNumber(x + ''); // stringify to prevent constructor error
3545
3545
  },
3546
3546
  Fraction: function (x) {
@@ -80,7 +80,7 @@ function _format(value, options) {
80
80
  if (looksLikeFraction(value)) {
81
81
  if (!options || options.fraction !== 'decimal') {
82
82
  // output as ratio, like '1/3'
83
- return value.s * value.n + '/' + value.d;
83
+ return `${value.s * value.n}/${value.d}`;
84
84
  } else {
85
85
  // output as decimal, like '0.(3)'
86
86
  return value.toString();
@@ -182,7 +182,7 @@ function formatArray(array, options) {
182
182
  * @return {boolean}
183
183
  */
184
184
  function looksLikeFraction(value) {
185
- return value && typeof value === 'object' && typeof value.s === 'number' && typeof value.n === 'number' && typeof value.d === 'number' || false;
185
+ return value && typeof value === 'object' && typeof value.s === 'bigint' && typeof value.n === 'bigint' && typeof value.d === 'bigint' || false;
186
186
  }
187
187
 
188
188
  /**
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- const version = exports.version = '13.2.3';
7
+ const version = exports.version = '14.0.0';
8
8
  // Note: This file is automatically generated when building math.js.
9
9
  // Changes made in this file will be overwritten.
@@ -120,6 +120,7 @@ export function importFactory(typed, load, math, importedFactories) {
120
120
  * @private
121
121
  */
122
122
  function _import(name, value, options) {
123
+ var _math$Unit;
123
124
  // TODO: refactor this function, it's to complicated and contains duplicate code
124
125
  if (options.wrap && typeof value === 'function') {
125
126
  // create a wrapper around the function
@@ -148,7 +149,9 @@ export function importFactory(typed, load, math, importedFactories) {
148
149
  });
149
150
  return;
150
151
  }
151
- if (math[name] === undefined || options.override) {
152
+ var isDefined = math[name] !== undefined;
153
+ var isValuelessUnit = (_math$Unit = math.Unit) === null || _math$Unit === void 0 ? void 0 : _math$Unit.isValuelessUnit(name);
154
+ if (!isDefined && !isValuelessUnit || options.override) {
152
155
  math[name] = value;
153
156
  delete importedFactories[name];
154
157
  _importTransform(name, value);
@@ -259,7 +259,7 @@ export var createTyped = /* #__PURE__ */factory('typed', dependencies, function
259
259
  if (!Fraction) {
260
260
  throwNoFraction(x);
261
261
  }
262
- return new Fraction(x.toString());
262
+ return new Fraction(x);
263
263
  }
264
264
  }, {
265
265
  from: 'Fraction',
@@ -3,12 +3,14 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { matrixDependencies } from './dependenciesMatrix.generated.js';
8
9
  import { typedDependencies } from './dependenciesTyped.generated.js';
9
10
  import { createBitXor } from '../../factoriesAny.js';
10
11
  export var bitXorDependencies = {
11
12
  DenseMatrixDependencies,
13
+ SparseMatrixDependencies,
12
14
  concatDependencies,
13
15
  matrixDependencies,
14
16
  typedDependencies,
@@ -3,6 +3,7 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js';
8
9
  import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js';
@@ -11,6 +12,7 @@ import { typedDependencies } from './dependenciesTyped.generated.js';
11
12
  import { createDotDivide } from '../../factoriesAny.js';
12
13
  export var dotDivideDependencies = {
13
14
  DenseMatrixDependencies,
15
+ SparseMatrixDependencies,
14
16
  concatDependencies,
15
17
  divideScalarDependencies,
16
18
  equalScalarDependencies,
@@ -3,6 +3,7 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js';
8
9
  import { matrixDependencies } from './dependenciesMatrix.generated.js';
@@ -11,6 +12,7 @@ import { typedDependencies } from './dependenciesTyped.generated.js';
11
12
  import { createDotPow } from '../../factoriesAny.js';
12
13
  export var dotPowDependencies = {
13
14
  DenseMatrixDependencies,
15
+ SparseMatrixDependencies,
14
16
  concatDependencies,
15
17
  equalScalarDependencies,
16
18
  matrixDependencies,
@@ -3,6 +3,7 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js';
8
9
  import { matrixDependencies } from './dependenciesMatrix.generated.js';
@@ -10,6 +11,7 @@ import { typedDependencies } from './dependenciesTyped.generated.js';
10
11
  import { createEqual } from '../../factoriesAny.js';
11
12
  export var equalDependencies = {
12
13
  DenseMatrixDependencies,
14
+ SparseMatrixDependencies,
13
15
  concatDependencies,
14
16
  equalScalarDependencies,
15
17
  matrixDependencies,
@@ -3,12 +3,14 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { matrixDependencies } from './dependenciesMatrix.generated.js';
8
9
  import { typedDependencies } from './dependenciesTyped.generated.js';
9
10
  import { createLarger } from '../../factoriesAny.js';
10
11
  export var largerDependencies = {
11
12
  DenseMatrixDependencies,
13
+ SparseMatrixDependencies,
12
14
  concatDependencies,
13
15
  matrixDependencies,
14
16
  typedDependencies,
@@ -3,12 +3,14 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { matrixDependencies } from './dependenciesMatrix.generated.js';
8
9
  import { typedDependencies } from './dependenciesTyped.generated.js';
9
10
  import { createLargerEq } from '../../factoriesAny.js';
10
11
  export var largerEqDependencies = {
11
12
  DenseMatrixDependencies,
13
+ SparseMatrixDependencies,
12
14
  concatDependencies,
13
15
  matrixDependencies,
14
16
  typedDependencies,
@@ -4,11 +4,13 @@
4
4
  */
5
5
  import { ComplexDependencies } from './dependenciesComplexClass.generated.js';
6
6
  import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js';
7
+ import { typeOfDependencies } from './dependenciesTypeOf.generated.js';
7
8
  import { typedDependencies } from './dependenciesTyped.generated.js';
8
9
  import { createLog } from '../../factoriesAny.js';
9
10
  export var logDependencies = {
10
11
  ComplexDependencies,
11
12
  divideScalarDependencies,
13
+ typeOfDependencies,
12
14
  typedDependencies,
13
15
  createLog
14
16
  };
@@ -13,6 +13,7 @@ import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.gener
13
13
  import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js';
14
14
  import { equalDependencies } from './dependenciesEqual.generated.js';
15
15
  import { parseDependencies } from './dependenciesParse.generated.js';
16
+ import { replacerDependencies } from './dependenciesReplacer.generated.js';
16
17
  import { resolveDependencies } from './dependenciesResolve.generated.js';
17
18
  import { simplifyConstantDependencies } from './dependenciesSimplifyConstant.generated.js';
18
19
  import { simplifyCoreDependencies } from './dependenciesSimplifyCore.generated.js';
@@ -30,6 +31,7 @@ export var simplifyDependencies = {
30
31
  SymbolNodeDependencies,
31
32
  equalDependencies,
32
33
  parseDependencies,
34
+ replacerDependencies,
33
35
  resolveDependencies,
34
36
  simplifyConstantDependencies,
35
37
  simplifyCoreDependencies,
@@ -3,12 +3,14 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { matrixDependencies } from './dependenciesMatrix.generated.js';
8
9
  import { typedDependencies } from './dependenciesTyped.generated.js';
9
10
  import { createSmaller } from '../../factoriesAny.js';
10
11
  export var smallerDependencies = {
11
12
  DenseMatrixDependencies,
13
+ SparseMatrixDependencies,
12
14
  concatDependencies,
13
15
  matrixDependencies,
14
16
  typedDependencies,
@@ -3,12 +3,14 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { matrixDependencies } from './dependenciesMatrix.generated.js';
8
9
  import { typedDependencies } from './dependenciesTyped.generated.js';
9
10
  import { createSmallerEq } from '../../factoriesAny.js';
10
11
  export var smallerEqDependencies = {
11
12
  DenseMatrixDependencies,
13
+ SparseMatrixDependencies,
12
14
  concatDependencies,
13
15
  matrixDependencies,
14
16
  typedDependencies,
@@ -3,6 +3,7 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { equalScalarDependencies } from './dependenciesEqualScalar.generated.js';
8
9
  import { matrixDependencies } from './dependenciesMatrix.generated.js';
@@ -10,6 +11,7 @@ import { typedDependencies } from './dependenciesTyped.generated.js';
10
11
  import { createUnequal } from '../../factoriesAny.js';
11
12
  export var unequalDependencies = {
12
13
  DenseMatrixDependencies,
14
+ SparseMatrixDependencies,
13
15
  concatDependencies,
14
16
  equalScalarDependencies,
15
17
  matrixDependencies,
@@ -3,12 +3,14 @@
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
5
  import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js';
6
+ import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js';
6
7
  import { concatDependencies } from './dependenciesConcat.generated.js';
7
8
  import { matrixDependencies } from './dependenciesMatrix.generated.js';
8
9
  import { typedDependencies } from './dependenciesTyped.generated.js';
9
10
  import { createXor } from '../../factoriesAny.js';
10
11
  export var xorDependencies = {
11
12
  DenseMatrixDependencies,
13
+ SparseMatrixDependencies,
12
14
  concatDependencies,
13
15
  matrixDependencies,
14
16
  typedDependencies,
@@ -13,6 +13,7 @@ import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.gener
13
13
  import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js';
14
14
  import { equalDependencies } from './dependenciesEqual.generated.js';
15
15
  import { parseDependencies } from './dependenciesParse.generated.js';
16
+ import { replacerDependencies } from './dependenciesReplacer.generated.js';
16
17
  import { resolveDependencies } from './dependenciesResolve.generated.js';
17
18
  import { simplifyConstantDependencies } from './dependenciesSimplifyConstant.generated.js';
18
19
  import { simplifyCoreDependencies } from './dependenciesSimplifyCore.generated.js';
@@ -30,6 +31,7 @@ export var simplifyDependencies = {
30
31
  SymbolNodeDependencies,
31
32
  equalDependencies,
32
33
  parseDependencies,
34
+ replacerDependencies,
33
35
  resolveDependencies,
34
36
  simplifyConstantDependencies,
35
37
  simplifyCoreDependencies,
@@ -172,6 +172,7 @@ export var simplify = createSimplify({
172
172
  SymbolNode,
173
173
  equal,
174
174
  parse,
175
+ replacer,
175
176
  resolve,
176
177
  simplifyConstant,
177
178
  simplifyCore,
@@ -169,6 +169,7 @@ export var simplify = createSimplify({
169
169
  SymbolNode,
170
170
  equal,
171
171
  parse,
172
+ replacer,
172
173
  resolve,
173
174
  simplifyConstant,
174
175
  simplifyCore,
@@ -487,6 +487,7 @@ export var divideScalar = /* #__PURE__ */createDivideScalar({
487
487
  });
488
488
  export var dotDivide = /* #__PURE__ */createDotDivide({
489
489
  DenseMatrix,
490
+ SparseMatrix,
490
491
  concat,
491
492
  divideScalar,
492
493
  equalScalar,
@@ -495,6 +496,7 @@ export var dotDivide = /* #__PURE__ */createDotDivide({
495
496
  });
496
497
  export var equal = /* #__PURE__ */createEqual({
497
498
  DenseMatrix,
499
+ SparseMatrix,
498
500
  concat,
499
501
  equalScalar,
500
502
  matrix,
@@ -519,6 +521,7 @@ export var kron = /* #__PURE__ */createKron({
519
521
  });
520
522
  export var largerEq = /* #__PURE__ */createLargerEq({
521
523
  DenseMatrix,
524
+ SparseMatrix,
522
525
  concat,
523
526
  config,
524
527
  matrix,
@@ -600,6 +603,7 @@ export var round = /* #__PURE__ */createRound({
600
603
  });
601
604
  export var smaller = /* #__PURE__ */createSmaller({
602
605
  DenseMatrix,
606
+ SparseMatrix,
603
607
  concat,
604
608
  config,
605
609
  matrix,
@@ -635,6 +639,7 @@ export var usolve = /* #__PURE__ */createUsolve({
635
639
  });
636
640
  export var xor = /* #__PURE__ */createXor({
637
641
  DenseMatrix,
642
+ SparseMatrix,
638
643
  concat,
639
644
  matrix,
640
645
  typed
@@ -671,6 +676,7 @@ export var bitOr = /* #__PURE__ */createBitOr({
671
676
  });
672
677
  export var bitXor = /* #__PURE__ */createBitXor({
673
678
  DenseMatrix,
679
+ SparseMatrix,
674
680
  concat,
675
681
  matrix,
676
682
  typed
@@ -776,6 +782,7 @@ export var Index = /* #__PURE__ */createIndexClass({
776
782
  });
777
783
  export var larger = /* #__PURE__ */createLarger({
778
784
  DenseMatrix,
785
+ SparseMatrix,
779
786
  concat,
780
787
  config,
781
788
  matrix,
@@ -785,6 +792,7 @@ export var log = /* #__PURE__ */createLog({
785
792
  Complex,
786
793
  config,
787
794
  divideScalar,
795
+ typeOf,
788
796
  typed
789
797
  });
790
798
  export var lsolveAll = /* #__PURE__ */createLsolveAll({
@@ -1039,6 +1047,7 @@ export var setPowerset = /* #__PURE__ */createSetPowerset({
1039
1047
  });
1040
1048
  export var smallerEq = /* #__PURE__ */createSmallerEq({
1041
1049
  DenseMatrix,
1050
+ SparseMatrix,
1042
1051
  concat,
1043
1052
  config,
1044
1053
  matrix,
@@ -1052,6 +1061,7 @@ export var sort = /* #__PURE__ */createSort({
1052
1061
  });
1053
1062
  export var unequal = /* #__PURE__ */createUnequal({
1054
1063
  DenseMatrix,
1064
+ SparseMatrix,
1055
1065
  concat,
1056
1066
  config,
1057
1067
  equalScalar,
@@ -1259,6 +1269,7 @@ export var deuteronMass = /* #__PURE__ */createDeuteronMass({
1259
1269
  });
1260
1270
  export var dotPow = /* #__PURE__ */createDotPow({
1261
1271
  DenseMatrix,
1272
+ SparseMatrix,
1262
1273
  concat,
1263
1274
  equalScalar,
1264
1275
  matrix,
@@ -1,8 +1,8 @@
1
1
  export var ceilDocs = {
2
2
  name: 'ceil',
3
3
  category: 'Arithmetic',
4
- syntax: ['ceil(x)'],
4
+ syntax: ['ceil(x)', 'ceil(x, n)', 'ceil(unit, valuelessUnit)', 'ceil(unit, n, valuelessUnit)'],
5
5
  description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.',
6
- examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)'],
6
+ examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)', 'ceil(3.241cm, cm)', 'ceil(3.241cm, 2, cm)'],
7
7
  seealso: ['floor', 'fix', 'round']
8
8
  };
@@ -1,8 +1,8 @@
1
1
  export var fixDocs = {
2
2
  name: 'fix',
3
3
  category: 'Arithmetic',
4
- syntax: ['fix(x)'],
4
+ syntax: ['fix(x)', 'fix(x, n)', 'fix(unit, valuelessUnit)', 'fix(unit, n, valuelessUnit)'],
5
5
  description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.',
6
- examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)'],
6
+ examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)', 'fix(3.241cm, cm)', 'fix(3.241cm, 2, cm)'],
7
7
  seealso: ['ceil', 'floor', 'round']
8
8
  };
@@ -1,8 +1,8 @@
1
1
  export var floorDocs = {
2
2
  name: 'floor',
3
3
  category: 'Arithmetic',
4
- syntax: ['floor(x)'],
4
+ syntax: ['floor(x)', 'floor(x, n)', 'floor(unit, valuelessUnit)', 'floor(unit, n, valuelessUnit)'],
5
5
  description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',
6
- examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)'],
6
+ examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)', 'floor(3.241cm, cm)', 'floor(3.241cm, 2, cm)'],
7
7
  seealso: ['ceil', 'fix', 'round']
8
8
  };