mathjs 14.8.1 → 14.9.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.
Files changed (35) hide show
  1. package/HISTORY.md +13 -0
  2. package/lib/browser/math.js +1 -1
  3. package/lib/browser/math.js.LICENSE.txt +2 -2
  4. package/lib/browser/math.js.map +1 -1
  5. package/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js +4 -0
  6. package/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js +4 -0
  7. package/lib/cjs/entry/dependenciesNumber/dependenciesRange.generated.js +4 -0
  8. package/lib/cjs/entry/dependenciesNumber/dependenciesRangeTransform.generated.js +4 -0
  9. package/lib/cjs/entry/impureFunctionsAny.generated.js +2 -0
  10. package/lib/cjs/entry/impureFunctionsNumber.generated.js +2 -0
  11. package/lib/cjs/entry/pureFunctionsAny.generated.js +2 -0
  12. package/lib/cjs/entry/pureFunctionsNumber.generated.js +2 -0
  13. package/lib/cjs/expression/transform/range.transform.js +5 -1
  14. package/lib/cjs/function/matrix/map.js +117 -40
  15. package/lib/cjs/function/matrix/range.js +3 -1
  16. package/lib/cjs/header.js +2 -2
  17. package/lib/cjs/type/matrix/Range.js +3 -0
  18. package/lib/cjs/utils/optimizeCallback.js +2 -3
  19. package/lib/cjs/version.js +1 -1
  20. package/lib/esm/entry/dependenciesAny/dependenciesRange.generated.js +4 -0
  21. package/lib/esm/entry/dependenciesAny/dependenciesRangeTransform.generated.js +4 -0
  22. package/lib/esm/entry/dependenciesNumber/dependenciesRange.generated.js +4 -0
  23. package/lib/esm/entry/dependenciesNumber/dependenciesRangeTransform.generated.js +4 -0
  24. package/lib/esm/entry/impureFunctionsAny.generated.js +2 -0
  25. package/lib/esm/entry/impureFunctionsNumber.generated.js +2 -0
  26. package/lib/esm/entry/pureFunctionsAny.generated.js +2 -0
  27. package/lib/esm/entry/pureFunctionsNumber.generated.js +2 -0
  28. package/lib/esm/expression/transform/range.transform.js +5 -1
  29. package/lib/esm/function/matrix/map.js +123 -40
  30. package/lib/esm/function/matrix/range.js +3 -1
  31. package/lib/esm/type/matrix/Range.js +4 -1
  32. package/lib/esm/utils/optimizeCallback.js +2 -3
  33. package/lib/esm/version.js +1 -1
  34. package/package.json +7 -7
  35. package/types/index.d.ts +32 -14
