mathjs 10.5.0 → 10.5.1
Sign up to get free protection for your applications and to get access to all the features.
- package/HISTORY.md +12 -0
- package/docs/datatypes/matrices.md +17 -0
- package/docs/expressions/syntax.md +4 -1
- package/docs/reference/functions/fix.md +1 -0
- package/docs/reference/functions/floor.md +4 -0
- package/docs/reference/functions/resolve.md +2 -2
- package/docs/reference/functions/simplifyConstant.md +52 -0
- package/lib/browser/math.js +5 -5
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js +6 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js +9 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js +6 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js +0 -3
- package/lib/cjs/entry/dependenciesNumber/dependenciesCeil.generated.js +3 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesFix.generated.js +6 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesFloor.generated.js +3 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesIndexNode.generated.js +0 -3
- package/lib/cjs/entry/impureFunctionsAny.generated.js +0 -1
- package/lib/cjs/entry/impureFunctionsNumber.generated.js +6 -7
- package/lib/cjs/entry/pureFunctionsAny.generated.js +10 -3
- package/lib/cjs/entry/pureFunctionsNumber.generated.js +21 -15
- package/lib/cjs/expression/node/IndexNode.js +26 -61
- package/lib/cjs/factoriesNumber.js +29 -24
- package/lib/cjs/function/algebra/resolve.js +3 -3
- package/lib/cjs/function/arithmetic/ceil.js +75 -39
- package/lib/cjs/function/arithmetic/fix.js +54 -16
- package/lib/cjs/function/arithmetic/floor.js +79 -37
- package/lib/cjs/function/arithmetic/nthRoot.js +1 -3
- package/lib/cjs/function/arithmetic/round.js +27 -47
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/plain/number/arithmetic.js +9 -27
- package/lib/cjs/type/matrix/function/sparse.js +6 -0
- package/lib/cjs/utils/lruQueue.js +1 -3
- package/lib/cjs/utils/object.js +3 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/entry/dependenciesAny/dependenciesCeil.generated.js +4 -0
- package/lib/esm/entry/dependenciesAny/dependenciesFix.generated.js +6 -0
- package/lib/esm/entry/dependenciesAny/dependenciesFloor.generated.js +4 -0
- package/lib/esm/entry/dependenciesAny/dependenciesIndexNode.generated.js +0 -2
- package/lib/esm/entry/dependenciesNumber/dependenciesCeil.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesFix.generated.js +4 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesFloor.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesIndexNode.generated.js +0 -2
- package/lib/esm/entry/impureFunctionsAny.generated.js +0 -1
- package/lib/esm/entry/impureFunctionsNumber.generated.js +7 -8
- package/lib/esm/entry/pureFunctionsAny.generated.js +10 -3
- package/lib/esm/entry/pureFunctionsNumber.generated.js +16 -10
- package/lib/esm/expression/node/BlockNode.js +3 -3
- package/lib/esm/expression/node/IndexNode.js +22 -59
- package/lib/esm/expression/parse.js +5 -5
- package/lib/esm/factoriesNumber.js +6 -6
- package/lib/esm/function/algebra/decomposition/qr.js +2 -2
- package/lib/esm/function/algebra/resolve.js +3 -3
- package/lib/esm/function/algebra/solver/utils/solveValidation.js +5 -5
- package/lib/esm/function/algebra/sparse/csChol.js +2 -2
- package/lib/esm/function/algebra/sparse/csLeaf.js +2 -2
- package/lib/esm/function/algebra/sparse/csLu.js +3 -3
- package/lib/esm/function/arithmetic/ceil.js +61 -24
- package/lib/esm/function/arithmetic/fix.js +51 -13
- package/lib/esm/function/arithmetic/floor.js +65 -23
- package/lib/esm/function/arithmetic/nthRoot.js +1 -3
- package/lib/esm/function/arithmetic/nthRoots.js +1 -1
- package/lib/esm/function/arithmetic/round.js +25 -43
- package/lib/esm/function/matrix/expm.js +2 -2
- package/lib/esm/function/probability/gamma.js +1 -1
- package/lib/esm/function/string/bin.js +1 -1
- package/lib/esm/function/string/hex.js +1 -1
- package/lib/esm/function/string/oct.js +1 -1
- package/lib/esm/plain/number/arithmetic.js +9 -17
- package/lib/esm/type/complex/Complex.js +2 -2
- package/lib/esm/type/matrix/DenseMatrix.js +2 -2
- package/lib/esm/type/matrix/FibonacciHeap.js +2 -2
- package/lib/esm/type/matrix/SparseMatrix.js +13 -13
- package/lib/esm/type/matrix/function/sparse.js +6 -0
- package/lib/esm/type/unit/Unit.js +7 -7
- package/lib/esm/utils/lruQueue.js +1 -2
- package/lib/esm/utils/number.js +3 -3
- package/lib/esm/utils/object.js +3 -1
- package/lib/esm/version.js +1 -1
- package/package.json +14 -3
- package/types/index.d.ts +1794 -1372
- package/types/index.ts +697 -266
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.ceilDependencies = void 0;
|
7
7
|
|
8
|
+
var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js");
|
9
|
+
|
8
10
|
var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js");
|
9
11
|
|
10
12
|
var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js");
|
@@ -13,6 +15,8 @@ var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js");
|
|
13
15
|
|
14
16
|
var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js");
|
15
17
|
|
18
|
+
var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js");
|
19
|
+
|
16
20
|
var _factoriesAny = require("../../factoriesAny.js");
|
17
21
|
|
18
22
|
/**
|
@@ -20,10 +24,12 @@ var _factoriesAny = require("../../factoriesAny.js");
|
|
20
24
|
* DON'T MAKE CHANGES HERE
|
21
25
|
*/
|
22
26
|
var ceilDependencies = {
|
27
|
+
DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies,
|
23
28
|
equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies,
|
24
29
|
matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies,
|
25
30
|
roundDependencies: _dependenciesRoundGenerated.roundDependencies,
|
26
31
|
typedDependencies: _dependenciesTypedGenerated.typedDependencies,
|
32
|
+
zerosDependencies: _dependenciesZerosGenerated.zerosDependencies,
|
27
33
|
createCeil: _factoriesAny.createCeil
|
28
34
|
};
|
29
35
|
exports.ceilDependencies = ceilDependencies;
|
@@ -7,14 +7,20 @@ exports.fixDependencies = void 0;
|
|
7
7
|
|
8
8
|
var _dependenciesComplexClassGenerated = require("./dependenciesComplexClass.generated.js");
|
9
9
|
|
10
|
+
var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js");
|
11
|
+
|
10
12
|
var _dependenciesCeilGenerated = require("./dependenciesCeil.generated.js");
|
11
13
|
|
14
|
+
var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js");
|
15
|
+
|
12
16
|
var _dependenciesFloorGenerated = require("./dependenciesFloor.generated.js");
|
13
17
|
|
14
18
|
var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js");
|
15
19
|
|
16
20
|
var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js");
|
17
21
|
|
22
|
+
var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js");
|
23
|
+
|
18
24
|
var _factoriesAny = require("../../factoriesAny.js");
|
19
25
|
|
20
26
|
/**
|
@@ -23,10 +29,13 @@ var _factoriesAny = require("../../factoriesAny.js");
|
|
23
29
|
*/
|
24
30
|
var fixDependencies = {
|
25
31
|
ComplexDependencies: _dependenciesComplexClassGenerated.ComplexDependencies,
|
32
|
+
DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies,
|
26
33
|
ceilDependencies: _dependenciesCeilGenerated.ceilDependencies,
|
34
|
+
equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies,
|
27
35
|
floorDependencies: _dependenciesFloorGenerated.floorDependencies,
|
28
36
|
matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies,
|
29
37
|
typedDependencies: _dependenciesTypedGenerated.typedDependencies,
|
38
|
+
zerosDependencies: _dependenciesZerosGenerated.zerosDependencies,
|
30
39
|
createFix: _factoriesAny.createFix
|
31
40
|
};
|
32
41
|
exports.fixDependencies = fixDependencies;
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.floorDependencies = void 0;
|
7
7
|
|
8
|
+
var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js");
|
9
|
+
|
8
10
|
var _dependenciesEqualScalarGenerated = require("./dependenciesEqualScalar.generated.js");
|
9
11
|
|
10
12
|
var _dependenciesMatrixGenerated = require("./dependenciesMatrix.generated.js");
|
@@ -13,6 +15,8 @@ var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js");
|
|
13
15
|
|
14
16
|
var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js");
|
15
17
|
|
18
|
+
var _dependenciesZerosGenerated = require("./dependenciesZeros.generated.js");
|
19
|
+
|
16
20
|
var _factoriesAny = require("../../factoriesAny.js");
|
17
21
|
|
18
22
|
/**
|
@@ -20,10 +24,12 @@ var _factoriesAny = require("../../factoriesAny.js");
|
|
20
24
|
* DON'T MAKE CHANGES HERE
|
21
25
|
*/
|
22
26
|
var floorDependencies = {
|
27
|
+
DenseMatrixDependencies: _dependenciesDenseMatrixClassGenerated.DenseMatrixDependencies,
|
23
28
|
equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies,
|
24
29
|
matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies,
|
25
30
|
roundDependencies: _dependenciesRoundGenerated.roundDependencies,
|
26
31
|
typedDependencies: _dependenciesTypedGenerated.typedDependencies,
|
32
|
+
zerosDependencies: _dependenciesZerosGenerated.zerosDependencies,
|
27
33
|
createFloor: _factoriesAny.createFloor
|
28
34
|
};
|
29
35
|
exports.floorDependencies = floorDependencies;
|
@@ -7,8 +7,6 @@ exports.IndexNodeDependencies = void 0;
|
|
7
7
|
|
8
8
|
var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js");
|
9
9
|
|
10
|
-
var _dependenciesRangeClassGenerated = require("./dependenciesRangeClass.generated.js");
|
11
|
-
|
12
10
|
var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js");
|
13
11
|
|
14
12
|
var _factoriesAny = require("../../factoriesAny.js");
|
@@ -19,7 +17,6 @@ var _factoriesAny = require("../../factoriesAny.js");
|
|
19
17
|
*/
|
20
18
|
var IndexNodeDependencies = {
|
21
19
|
NodeDependencies: _dependenciesNodeGenerated.NodeDependencies,
|
22
|
-
RangeDependencies: _dependenciesRangeClassGenerated.RangeDependencies,
|
23
20
|
sizeDependencies: _dependenciesSizeGenerated.sizeDependencies,
|
24
21
|
createIndexNode: _factoriesAny.createIndexNode
|
25
22
|
};
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.ceilDependencies = void 0;
|
7
7
|
|
8
|
+
var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js");
|
9
|
+
|
8
10
|
var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js");
|
9
11
|
|
10
12
|
var _factoriesNumber = require("../../factoriesNumber.js");
|
@@ -14,6 +16,7 @@ var _factoriesNumber = require("../../factoriesNumber.js");
|
|
14
16
|
* DON'T MAKE CHANGES HERE
|
15
17
|
*/
|
16
18
|
var ceilDependencies = {
|
19
|
+
roundDependencies: _dependenciesRoundGenerated.roundDependencies,
|
17
20
|
typedDependencies: _dependenciesTypedGenerated.typedDependencies,
|
18
21
|
createCeil: _factoriesNumber.createCeil
|
19
22
|
};
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.fixDependencies = void 0;
|
7
7
|
|
8
|
+
var _dependenciesCeilGenerated = require("./dependenciesCeil.generated.js");
|
9
|
+
|
10
|
+
var _dependenciesFloorGenerated = require("./dependenciesFloor.generated.js");
|
11
|
+
|
8
12
|
var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js");
|
9
13
|
|
10
14
|
var _factoriesNumber = require("../../factoriesNumber.js");
|
@@ -14,6 +18,8 @@ var _factoriesNumber = require("../../factoriesNumber.js");
|
|
14
18
|
* DON'T MAKE CHANGES HERE
|
15
19
|
*/
|
16
20
|
var fixDependencies = {
|
21
|
+
ceilDependencies: _dependenciesCeilGenerated.ceilDependencies,
|
22
|
+
floorDependencies: _dependenciesFloorGenerated.floorDependencies,
|
17
23
|
typedDependencies: _dependenciesTypedGenerated.typedDependencies,
|
18
24
|
createFix: _factoriesNumber.createFix
|
19
25
|
};
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.floorDependencies = void 0;
|
7
7
|
|
8
|
+
var _dependenciesRoundGenerated = require("./dependenciesRound.generated.js");
|
9
|
+
|
8
10
|
var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js");
|
9
11
|
|
10
12
|
var _factoriesNumber = require("../../factoriesNumber.js");
|
@@ -14,6 +16,7 @@ var _factoriesNumber = require("../../factoriesNumber.js");
|
|
14
16
|
* DON'T MAKE CHANGES HERE
|
15
17
|
*/
|
16
18
|
var floorDependencies = {
|
19
|
+
roundDependencies: _dependenciesRoundGenerated.roundDependencies,
|
17
20
|
typedDependencies: _dependenciesTypedGenerated.typedDependencies,
|
18
21
|
createFloor: _factoriesNumber.createFloor
|
19
22
|
};
|
@@ -7,8 +7,6 @@ exports.IndexNodeDependencies = void 0;
|
|
7
7
|
|
8
8
|
var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js");
|
9
9
|
|
10
|
-
var _dependenciesRangeClassGenerated = require("./dependenciesRangeClass.generated.js");
|
11
|
-
|
12
10
|
var _dependenciesSizeGenerated = require("./dependenciesSize.generated.js");
|
13
11
|
|
14
12
|
var _factoriesNumber = require("../../factoriesNumber.js");
|
@@ -19,7 +17,6 @@ var _factoriesNumber = require("../../factoriesNumber.js");
|
|
19
17
|
*/
|
20
18
|
var IndexNodeDependencies = {
|
21
19
|
NodeDependencies: _dependenciesNodeGenerated.NodeDependencies,
|
22
|
-
RangeDependencies: _dependenciesRangeClassGenerated.RangeDependencies,
|
23
20
|
sizeDependencies: _dependenciesSizeGenerated.sizeDependencies,
|
24
21
|
createIndexNode: _factoriesNumber.createIndexNode
|
25
22
|
};
|
@@ -106,7 +106,6 @@ var AssignmentNode = (0, _factoriesAny.createAssignmentNode)({
|
|
106
106
|
exports.AssignmentNode = AssignmentNode;
|
107
107
|
var IndexNode = (0, _factoriesAny.createIndexNode)({
|
108
108
|
Node: Node,
|
109
|
-
Range: _pureFunctionsAnyGenerated.Range,
|
110
109
|
size: _pureFunctionsAnyGenerated.size
|
111
110
|
});
|
112
111
|
exports.IndexNode = IndexNode;
|
@@ -96,7 +96,6 @@ var FunctionNode = (0, _factoriesNumber.createFunctionNode)({
|
|
96
96
|
exports.FunctionNode = FunctionNode;
|
97
97
|
var IndexNode = (0, _factoriesNumber.createIndexNode)({
|
98
98
|
Node: Node,
|
99
|
-
Range: _pureFunctionsNumberGenerated.Range,
|
100
99
|
size: _pureFunctionsNumberGenerated.size
|
101
100
|
});
|
102
101
|
exports.IndexNode = IndexNode;
|
@@ -312,7 +311,6 @@ exports.parser = parser;
|
|
312
311
|
erf: _pureFunctionsNumberGenerated.erf,
|
313
312
|
exp: _pureFunctionsNumberGenerated.exp,
|
314
313
|
filter: _pureFunctionsNumberGenerated.filter,
|
315
|
-
fix: _pureFunctionsNumberGenerated.fix,
|
316
314
|
forEach: _pureFunctionsNumberGenerated.forEach,
|
317
315
|
format: _pureFunctionsNumberGenerated.format,
|
318
316
|
gamma: _pureFunctionsNumberGenerated.gamma,
|
@@ -353,8 +351,8 @@ exports.parser = parser;
|
|
353
351
|
addScalar: _pureFunctionsNumberGenerated.addScalar,
|
354
352
|
asech: _pureFunctionsNumberGenerated.asech,
|
355
353
|
bitNot: _pureFunctionsNumberGenerated.bitNot,
|
356
|
-
|
357
|
-
|
354
|
+
clone: _pureFunctionsNumberGenerated.clone,
|
355
|
+
compareNatural: _pureFunctionsNumberGenerated.compareNatural,
|
358
356
|
cosh: _pureFunctionsNumberGenerated.cosh,
|
359
357
|
csch: _pureFunctionsNumberGenerated.csch,
|
360
358
|
divideScalar: _pureFunctionsNumberGenerated.divideScalar,
|
@@ -378,7 +376,7 @@ exports.parser = parser;
|
|
378
376
|
apply: _pureFunctionsNumberGenerated.apply,
|
379
377
|
asinh: _pureFunctionsNumberGenerated.asinh,
|
380
378
|
bitXor: _pureFunctionsNumberGenerated.bitXor,
|
381
|
-
|
379
|
+
combinationsWithRep: _pureFunctionsNumberGenerated.combinationsWithRep,
|
382
380
|
cumsum: _pureFunctionsNumberGenerated.cumsum,
|
383
381
|
equal: _pureFunctionsNumberGenerated.equal,
|
384
382
|
factorial: _pureFunctionsNumberGenerated.factorial,
|
@@ -411,15 +409,16 @@ exports.parser = parser;
|
|
411
409
|
sign: _pureFunctionsNumberGenerated.sign,
|
412
410
|
std: _pureFunctionsNumberGenerated.std,
|
413
411
|
'PI': _pureFunctionsNumberGenerated.pi,
|
414
|
-
|
412
|
+
ceil: _pureFunctionsNumberGenerated.ceil,
|
415
413
|
coth: _pureFunctionsNumberGenerated.coth,
|
416
|
-
|
414
|
+
fix: _pureFunctionsNumberGenerated.fix,
|
417
415
|
isPrime: _pureFunctionsNumberGenerated.isPrime,
|
418
416
|
numeric: _pureFunctionsNumberGenerated.numeric,
|
419
417
|
prod: _pureFunctionsNumberGenerated.prod,
|
420
418
|
simplifyCore: simplifyCore,
|
421
419
|
sum: _pureFunctionsNumberGenerated.sum,
|
422
420
|
bellNumbers: _pureFunctionsNumberGenerated.bellNumbers,
|
421
|
+
gcd: _pureFunctionsNumberGenerated.gcd,
|
423
422
|
mad: _pureFunctionsNumberGenerated.mad,
|
424
423
|
max: _pureFunctionsNumberGenerated.max,
|
425
424
|
parse: parse,
|
@@ -944,11 +944,13 @@ var equalText = /* #__PURE__ */(0, _factoriesAny.createEqualText)({
|
|
944
944
|
});
|
945
945
|
exports.equalText = equalText;
|
946
946
|
var floor = /* #__PURE__ */(0, _factoriesAny.createFloor)({
|
947
|
+
DenseMatrix: DenseMatrix,
|
947
948
|
config: _configReadonly.config,
|
948
949
|
equalScalar: equalScalar,
|
949
950
|
matrix: matrix,
|
950
951
|
round: round,
|
951
|
-
typed: typed
|
952
|
+
typed: typed,
|
953
|
+
zeros: zeros
|
952
954
|
});
|
953
955
|
exports.floor = floor;
|
954
956
|
var identity = /* #__PURE__ */(0, _factoriesAny.createIdentity)({
|
@@ -1133,11 +1135,13 @@ var asin = /* #__PURE__ */(0, _factoriesAny.createAsin)({
|
|
1133
1135
|
});
|
1134
1136
|
exports.asin = asin;
|
1135
1137
|
var ceil = /* #__PURE__ */(0, _factoriesAny.createCeil)({
|
1138
|
+
DenseMatrix: DenseMatrix,
|
1136
1139
|
config: _configReadonly.config,
|
1137
1140
|
equalScalar: equalScalar,
|
1138
1141
|
matrix: matrix,
|
1139
1142
|
round: round,
|
1140
|
-
typed: typed
|
1143
|
+
typed: typed,
|
1144
|
+
zeros: zeros
|
1141
1145
|
});
|
1142
1146
|
exports.ceil = ceil;
|
1143
1147
|
var column = /* #__PURE__ */(0, _factoriesAny.createColumn)({
|
@@ -1199,10 +1203,13 @@ var FibonacciHeap = /* #__PURE__ */(0, _factoriesAny.createFibonacciHeapClass)({
|
|
1199
1203
|
exports.FibonacciHeap = FibonacciHeap;
|
1200
1204
|
var fix = /* #__PURE__ */(0, _factoriesAny.createFix)({
|
1201
1205
|
Complex: Complex,
|
1206
|
+
DenseMatrix: DenseMatrix,
|
1202
1207
|
ceil: ceil,
|
1208
|
+
equalScalar: equalScalar,
|
1203
1209
|
floor: floor,
|
1204
1210
|
matrix: matrix,
|
1205
|
-
typed: typed
|
1211
|
+
typed: typed,
|
1212
|
+
zeros: zeros
|
1206
1213
|
});
|
1207
1214
|
exports.fix = fix;
|
1208
1215
|
var index = /* #__PURE__ */(0, _factoriesAny.createIndex)({
|
@@ -188,10 +188,6 @@ var filter = /* #__PURE__ */(0, _factoriesNumber.createFilter)({
|
|
188
188
|
typed: typed
|
189
189
|
});
|
190
190
|
exports.filter = filter;
|
191
|
-
var fix = /* #__PURE__ */(0, _factoriesNumber.createFix)({
|
192
|
-
typed: typed
|
193
|
-
});
|
194
|
-
exports.fix = fix;
|
195
191
|
var forEach = /* #__PURE__ */(0, _factoriesNumber.createForEach)({
|
196
192
|
typed: typed
|
197
193
|
});
|
@@ -356,14 +352,15 @@ var bitNot = /* #__PURE__ */(0, _factoriesNumber.createBitNot)({
|
|
356
352
|
typed: typed
|
357
353
|
});
|
358
354
|
exports.bitNot = bitNot;
|
359
|
-
var
|
355
|
+
var clone = /* #__PURE__ */(0, _factoriesNumber.createClone)({
|
360
356
|
typed: typed
|
361
357
|
});
|
362
|
-
exports.
|
363
|
-
var
|
358
|
+
exports.clone = clone;
|
359
|
+
var compareNatural = /* #__PURE__ */(0, _factoriesNumber.createCompareNatural)({
|
360
|
+
compare: compare,
|
364
361
|
typed: typed
|
365
362
|
});
|
366
|
-
exports.
|
363
|
+
exports.compareNatural = compareNatural;
|
367
364
|
var cosh = /* #__PURE__ */(0, _factoriesNumber.createCosh)({
|
368
365
|
typed: typed
|
369
366
|
});
|
@@ -461,10 +458,10 @@ var bitXor = /* #__PURE__ */(0, _factoriesNumber.createBitXor)({
|
|
461
458
|
typed: typed
|
462
459
|
});
|
463
460
|
exports.bitXor = bitXor;
|
464
|
-
var
|
461
|
+
var combinationsWithRep = /* #__PURE__ */(0, _factoriesNumber.createCombinationsWithRep)({
|
465
462
|
typed: typed
|
466
463
|
});
|
467
|
-
exports.
|
464
|
+
exports.combinationsWithRep = combinationsWithRep;
|
468
465
|
var cumsum = /* #__PURE__ */(0, _factoriesNumber.createCumSum)({
|
469
466
|
add: add,
|
470
467
|
typed: typed,
|
@@ -600,6 +597,8 @@ var deepEqual = /* #__PURE__ */(0, _factoriesNumber.createDeepEqual)({
|
|
600
597
|
});
|
601
598
|
exports.deepEqual = deepEqual;
|
602
599
|
var floor = /* #__PURE__ */(0, _factoriesNumber.createFloor)({
|
600
|
+
config: _configReadonly.config,
|
601
|
+
round: round,
|
603
602
|
typed: typed
|
604
603
|
});
|
605
604
|
exports.floor = floor;
|
@@ -661,19 +660,22 @@ var std = /* #__PURE__ */(0, _factoriesNumber.createStd)({
|
|
661
660
|
variance: variance
|
662
661
|
});
|
663
662
|
exports.std = std;
|
664
|
-
var
|
665
|
-
|
663
|
+
var ceil = /* #__PURE__ */(0, _factoriesNumber.createCeil)({
|
664
|
+
config: _configReadonly.config,
|
665
|
+
round: round,
|
666
666
|
typed: typed
|
667
667
|
});
|
668
|
-
exports.
|
668
|
+
exports.ceil = ceil;
|
669
669
|
var coth = /* #__PURE__ */(0, _factoriesNumber.createCoth)({
|
670
670
|
typed: typed
|
671
671
|
});
|
672
672
|
exports.coth = coth;
|
673
|
-
var
|
673
|
+
var fix = /* #__PURE__ */(0, _factoriesNumber.createFix)({
|
674
|
+
ceil: ceil,
|
675
|
+
floor: floor,
|
674
676
|
typed: typed
|
675
677
|
});
|
676
|
-
exports.
|
678
|
+
exports.fix = fix;
|
677
679
|
var isPrime = /* #__PURE__ */(0, _factoriesNumber.createIsPrime)({
|
678
680
|
typed: typed
|
679
681
|
});
|
@@ -704,6 +706,10 @@ var bellNumbers = /* #__PURE__ */(0, _factoriesNumber.createBellNumbers)({
|
|
704
706
|
typed: typed
|
705
707
|
});
|
706
708
|
exports.bellNumbers = bellNumbers;
|
709
|
+
var gcd = /* #__PURE__ */(0, _factoriesNumber.createGcd)({
|
710
|
+
typed: typed
|
711
|
+
});
|
712
|
+
exports.gcd = gcd;
|
707
713
|
var mad = /* #__PURE__ */(0, _factoriesNumber.createMad)({
|
708
714
|
abs: abs,
|
709
715
|
map: map,
|
@@ -9,21 +9,20 @@ exports.createIndexNode = void 0;
|
|
9
9
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
11
11
|
|
12
|
-
var _is = require("../../utils/is.js");
|
13
|
-
|
14
12
|
var _array = require("../../utils/array.js");
|
15
13
|
|
16
|
-
var
|
14
|
+
var _customs = require("../../utils/customs.js");
|
17
15
|
|
18
16
|
var _factory = require("../../utils/factory.js");
|
19
17
|
|
20
|
-
var
|
18
|
+
var _is = require("../../utils/is.js");
|
19
|
+
|
20
|
+
var _string = require("../../utils/string.js");
|
21
21
|
|
22
22
|
var name = 'IndexNode';
|
23
|
-
var dependencies = ['
|
23
|
+
var dependencies = ['Node', 'size'];
|
24
24
|
var createIndexNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, function (_ref) {
|
25
|
-
var
|
26
|
-
Node = _ref.Node,
|
25
|
+
var Node = _ref.Node,
|
27
26
|
size = _ref.size;
|
28
27
|
|
29
28
|
/**
|
@@ -81,61 +80,32 @@ var createIndexNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, f
|
|
81
80
|
// TODO: Optimization: when the range values are ConstantNodes,
|
82
81
|
// we can beforehand resolve the zero-based value
|
83
82
|
// optimization for a simple object property
|
84
|
-
var evalDimensions = (0, _array.map)(this.dimensions, function (
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
return 1;
|
97
|
-
};
|
98
|
-
return function evalDimension(scope, args, context) {
|
99
|
-
var s = size(context).valueOf();
|
100
|
-
var childArgs = Object.create(args);
|
101
|
-
childArgs.end = s[i];
|
102
|
-
return createRange(evalStart(scope, childArgs, context), evalEnd(scope, childArgs, context), evalStep(scope, childArgs, context));
|
103
|
-
};
|
104
|
-
} else {
|
105
|
-
// create range
|
106
|
-
var _evalStart = range.start._compile(math, argNames);
|
107
|
-
|
108
|
-
var _evalEnd = range.end._compile(math, argNames);
|
109
|
-
|
110
|
-
var _evalStep = range.step ? range.step._compile(math, argNames) : function () {
|
111
|
-
return 1;
|
112
|
-
};
|
113
|
-
|
114
|
-
return function evalDimension(scope, args, context) {
|
115
|
-
return createRange(_evalStart(scope, args, context), _evalEnd(scope, args, context), _evalStep(scope, args, context));
|
116
|
-
};
|
117
|
-
}
|
118
|
-
} else if ((0, _is.isSymbolNode)(range) && range.name === 'end') {
|
119
|
-
// SymbolNode 'end'
|
120
|
-
var _childArgNames = Object.create(argNames);
|
121
|
-
|
122
|
-
_childArgNames.end = true;
|
123
|
-
|
124
|
-
var evalRange = range._compile(math, _childArgNames);
|
83
|
+
var evalDimensions = (0, _array.map)(this.dimensions, function (dimension, i) {
|
84
|
+
var needsEnd = dimension.filter(function (node) {
|
85
|
+
return node.isSymbolNode && node.name === 'end';
|
86
|
+
}).length > 0;
|
87
|
+
|
88
|
+
if (needsEnd) {
|
89
|
+
// SymbolNode 'end' is used inside the index,
|
90
|
+
// like in `A[end]` or `A[end - 2]`
|
91
|
+
var childArgNames = Object.create(argNames);
|
92
|
+
childArgNames.end = true;
|
93
|
+
|
94
|
+
var _evalDimension = dimension._compile(math, childArgNames);
|
125
95
|
|
126
96
|
return function evalDimension(scope, args, context) {
|
97
|
+
if (!(0, _is.isMatrix)(context) && !(0, _is.isArray)(context) && !(0, _is.isString)(context)) {
|
98
|
+
throw new TypeError('Cannot resolve "end": ' + 'context must be a Matrix, Array, or string but is ' + (0, _is.typeOf)(context));
|
99
|
+
}
|
100
|
+
|
127
101
|
var s = size(context).valueOf();
|
128
102
|
var childArgs = Object.create(args);
|
129
103
|
childArgs.end = s[i];
|
130
|
-
return
|
104
|
+
return _evalDimension(scope, childArgs, context);
|
131
105
|
};
|
132
106
|
} else {
|
133
|
-
//
|
134
|
-
|
135
|
-
|
136
|
-
return function evalDimension(scope, args, context) {
|
137
|
-
return _evalRange(scope, args, context);
|
138
|
-
};
|
107
|
+
// SymbolNode `end` not used
|
108
|
+
return dimension._compile(math, argNames);
|
139
109
|
}
|
140
110
|
});
|
141
111
|
var index = (0, _customs.getSafeProperty)(math, 'index');
|
@@ -271,12 +241,7 @@ var createIndexNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, f
|
|
271
241
|
return range.toTex(options);
|
272
242
|
});
|
273
243
|
return this.dotNotation ? '.' + this.getObjectProperty() + '' : '_{' + dimensions.join(',') + '}';
|
274
|
-
};
|
275
|
-
|
276
|
-
|
277
|
-
function createRange(start, end, step) {
|
278
|
-
return new Range((0, _is.isBigNumber)(start) ? start.toNumber() : start, (0, _is.isBigNumber)(end) ? end.toNumber() : end, (0, _is.isBigNumber)(step) ? step.toNumber() : step);
|
279
|
-
}
|
244
|
+
};
|
280
245
|
|
281
246
|
return IndexNode;
|
282
247
|
}, {
|
@@ -62,7 +62,13 @@ Object.defineProperty(exports, "createCatalan", {
|
|
62
62
|
return _catalan.createCatalan;
|
63
63
|
}
|
64
64
|
});
|
65
|
-
exports.
|
65
|
+
exports.createCbrt = void 0;
|
66
|
+
Object.defineProperty(exports, "createCeil", {
|
67
|
+
enumerable: true,
|
68
|
+
get: function get() {
|
69
|
+
return _ceil.createCeilNumber;
|
70
|
+
}
|
71
|
+
});
|
66
72
|
Object.defineProperty(exports, "createChain", {
|
67
73
|
enumerable: true,
|
68
74
|
get: function get() {
|
@@ -217,7 +223,18 @@ Object.defineProperty(exports, "createFilterTransform", {
|
|
217
223
|
return _filterTransform.createFilterTransform;
|
218
224
|
}
|
219
225
|
});
|
220
|
-
exports
|
226
|
+
Object.defineProperty(exports, "createFix", {
|
227
|
+
enumerable: true,
|
228
|
+
get: function get() {
|
229
|
+
return _fix.createFixNumber;
|
230
|
+
}
|
231
|
+
});
|
232
|
+
Object.defineProperty(exports, "createFloor", {
|
233
|
+
enumerable: true,
|
234
|
+
get: function get() {
|
235
|
+
return _floor.createFloorNumber;
|
236
|
+
}
|
237
|
+
});
|
221
238
|
Object.defineProperty(exports, "createForEach", {
|
222
239
|
enumerable: true,
|
223
240
|
get: function get() {
|
@@ -426,13 +443,7 @@ Object.defineProperty(exports, "createNode", {
|
|
426
443
|
return _Node.createNode;
|
427
444
|
}
|
428
445
|
});
|
429
|
-
exports.createNot = exports.createNorm = void 0;
|
430
|
-
Object.defineProperty(exports, "createNthRoot", {
|
431
|
-
enumerable: true,
|
432
|
-
get: function get() {
|
433
|
-
return _nthRoot.createNthRootNumber;
|
434
|
-
}
|
435
|
-
});
|
446
|
+
exports.createNthRoot = exports.createNot = exports.createNorm = void 0;
|
436
447
|
Object.defineProperty(exports, "createNull", {
|
437
448
|
enumerable: true,
|
438
449
|
get: function get() {
|
@@ -609,13 +620,7 @@ Object.defineProperty(exports, "createReviver", {
|
|
609
620
|
return _reviver.createReviver;
|
610
621
|
}
|
611
622
|
});
|
612
|
-
exports.createRightLogShift = exports.createRightArithShift = void 0;
|
613
|
-
Object.defineProperty(exports, "createRound", {
|
614
|
-
enumerable: true,
|
615
|
-
get: function get() {
|
616
|
-
return _round.createRoundNumber;
|
617
|
-
}
|
618
|
-
});
|
623
|
+
exports.createRound = exports.createRightLogShift = exports.createRightArithShift = void 0;
|
619
624
|
Object.defineProperty(exports, "createSQRT1_2", {
|
620
625
|
enumerable: true,
|
621
626
|
get: function get() {
|
@@ -798,9 +803,11 @@ var _derivative = require("./function/algebra/derivative.js");
|
|
798
803
|
|
799
804
|
var _rationalize = require("./function/algebra/rationalize.js");
|
800
805
|
|
801
|
-
var
|
806
|
+
var _ceil = require("./function/arithmetic/ceil.js");
|
807
|
+
|
808
|
+
var _fix = require("./function/arithmetic/fix.js");
|
802
809
|
|
803
|
-
var
|
810
|
+
var _floor = require("./function/arithmetic/floor.js");
|
804
811
|
|
805
812
|
var _hypot = require("./function/arithmetic/hypot.js");
|
806
813
|
|
@@ -1000,18 +1007,12 @@ var createAddScalar = /* #__PURE__ */createNumberFactory('addScalar', _index.add
|
|
1000
1007
|
exports.createAddScalar = createAddScalar;
|
1001
1008
|
var createCbrt = /* #__PURE__ */createNumberFactory('cbrt', _index.cbrtNumber);
|
1002
1009
|
exports.createCbrt = createCbrt;
|
1003
|
-
var createCeil = /* #__PURE__ */createNumberFactory('ceil', _index.ceilNumber);
|
1004
|
-
exports.createCeil = createCeil;
|
1005
1010
|
var createCube = /* #__PURE__ */createNumberFactory('cube', _index.cubeNumber);
|
1006
1011
|
exports.createCube = createCube;
|
1007
1012
|
var createExp = /* #__PURE__ */createNumberFactory('exp', _index.expNumber);
|
1008
1013
|
exports.createExp = createExp;
|
1009
1014
|
var createExpm1 = /* #__PURE__ */createNumberFactory('expm1', _index.expm1Number);
|
1010
1015
|
exports.createExpm1 = createExpm1;
|
1011
|
-
var createFix = /* #__PURE__ */createNumberFactory('fix', _index.fixNumber);
|
1012
|
-
exports.createFix = createFix;
|
1013
|
-
var createFloor = /* #__PURE__ */createNumberFactory('floor', _index.floorNumber);
|
1014
|
-
exports.createFloor = createFloor;
|
1015
1016
|
var createGcd = /* #__PURE__ */createNumberFactory('gcd', _index.gcdNumber);
|
1016
1017
|
exports.createGcd = createGcd;
|
1017
1018
|
var createLcm = /* #__PURE__ */createNumberFactory('lcm', _index.lcmNumber);
|
@@ -1026,6 +1027,8 @@ var createMultiplyScalar = /* #__PURE__ */createNumberFactory('multiplyScalar',
|
|
1026
1027
|
exports.createMultiplyScalar = createMultiplyScalar;
|
1027
1028
|
var createMultiply = /* #__PURE__ */createNumberFactory('multiply', _index.multiplyNumber);
|
1028
1029
|
exports.createMultiply = createMultiply;
|
1030
|
+
var createNthRoot = /* #__PURE__ */createNumberOptionalSecondArgFactory('nthRoot', _index.nthRootNumber);
|
1031
|
+
exports.createNthRoot = createNthRoot;
|
1029
1032
|
var createSign = /* #__PURE__ */createNumberFactory('sign', _index.signNumber);
|
1030
1033
|
exports.createSign = createSign;
|
1031
1034
|
var createSqrt = /* #__PURE__ */createNumberFactory('sqrt', _index.sqrtNumber);
|
@@ -1040,6 +1043,8 @@ var createDivideScalar = /* #__PURE__ */createNumberFactory('divideScalar', _ind
|
|
1040
1043
|
exports.createDivideScalar = createDivideScalar;
|
1041
1044
|
var createPow = /* #__PURE__ */createNumberFactory('pow', _index.powNumber);
|
1042
1045
|
exports.createPow = createPow;
|
1046
|
+
var createRound = /* #__PURE__ */createNumberOptionalSecondArgFactory('round', _index.roundNumber);
|
1047
|
+
exports.createRound = createRound;
|
1043
1048
|
var createLog = /* #__PURE__ */createNumberOptionalSecondArgFactory('log', _index.logNumber);
|
1044
1049
|
exports.createLog = createLog;
|
1045
1050
|
var createLog1p = /* #__PURE__ */createNumberFactory('log1p', _index.log1pNumber);
|
@@ -37,11 +37,11 @@ var createResolve = /* #__PURE__ */(0, _factory.factory)(name, dependencies, fun
|
|
37
37
|
*
|
38
38
|
* simplify, evaluate
|
39
39
|
*
|
40
|
-
* @param {Node} node
|
41
|
-
* The expression tree to be simplified
|
40
|
+
* @param {Node | Node[]} node
|
41
|
+
* The expression tree (or trees) to be simplified
|
42
42
|
* @param {Object} scope
|
43
43
|
* Scope specifying variables to be resolved
|
44
|
-
* @return {Node} Returns `node` with variables recursively substituted.
|
44
|
+
* @return {Node | Node[]} Returns `node` with variables recursively substituted.
|
45
45
|
* @throws {ReferenceError}
|
46
46
|
* If there is a cyclic dependency among the variables in `scope`,
|
47
47
|
* resolution is impossible and a ReferenceError is thrown.
|