mathjs 14.8.1 → 14.8.2
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/HISTORY.md +9 -0
- package/lib/browser/math.js +1 -1
- package/lib/browser/math.js.LICENSE.txt +2 -2
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/utils/optimizeCallback.js +2 -3
- package/lib/cjs/version.js +1 -1
- package/lib/esm/utils/optimizeCallback.js +2 -3
- package/lib/esm/version.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +32 -14
package/lib/cjs/header.js
CHANGED
@@ -6,8 +6,8 @@
|
|
6
6
|
* It features real and complex numbers, units, matrices, a large set of
|
7
7
|
* mathematical functions, and a flexible expression parser.
|
8
8
|
*
|
9
|
-
* @version 14.8.
|
10
|
-
* @date 2025-
|
9
|
+
* @version 14.8.2
|
10
|
+
* @date 2025-10-03
|
11
11
|
*
|
12
12
|
* @license
|
13
13
|
* Copyright (C) 2013-2025 Jos de Jong <wjosdejong@gmail.com>
|
@@ -14,11 +14,10 @@ var _is = require("./is.js");
|
|
14
14
|
* @param {Function} callback The original callback function to simplify.
|
15
15
|
* @param {Array|Matrix} array The array that will be used with the callback function.
|
16
16
|
* @param {string} name The name of the function that is using the callback.
|
17
|
-
* @param {boolean}
|
17
|
+
* @param {boolean} isUnary If true, the callback function is unary and will be optimized as such.
|
18
18
|
* @returns {Function} Returns a simplified version of the callback function.
|
19
19
|
*/
|
20
|
-
function optimizeCallback(callback, array, name) {
|
21
|
-
let isUnary = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
20
|
+
function optimizeCallback(callback, array, name, isUnary) {
|
22
21
|
if (_typedFunction.default.isTypedFunction(callback)) {
|
23
22
|
let numberOfArguments;
|
24
23
|
if (isUnary) {
|
package/lib/cjs/version.js
CHANGED
@@ -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 = '14.8.
|
7
|
+
const version = exports.version = '14.8.2';
|
8
8
|
// Note: This file is automatically generated when building math.js.
|
9
9
|
// Changes made in this file will be overwritten.
|
@@ -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}
|
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) {
|
package/lib/esm/version.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "mathjs",
|
3
|
-
"version": "14.8.
|
3
|
+
"version": "14.8.2",
|
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",
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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,
|