@@ -76,58 +76,141 @@ export var createMap = /* #__PURE__ */factory(name, dependencies, _ref => {
76
76
  throw new Error('Last argument must be a callback function');
77
77
  }
78
78
  var firstArrayIsMatrix = Arrays[0].isMatrix;
79
- var newSize = broadcastSizes(...Arrays.map(M => M.isMatrix ? M.size() : arraySize(M)));
79
+ var sizes = Arrays.map(M => M.isMatrix ? M.size() : arraySize(M));
80
+ var newSize = broadcastSizes(...sizes);
81
+ var numberOfArrays = Arrays.length;
80
82
  var _get = firstArrayIsMatrix ? (matrix, idx) => matrix.get(idx) : get;
81
- var broadcastedArrays = firstArrayIsMatrix ? Arrays.map(M => M.isMatrix ? M.create(broadcastTo(M.toArray(), newSize), M.datatype()) : Arrays[0].create(broadcastTo(M.valueOf(), newSize))) : Arrays.map(M => M.isMatrix ? broadcastTo(M.toArray(), newSize) : broadcastTo(M, newSize));
82
- var callback;
83
- if (typed.isTypedFunction(multiCallback)) {
84
- var firstIndex = newSize.map(() => 0);
85
- var firstValues = broadcastedArrays.map(array => _get(array, firstIndex));
86
- var callbackCase = _getTypedCallbackCase(multiCallback, firstValues, firstIndex, broadcastedArrays);
87
- callback = _getLimitedCallback(callbackCase);
88
- } else {
89
- var numberOfArrays = Arrays.length;
90
- var _callbackCase = _getCallbackCase(multiCallback, numberOfArrays);
91
- callback = _getLimitedCallback(_callbackCase);
83
+ var firstValues = Arrays.map((collection, i) => {
84
+ var firstIndex = sizes[i].map(() => 0);
85
+ return collection.isMatrix ? collection.get(firstIndex) : get(collection, firstIndex);
86
+ });
87
+ var callbackArgCount = typed.isTypedFunction(multiCallback) ? _getTypedCallbackArgCount(multiCallback, firstValues, newSize.map(() => 0), Arrays) : _getCallbackArgCount(multiCallback, numberOfArrays);
88
+ if (callbackArgCount < 2) {
89
+ var _callback = _getLimitedCallback(callbackArgCount, multiCallback, null);
90
+ return mapMultiple(Arrays, _callback);
92
91
  }
93
- var broadcastedArraysCallback = (x, idx) => callback([x, ...broadcastedArrays.slice(1).map(Array => _get(Array, idx))], idx);
92
+ var broadcastedArrays = firstArrayIsMatrix ? Arrays.map(M => M.isMatrix ? M.create(broadcastTo(M.toArray(), newSize), M.datatype()) : Arrays[0].create(broadcastTo(M.valueOf(), newSize))) : Arrays.map(M => M.isMatrix ? broadcastTo(M.toArray(), newSize) : broadcastTo(M, newSize));
93
+ var callback = _getLimitedCallback(callbackArgCount, multiCallback, broadcastedArrays);
94
+ var broadcastedArraysCallback = (x, idx) => callback([x, ...broadcastedArrays.slice(1).map(array => _get(array, idx))], idx);
94
95
  if (firstArrayIsMatrix) {
95
96
  return broadcastedArrays[0].map(broadcastedArraysCallback);
96
97
  } else {
97
98
  return _mapArray(broadcastedArrays[0], broadcastedArraysCallback);
98
99
  }
99
- function _getLimitedCallback(callbackCase) {
100
- switch (callbackCase) {
101
- case 0:
102
- return x => multiCallback(...x);
103
- case 1:
104
- return (x, idx) => multiCallback(...x, idx);
105
- case 2:
106
- return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays);
107
- }
100
+ }
101
+ function mapMultiple(collections, callback) {
102
+ // collections can be matrices or arrays
103
+ // callback must be a function of the form (collections, [index])
104
+ var firstCollection = collections[0];
105
+ var arrays = collections.map(collection => collection.isMatrix ? collection.valueOf() : collection);
106
+ var sizes = collections.map(collection => collection.isMatrix ? collection.size() : arraySize(collection));
107
+ var finalSize = broadcastSizes(...sizes);
108
+ // the offset means for each initial array, how much smaller is it than the final size
109
+ var offsets = sizes.map(size => finalSize.length - size.length);
110
+ var maxDepth = finalSize.length - 1;
111
+ var callbackUsesIndex = callback.length > 1;
112
+ var index = callbackUsesIndex ? [] : null;
113
+ var resultsArray = iterate(arrays, 0);
114
+ if (firstCollection.isMatrix) {
115
+ var resultsMatrix = firstCollection.create();
116
+ resultsMatrix._data = resultsArray;
117
+ resultsMatrix._size = finalSize;
118
+ return resultsMatrix;
119
+ } else {
120
+ return resultsArray;
108
121
  }
109
- function _getCallbackCase(callback, numberOfArrays) {
110
- if (callback.length > numberOfArrays + 1) {
111
- return 2;
112
- }
113
- if (callback.length === numberOfArrays + 1) {
114
- return 1;
122
+ function iterate(arrays) {
123
+ var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
124
+ // each array can have different sizes
125
+ var currentDimensionSize = finalSize[depth];
126
+ var result = Array(currentDimensionSize);
127
+ if (depth < maxDepth) {
128
+ var _loop = function _loop(i) {
129
+ if (index) index[depth] = i;
130
+ // if there is an offset greater than the current dimension
131
+ // pass the array, if the size of the array is 1 pass the first
132
+ // element of the array
133
+ result[i] = iterate(arrays.map((array, arrayIndex) => offsets[arrayIndex] > depth ? array : array.length === 1 ? array[0] : array[i]), depth + 1);
134
+ };
135
+ for (var i = 0; i < currentDimensionSize; i++) {
136
+ _loop(i);
137
+ }
138
+ } else {
139
+ var _loop2 = function _loop2(_i) {
140
+ if (index) index[depth] = _i;
141
+ result[_i] = callback(arrays.map(a => a.length === 1 ? a[0] : a[_i]), index ? index.slice() : undefined);
142
+ };
143
+ for (var _i = 0; _i < currentDimensionSize; _i++) {
144
+ _loop2(_i);
145
+ }
115
146
  }
116
- return 0;
147
+ return result;
117
148
  }
118
- function _getTypedCallbackCase(callback, values, idx, arrays) {
119
- if (typed.resolve(callback, [...values, idx, ...arrays]) !== null) {
120
- return 2;
121
- }
122
- if (typed.resolve(callback, [...values, idx]) !== null) {
123
- return 1;
124
- }
125
- if (typed.resolve(callback, values) !== null) {
126
- return 0;
127
- }
128
- // this should never happen
149
+ }
150
+
151
+ /**
152
+ * Creates a limited callback based on the argument pattern.
153
+ * @param {number} callbackArgCount - The argument pattern (0, 1, or 2)
154
+ * @param {Function} multiCallback - The original callback function
155
+ * @param {Array} broadcastedArrays - The broadcasted arrays (for case 2)
156
+ * @returns {Function} The limited callback function
157
+ */
158
+ function _getLimitedCallback(callbackArgCount, multiCallback, broadcastedArrays) {
159
+ switch (callbackArgCount) {
160
+ case 0:
161
+ return x => multiCallback(...x);
162
+ case 1:
163
+ return (x, idx) => multiCallback(...x, idx);
164
+ case 2:
165
+ return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays);
166
+ }
167
+ }
168
+
169
+ /**
170
+ * Determines the argument pattern of a regular callback function.
171
+ * @param {Function} callback - The callback function to analyze
172
+ * @param {number} numberOfArrays - Number of arrays being processed
173
+ * @returns {number} 0 = values only, 1 = values + index, 2 = values + index + arrays
174
+ */
175
+ function _getCallbackArgCount(callback, numberOfArrays) {
176
+ var callbackStr = callback.toString();
177
+ // Check if the callback function uses `arguments`
178
+ if (/arguments/.test(callbackStr)) return 2;
179
+
180
+ // Extract the parameters of the callback function
181
+ var paramsStr = callbackStr.match(/\(.*?\)/);
182
+ // Check if the callback function uses rest parameters
183
+ if (/\.\.\./.test(paramsStr)) return 2;
184
+ if (callback.length > numberOfArrays + 1) {
185
+ return 2;
186
+ }
187
+ if (callback.length === numberOfArrays + 1) {
188
+ return 1;
189
+ }
190
+ return 0;
191
+ }
192
+
193
+ /**
194
+ * Determines the argument pattern of a typed callback function.
195
+ * @param {Function} callback - The typed callback function to analyze
196
+ * @param {Array} values - Sample values for signature resolution
197
+ * @param {Array} idx - Sample index for signature resolution
198
+ * @param {Array} arrays - Sample arrays for signature resolution
199
+ * @returns {number} 0 = values only, 1 = values + index, 2 = values + index + arrays
200
+ */
201
+
202
+ function _getTypedCallbackArgCount(callback, values, idx, arrays) {
203
+ if (typed.resolve(callback, [...values, idx, ...arrays]) !== null) {
204
+ return 2;
205
+ }
206
+ if (typed.resolve(callback, [...values, idx]) !== null) {
207
+ return 1;
208
+ }
209
+ if (typed.resolve(callback, values) !== null) {
129
210
  return 0;
130
211
  }
212
+ // this should never happen
213
+ return 0;
131
214
  }
132
215
  /**
133
216
  * Map for a multi dimensional array
@@ -1,7 +1,7 @@
1
1
  import { factory } from '../../utils/factory.js';
2
2
  import { noBignumber, noMatrix } from '../../utils/noop.js';
3
3
  var name = 'range';
4
- var dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive'];
4
+ var dependencies = ['typed', 'config', '?matrix', '?bignumber', 'equal', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isZero', 'isPositive'];
5
5
  export var createRange = /* #__PURE__ */factory(name, dependencies, _ref => {
6
6
  var {
7
7
  typed,
@@ -13,6 +13,7 @@ export var createRange = /* #__PURE__ */factory(name, dependencies, _ref => {
13
13
  larger,
14
14
  largerEq,
15
15
  add,
16
+ isZero,
16
17
  isPositive
17
18
  } = _ref;
18
19
  /**
@@ -181,6 +182,7 @@ export var createRange = /* #__PURE__ */factory(name, dependencies, _ref => {
181
182
  */
182
183
  function _range(start, end, step, includeEnd) {
183
184
  var array = [];
185
+ if (isZero(step)) throw new Error('Step must be non-zero');
184
186
  var ongoing = isPositive(step) ? includeEnd ? smallerEq : smaller : includeEnd ? largerEq : larger;
185
187
  var x = start;
186
188
  while (ongoing(x, end)) {
@@ -1,5 +1,5 @@
1
1
  import { isBigInt, isBigNumber } from '../../utils/is.js';
2
- import { format, sign } from '../../utils/number.js';
2
+ import { format, sign, nearlyEqual } from '../../utils/number.js';
3
3
  import { factory } from '../../utils/factory.js';
4
4
  var name = 'Range';
5
5
  var dependencies = [];
@@ -73,6 +73,9 @@ export var createRangeClass = /* #__PURE__ */factory(name, dependencies, () => {
73
73
  this.start = hasStart ? parseFloat(start) : 0;
74
74
  this.end = hasEnd ? parseFloat(end) : 0;
75
75
  this.step = hasStep ? parseFloat(step) : 1;
76
+ if (hasStep && nearlyEqual(this.step, 0)) {
77
+ throw new Error('Step must not be zero');
78
+ }
76
79
  }
77
80
 
78
81
  /**
@@ -8,11 +8,10 @@ import { typeOf as _typeOf } from './is.js';
8
8
  * @param {Function} callback The original callback function to simplify.
9
9
  * @param {Array|Matrix} array The array that will be used with the callback function.
10
10
  * @param {string} name The name of the function that is using the callback.
11
- * @param {boolean} [isUnary=false] If true, the callback function is unary and will be optimized as such.
11
+ * @param {boolean} isUnary If true, the callback function is unary and will be optimized as such.
12
12
  * @returns {Function} Returns a simplified version of the callback function.
13
13
  */
14
- export function optimizeCallback(callback, array, name) {
15
- var isUnary = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
14
+ export function optimizeCallback(callback, array, name, isUnary) {
16
15
  if (typed.isTypedFunction(callback)) {
17
16
  var numberOfArguments;
18
17
  if (isUnary) {
@@ -1,3 +1,3 @@
1
- export var version = '14.8.1';
1
+ export var version = '14.9.0';
2
2
  // Note: This file is automatically generated when building math.js.
3
3
  // Changes made in this file will be overwritten.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mathjs",
3
- "version": "14.8.1",
3
+ "version": "14.9.0",
4
4
  "description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.",
5
5
  "author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)",
6
6
  "homepage": "https://mathjs.org",
@@ -44,15 +44,15 @@
44
44
  "@babel/register": "7.28.3",
45
45
  "@types/assert": "1.5.11",
46
46
  "@types/mocha": "10.0.10",
47
- "@typescript-eslint/eslint-plugin": "8.44.1",
48
- "@typescript-eslint/parser": "8.44.1",
47
+ "@typescript-eslint/eslint-plugin": "8.46.0",
48
+ "@typescript-eslint/parser": "8.46.0",
49
49
  "assert": "2.1.0",
50
50
  "babel-loader": "10.0.0",
51
51
  "c8": "10.1.3",
52
52
  "codecov": "3.8.3",
53
53
  "del": "8.0.1",
54
54
  "eigen": "0.2.2",
55
- "es-check": "9.3.1",
55
+ "es-check": "9.4.4",
56
56
  "eslint": "8.57.1",
57
57
  "eslint-config-prettier": "9.1.0",
58
58
  "eslint-config-standard": "17.1.0",
@@ -77,7 +77,7 @@
77
77
  "karma-webdriver-launcher": "1.0.8",
78
78
  "karma-webpack": "5.0.1",
79
79
  "mkdirp": "3.0.1",
80
- "mocha": "11.7.2",
80
+ "mocha": "11.7.4",
81
81
  "mocha-junit-reporter": "2.2.1",
82
82
  "ndarray": "1.0.19",
83
83
  "ndarray-determinant": "1.0.0",
@@ -91,8 +91,8 @@
91
91
  "sylvester": "0.0.21",
92
92
  "tinybench": "5.0.1",
93
93
  "ts-node": "10.9.2",
94
- "typescript": "5.9.2",
95
- "webpack": "5.101.3",
94
+ "typescript": "5.9.3",
95
+ "webpack": "5.102.1",
96
96
  "zeros": "1.0.0"
97
97
  },
98
98
  "type": "module",
package/types/index.d.ts CHANGED
@@ -1093,7 +1093,7 @@ export interface MathJsInstance extends MathJsFactory {
1093
1093
  * decomposition.
1094
1094
  * @param order The Symbolic Ordering and Analysis order: 0 - Natural
1095
1095
  * ordering, no permutation vector q is returned 1 - Matrix must be
1096
- * square, symbolic ordering and analisis is performed on M = A + A' 2 -
1096
+ * square, symbolic ordering and analysis is performed on M = A + A' 2 -
1097
1097
  * Symbolic ordering and analysis is performed on M = A' * A. Dense
1098
1098
  * columns from A' are dropped, A recreated from A'. This is appropriate
1099
1099
  * for LU factorization of non-symmetric matrices. 3 - Symbolic ordering
@@ -1126,6 +1126,7 @@ export interface MathJsInstance extends MathJsFactory {
1126
1126
  * @param x A number or matrix for which to get the absolute value
1127
1127
  * @returns Absolute value of x
1128
1128
  */
1129
+ abs(x: Complex): number
1129
1130
  abs<T extends MathType>(x: T): T
1130
1131
 
1131
1132
  /**
@@ -1328,7 +1329,7 @@ export interface MathJsInstance extends MathJsFactory {
1328
1329
  * @param args A list with numeric values or an Array or Matrix. Matrix
1329
1330
  * and Array input is flattened and returns a single number for the
1330
1331
  * whole matrix.
1331
- * @returns Returns the hypothenuse of the input values.
1332
+ * @returns Returns the hypotenuse of the input values.
1332
1333
  */
1333
1334
  hypot<T extends number | BigNumber>(...args: T[]): T
1334
1335
  hypot<T extends number | BigNumber>(args: T[]): T
@@ -1546,7 +1547,7 @@ export interface MathJsInstance extends MathJsFactory {
1546
1547
  * strings will be converted to a number. For complex numbers, both real
1547
1548
  * and complex value are inverted.
1548
1549
  * @param x Number to be inverted
1549
- * @returns Retursn the value with inverted sign
1550
+ * @returns Returns the value with inverted sign
1550
1551
  */
1551
1552
  unaryMinus<T extends MathType>(x: T): T
1552
1553
 
@@ -1757,7 +1758,7 @@ export interface MathJsInstance extends MathJsFactory {
1757
1758
  ************************************************************************/
1758
1759
 
1759
1760
  /**
1760
- * Calculates: The eucledian distance between two points in 2 and 3
1761
+ * Calculates: The Euclidean distance between two points in 2 and 3
1761
1762
  * dimensional spaces. Distance between point and a line in 2 and 3
1762
1763
  * dimensional spaces. Pairwise distance between a set of 2D or 3D
1763
1764
  * points NOTE: When substituting coefficients of a line(a, b and c),
@@ -1897,6 +1898,14 @@ export interface MathJsInstance extends MathJsFactory {
1897
1898
  */
1898
1899
  cross(x: MathCollection, y: MathCollection): MathCollection
1899
1900
 
1901
+ /**
1902
+ * Transpose and complex conjugate a matrix. All values of the matrix are
1903
+ * reflected over its main diagonal and then the complex conjugate is taken.
1904
+ * This is equivalent to complex conjugation for scalars and vectors.
1905
+ * @param x Matrix to be ctransposed
1906
+ */
1907
+ ctranspose(x: MathCollection): MathCollection
1908
+
1900
1909
  /**
1901
1910
  * Calculate the determinant of a matrix.
1902
1911
  * @param x A Matrix
@@ -2081,7 +2090,7 @@ export interface MathJsInstance extends MathJsFactory {
2081
2090
 
2082
2091
  /**
2083
2092
  * Calculate the inverse of a square matrix.
2084
- * @param x Matrix to be inversed
2093
+ * @param x Matrix to be inverted
2085
2094
  * @returns The inverse of x
2086
2095
  */
2087
2096
  inv<T extends number | Complex | MathCollection>(x: T): NoLiteralType<T>
@@ -2190,7 +2199,7 @@ export interface MathJsInstance extends MathJsFactory {
2190
2199
 
2191
2200
  /**
2192
2201
  * Calculate the Moore–Penrose inverse of a matrix.
2193
- * @param x Matrix to be inversed
2202
+ * @param x Matrix to be inverted
2194
2203
  * @return The inverse of `x`.
2195
2204
  */
2196
2205
  pinv<T extends MathType>(x: T): T
@@ -2457,7 +2466,7 @@ export interface MathJsInstance extends MathJsFactory {
2457
2466
  * distributions
2458
2467
  * @param q First vector
2459
2468
  * @param p Second vector
2460
- * @returns Returns disance between q and p
2469
+ * @returns Returns distance between q and p
2461
2470
  */
2462
2471
  kldivergence(q: MathCollection, p: MathCollection): number
2463
2472
 
@@ -2474,7 +2483,7 @@ export interface MathJsInstance extends MathJsFactory {
2474
2483
  * takes one array of integers as an argument. The following condition
2475
2484
  * must be enforced: every ai <= 0
2476
2485
  * @param a Integer number of objects in the subset
2477
- * @returns multinomial coefficent
2486
+ * @returns multinomial coefficient
2478
2487
  */
2479
2488
  multinomial<T extends number | BigNumber>(a: T[]): NoLiteralType<T>
2480
2489
 
@@ -2579,7 +2588,7 @@ export interface MathJsInstance extends MathJsFactory {
2579
2588
  * Test element wise whether two matrices are equal. The function
2580
2589
  * accepts both matrices and scalar values.
2581
2590
  * @param x First matrix to compare
2582
- * @param y Second amtrix to compare
2591
+ * @param y Second matrix to compare
2583
2592
  * @returns Returns true when the input matrices have the same size and
2584
2593
  * each of their elements is equal.
2585
2594
  */
@@ -2621,7 +2630,7 @@ export interface MathJsInstance extends MathJsFactory {
2621
2630
  * compare values smaller than approximately 2.22e-16. For matrices, the
2622
2631
  * function is evaluated element wise.
2623
2632
  * @param x First value to compare
2624
- * @param y Second value to vcompare
2633
+ * @param y Second value to compare
2625
2634
  * @returns Returns true when x is larger than y, else returns false
2626
2635
  */
2627
2636
  larger(x: MathType | string, y: MathType | string): boolean | MathCollection
@@ -2633,7 +2642,7 @@ export interface MathJsInstance extends MathJsFactory {
2633
2642
  * to compare values smaller than approximately 2.22e-16. For matrices,
2634
2643
  * the function is evaluated element wise.
2635
2644
  * @param x First value to compare
2636
- * @param y Second value to vcompare
2645
+ * @param y Second value to compare
2637
2646
  * @returns Returns true when x is larger than or equal to y, else
2638
2647
  * returns false
2639
2648
  */
@@ -2646,7 +2655,7 @@ export interface MathJsInstance extends MathJsFactory {
2646
2655
  * to compare values smaller than approximately 2.22e-16. For matrices,
2647
2656
  * the function is evaluated element wise.
2648
2657
  * @param x First value to compare
2649
- * @param y Second value to vcompare
2658
+ * @param y Second value to compare
2650
2659
  * @returns Returns true when x is smaller than y, else returns false
2651
2660
  */
2652
2661
  smaller(x: MathType | string, y: MathType | string): boolean | MathCollection
@@ -2658,7 +2667,7 @@ export interface MathJsInstance extends MathJsFactory {
2658
2667
  * used to compare values smaller than approximately 2.22e-16. For
2659
2668
  * matrices, the function is evaluated element wise.
2660
2669
  * @param x First value to compare
2661
- * @param y Second value to vcompare
2670
+ * @param y Second value to compare
2662
2671
  * @returns Returns true when x is smaller than or equal to y, else
2663
2672
  * returns false
2664
2673
  */
@@ -2692,7 +2701,7 @@ export interface MathJsInstance extends MathJsFactory {
2692
2701
  * strictly, thus null is unequal with everything except null, and
2693
2702
  * undefined is unequal with everything except undefined.
2694
2703
  * @param x First value to compare
2695
- * @param y Second value to vcompare
2704
+ * @param y Second value to compare
2696
2705
  * @returns Returns true when the compared values are unequal, else
2697
2706
  * returns false
2698
2707
  */
@@ -5076,6 +5085,7 @@ export interface MathJsChain<TValue> {
5076
5085
  * Calculate the absolute value of a number. For matrices, the function
5077
5086
  * is evaluated element wise.
5078
5087
  */
5088
+ abs(this: MathJsChain<Complex>): MathJsChain<number>
5079
5089
  abs<T extends MathType>(this: MathJsChain<T>): MathJsChain<T>
5080
5090
 
5081
5091
  /**
@@ -5814,6 +5824,13 @@ export interface MathJsChain<TValue> {
5814
5824
  y: MathCollection
5815
5825
  ): MathJsChain<MathCollection>
5816
5826
 
5827
+ /**
5828
+ * Transpose and complex conjugate a matrix. All values of the matrix are
5829
+ * reflected over its main diagonal and then the complex conjugate is taken.
5830
+ * This is equivalent to complex conjugation for scalars and vectors.
5831
+ */
5832
+ ctranspose(this: MathJsChain<MathCollection>): MathJsChain<MathCollection>
5833
+
5817
5834
  /**
5818
5835
  * Calculate the difference between adjacent elements of the chained matrix or array.
5819
5836
  * @param dim The dimension to apply the difference on.
@@ -7300,6 +7317,7 @@ export const {
7300
7317
  apply, // @deprecated prior name of mapSlices
7301
7318
  concat,
7302
7319
  cross,
7320
+ ctranspose,
7303
7321
  det,
7304
7322
  diag,
7305
7323
  dot,