mathjs 15.1.1 → 15.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HISTORY.md +82 -3
- package/README.md +22 -5
- package/lib/browser/math.js +1 -1
- package/lib/browser/math.js.LICENSE.txt +3 -3
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/constants.js +27 -57
- package/lib/cjs/core/create.js +2 -1
- package/lib/cjs/core/function/typed.js +7 -6
- package/lib/cjs/defaultInstance.js +2 -1
- package/lib/cjs/entry/allFactoriesAny.js +2 -1
- package/lib/cjs/entry/allFactoriesNumber.js +2 -1
- package/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js +0 -6
- package/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesAndTransform.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesBitAndTransform.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesCatalan.generated.js +8 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesDen.generated.js +19 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js +4 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesInvmod.generated.js +4 -6
- package/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js +2 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesLsolveAll.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js +2 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js +2 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesMultinomial.generated.js +6 -6
- package/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesNum.generated.js +19 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js +0 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js +2 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js +2 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js +4 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js +4 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js +0 -6
- package/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js +2 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny.generated.js +14 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesCatalan.generated.js +6 -4
- package/lib/cjs/entry/dependenciesNumber/dependenciesMedian.generated.js +2 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesMultinomial.generated.js +6 -6
- package/lib/cjs/entry/dependenciesNumber/dependenciesStirlingS2.generated.js +4 -0
- package/lib/cjs/entry/impureFunctionsAny.generated.js +211 -207
- package/lib/cjs/entry/impureFunctionsNumber.generated.js +63 -63
- package/lib/cjs/entry/pureFunctionsAny.generated.js +600 -629
- package/lib/cjs/entry/pureFunctionsNumber.generated.js +96 -92
- package/lib/cjs/expression/Help.js +1 -3
- package/lib/cjs/expression/Parser.js +16 -9
- package/lib/cjs/expression/embeddedDocs/embeddedDocs.js +4 -0
- package/lib/cjs/expression/embeddedDocs/function/fraction/den.js +14 -0
- package/lib/cjs/expression/embeddedDocs/function/fraction/num.js +14 -0
- package/lib/cjs/expression/embeddedDocs/function/matrix/concat.js +3 -3
- package/lib/cjs/expression/embeddedDocs/function/probability/multinomial.js +3 -3
- package/lib/cjs/expression/function/compile.js +2 -4
- package/lib/cjs/expression/function/evaluate.js +2 -4
- package/lib/cjs/expression/function/help.js +3 -5
- package/lib/cjs/expression/function/parser.js +2 -4
- package/lib/cjs/expression/node/AccessorNode.js +2 -4
- package/lib/cjs/expression/node/ArrayNode.js +1 -3
- package/lib/cjs/expression/node/AssignmentNode.js +3 -5
- package/lib/cjs/expression/node/BlockNode.js +2 -4
- package/lib/cjs/expression/node/ConditionalNode.js +1 -3
- package/lib/cjs/expression/node/ConstantNode.js +2 -4
- package/lib/cjs/expression/node/FunctionAssignmentNode.js +2 -4
- package/lib/cjs/expression/node/FunctionNode.js +3 -5
- package/lib/cjs/expression/node/IndexNode.js +2 -4
- package/lib/cjs/expression/node/Node.js +1 -3
- package/lib/cjs/expression/node/ObjectNode.js +1 -3
- package/lib/cjs/expression/node/OperatorNode.js +1 -3
- package/lib/cjs/expression/node/ParenthesisNode.js +1 -3
- package/lib/cjs/expression/node/RangeNode.js +1 -3
- package/lib/cjs/expression/node/RelationalNode.js +1 -3
- package/lib/cjs/expression/node/SymbolNode.js +3 -5
- package/lib/cjs/expression/node/utils/access.js +1 -3
- package/lib/cjs/expression/node/utils/assign.js +2 -4
- package/lib/cjs/expression/parse.js +30 -32
- package/lib/cjs/expression/transform/and.transform.js +9 -9
- package/lib/cjs/expression/transform/bitAnd.transform.js +9 -9
- package/lib/cjs/expression/transform/bitOr.transform.js +5 -7
- package/lib/cjs/expression/transform/column.transform.js +4 -6
- package/lib/cjs/expression/transform/concat.transform.js +3 -5
- package/lib/cjs/expression/transform/cumsum.transform.js +3 -5
- package/lib/cjs/expression/transform/diff.transform.js +5 -7
- package/lib/cjs/expression/transform/filter.transform.js +1 -3
- package/lib/cjs/expression/transform/forEach.transform.js +1 -3
- package/lib/cjs/expression/transform/index.transform.js +2 -4
- package/lib/cjs/expression/transform/map.transform.js +1 -3
- package/lib/cjs/expression/transform/mapSlices.transform.js +2 -4
- package/lib/cjs/expression/transform/max.transform.js +5 -7
- package/lib/cjs/expression/transform/mean.transform.js +3 -5
- package/lib/cjs/expression/transform/min.transform.js +5 -7
- package/lib/cjs/expression/transform/nullish.transform.js +5 -7
- package/lib/cjs/expression/transform/or.transform.js +5 -7
- package/lib/cjs/expression/transform/print.transform.js +4 -6
- package/lib/cjs/expression/transform/quantileSeq.transform.js +13 -15
- package/lib/cjs/expression/transform/range.transform.js +12 -14
- package/lib/cjs/expression/transform/row.transform.js +4 -6
- package/lib/cjs/expression/transform/std.transform.js +4 -6
- package/lib/cjs/expression/transform/subset.transform.js +4 -6
- package/lib/cjs/expression/transform/sum.transform.js +4 -6
- package/lib/cjs/expression/transform/utils/lastDimToZeroBase.js +8 -6
- package/lib/cjs/expression/transform/utils/transformCallback.js +6 -4
- package/lib/cjs/expression/transform/variance.transform.js +7 -9
- package/lib/cjs/factoriesAny.js +15 -1
- package/lib/cjs/factoriesNumber.js +2 -6
- package/lib/cjs/function/algebra/decomposition/lup.js +24 -24
- package/lib/cjs/function/algebra/decomposition/qr.js +25 -34
- package/lib/cjs/function/algebra/decomposition/schur.js +7 -9
- package/lib/cjs/function/algebra/decomposition/slu.js +10 -12
- package/lib/cjs/function/algebra/derivative.js +23 -19
- package/lib/cjs/function/algebra/leafCount.js +2 -4
- package/lib/cjs/function/algebra/lyap.js +5 -7
- package/lib/cjs/function/algebra/polynomialRoot.js +20 -17
- package/lib/cjs/function/algebra/rationalize.js +26 -28
- package/lib/cjs/function/algebra/resolve.js +6 -8
- package/lib/cjs/function/algebra/simplify/util.js +3 -5
- package/lib/cjs/function/algebra/simplify.js +32 -35
- package/lib/cjs/function/algebra/simplifyConstant.js +24 -27
- package/lib/cjs/function/algebra/simplifyCore.js +33 -34
- package/lib/cjs/function/algebra/solver/lsolve.js +16 -14
- package/lib/cjs/function/algebra/solver/lsolveAll.js +17 -14
- package/lib/cjs/function/algebra/solver/lusolve.js +7 -9
- package/lib/cjs/function/algebra/solver/usolve.js +16 -14
- package/lib/cjs/function/algebra/solver/usolveAll.js +14 -14
- package/lib/cjs/function/algebra/solver/utils/solveValidation.js +1 -3
- package/lib/cjs/function/algebra/sparse/csAmd.js +3 -5
- package/lib/cjs/function/algebra/sparse/csChol.js +12 -14
- package/lib/cjs/function/algebra/sparse/csCounts.js +1 -3
- package/lib/cjs/function/algebra/sparse/csLu.js +7 -9
- package/lib/cjs/function/algebra/sparse/csSpsolve.js +3 -5
- package/lib/cjs/function/algebra/sparse/csSqr.js +3 -5
- package/lib/cjs/function/algebra/sparse/csSymperm.js +2 -4
- package/lib/cjs/function/algebra/sylvester.js +16 -18
- package/lib/cjs/function/algebra/symbolicEqual.js +9 -7
- package/lib/cjs/function/arithmetic/abs.js +1 -3
- package/lib/cjs/function/arithmetic/add.js +8 -16
- package/lib/cjs/function/arithmetic/addScalar.js +1 -3
- package/lib/cjs/function/arithmetic/cbrt.js +8 -10
- package/lib/cjs/function/arithmetic/ceil.js +13 -18
- package/lib/cjs/function/arithmetic/cube.js +1 -3
- package/lib/cjs/function/arithmetic/divide.js +22 -15
- package/lib/cjs/function/arithmetic/divideScalar.js +2 -4
- package/lib/cjs/function/arithmetic/dotDivide.js +15 -20
- package/lib/cjs/function/arithmetic/dotMultiply.js +13 -16
- package/lib/cjs/function/arithmetic/dotPow.js +14 -18
- package/lib/cjs/function/arithmetic/exp.js +1 -3
- package/lib/cjs/function/arithmetic/expm1.js +2 -4
- package/lib/cjs/function/arithmetic/fix.js +13 -17
- package/lib/cjs/function/arithmetic/floor.js +13 -18
- package/lib/cjs/function/arithmetic/gcd.js +31 -26
- package/lib/cjs/function/arithmetic/hypot.js +8 -10
- package/lib/cjs/function/arithmetic/invmod.js +37 -27
- package/lib/cjs/function/arithmetic/lcm.js +14 -15
- package/lib/cjs/function/arithmetic/log.js +5 -7
- package/lib/cjs/function/arithmetic/log10.js +3 -5
- package/lib/cjs/function/arithmetic/log1p.js +5 -7
- package/lib/cjs/function/arithmetic/log2.js +3 -5
- package/lib/cjs/function/arithmetic/mod.js +38 -33
- package/lib/cjs/function/arithmetic/multiply.js +137 -83
- package/lib/cjs/function/arithmetic/multiplyScalar.js +1 -3
- package/lib/cjs/function/arithmetic/norm.js +21 -18
- package/lib/cjs/function/arithmetic/nthRoot.js +13 -20
- package/lib/cjs/function/arithmetic/nthRoots.js +4 -6
- package/lib/cjs/function/arithmetic/pow.js +9 -11
- package/lib/cjs/function/arithmetic/round.js +11 -14
- package/lib/cjs/function/arithmetic/sign.js +4 -6
- package/lib/cjs/function/arithmetic/sqrt.js +3 -5
- package/lib/cjs/function/arithmetic/square.js +1 -3
- package/lib/cjs/function/arithmetic/subtract.js +13 -14
- package/lib/cjs/function/arithmetic/subtractScalar.js +1 -3
- package/lib/cjs/function/arithmetic/unaryMinus.js +1 -3
- package/lib/cjs/function/arithmetic/unaryPlus.js +3 -5
- package/lib/cjs/function/arithmetic/xgcd.js +45 -8
- package/lib/cjs/function/bitwise/bitAnd.js +12 -15
- package/lib/cjs/function/bitwise/bitNot.js +1 -3
- package/lib/cjs/function/bitwise/bitOr.js +11 -12
- package/lib/cjs/function/bitwise/bitXor.js +12 -10
- package/lib/cjs/function/bitwise/leftShift.js +36 -26
- package/lib/cjs/function/bitwise/rightArithShift.js +36 -26
- package/lib/cjs/function/bitwise/rightLogShift.js +40 -39
- package/lib/cjs/function/combinatorics/bellNumbers.js +5 -7
- package/lib/cjs/function/combinatorics/catalan.js +72 -14
- package/lib/cjs/function/combinatorics/composition.js +7 -9
- package/lib/cjs/function/combinatorics/stirlingS2.js +69 -48
- package/lib/cjs/function/complex/arg.js +1 -3
- package/lib/cjs/function/complex/conj.js +1 -3
- package/lib/cjs/function/complex/im.js +12 -8
- package/lib/cjs/function/complex/re.js +10 -6
- package/lib/cjs/function/fraction/den.js +58 -0
- package/lib/cjs/function/fraction/num.js +60 -0
- package/lib/cjs/function/geometry/distance.js +8 -10
- package/lib/cjs/function/geometry/intersect.js +16 -18
- package/lib/cjs/function/logical/and.js +15 -17
- package/lib/cjs/function/logical/not.js +1 -3
- package/lib/cjs/function/logical/nullish.js +5 -7
- package/lib/cjs/function/logical/or.js +12 -12
- package/lib/cjs/function/logical/xor.js +12 -10
- package/lib/cjs/function/matrix/column.js +4 -6
- package/lib/cjs/function/matrix/concat.js +33 -14
- package/lib/cjs/function/matrix/count.js +3 -5
- package/lib/cjs/function/matrix/cross.js +4 -6
- package/lib/cjs/function/matrix/ctranspose.js +3 -5
- package/lib/cjs/function/matrix/det.js +7 -9
- package/lib/cjs/function/matrix/diag.js +4 -6
- package/lib/cjs/function/matrix/diff.js +4 -6
- package/lib/cjs/function/matrix/dot.js +5 -7
- package/lib/cjs/function/matrix/eigs/complexEigs.js +31 -34
- package/lib/cjs/function/matrix/eigs/realSymmetric.js +12 -14
- package/lib/cjs/function/matrix/eigs.js +62 -47
- package/lib/cjs/function/matrix/expm.js +6 -8
- package/lib/cjs/function/matrix/fft.js +13 -15
- package/lib/cjs/function/matrix/filter.js +1 -3
- package/lib/cjs/function/matrix/flatten.js +1 -3
- package/lib/cjs/function/matrix/forEach.js +1 -3
- package/lib/cjs/function/matrix/getMatrixDataType.js +1 -3
- package/lib/cjs/function/matrix/identity.js +6 -8
- package/lib/cjs/function/matrix/ifft.js +4 -6
- package/lib/cjs/function/matrix/inv.js +9 -11
- package/lib/cjs/function/matrix/kron.js +3 -5
- package/lib/cjs/function/matrix/map.js +1 -3
- package/lib/cjs/function/matrix/mapSlices.js +5 -5
- package/lib/cjs/function/matrix/matrixFromColumns.js +4 -6
- package/lib/cjs/function/matrix/matrixFromFunction.js +3 -5
- package/lib/cjs/function/matrix/matrixFromRows.js +4 -6
- package/lib/cjs/function/matrix/ones.js +4 -6
- package/lib/cjs/function/matrix/partitionSelect.js +4 -6
- package/lib/cjs/function/matrix/pinv.js +18 -19
- package/lib/cjs/function/matrix/range.js +11 -13
- package/lib/cjs/function/matrix/reshape.js +2 -4
- package/lib/cjs/function/matrix/resize.js +2 -4
- package/lib/cjs/function/matrix/rotate.js +3 -5
- package/lib/cjs/function/matrix/rotationMatrix.js +12 -14
- package/lib/cjs/function/matrix/row.js +4 -6
- package/lib/cjs/function/matrix/size.js +1 -3
- package/lib/cjs/function/matrix/sort.js +4 -6
- package/lib/cjs/function/matrix/sqrtm.js +11 -13
- package/lib/cjs/function/matrix/squeeze.js +1 -3
- package/lib/cjs/function/matrix/subset.js +5 -7
- package/lib/cjs/function/matrix/trace.js +5 -7
- package/lib/cjs/function/matrix/transpose.js +3 -5
- package/lib/cjs/function/matrix/zeros.js +4 -6
- package/lib/cjs/function/numeric/solveODE.js +23 -18
- package/lib/cjs/function/probability/bernoulli.js +5 -7
- package/lib/cjs/function/probability/combinations.js +1 -3
- package/lib/cjs/function/probability/combinationsWithRep.js +1 -3
- package/lib/cjs/function/probability/factorial.js +2 -4
- package/lib/cjs/function/probability/gamma.js +6 -8
- package/lib/cjs/function/probability/kldivergence.js +14 -12
- package/lib/cjs/function/probability/lgamma.js +2 -4
- package/lib/cjs/function/probability/multinomial.js +76 -30
- package/lib/cjs/function/probability/permutations.js +2 -4
- package/lib/cjs/function/probability/pickRandom.js +7 -10
- package/lib/cjs/function/probability/random.js +7 -11
- package/lib/cjs/function/probability/randomInt.js +4 -6
- package/lib/cjs/function/relational/compare.js +14 -21
- package/lib/cjs/function/relational/compareNatural.js +2 -4
- package/lib/cjs/function/relational/compareText.js +5 -11
- package/lib/cjs/function/relational/compareUnits.js +1 -3
- package/lib/cjs/function/relational/deepEqual.js +2 -4
- package/lib/cjs/function/relational/equal.js +10 -14
- package/lib/cjs/function/relational/equalScalar.js +4 -8
- package/lib/cjs/function/relational/equalText.js +3 -5
- package/lib/cjs/function/relational/larger.js +19 -16
- package/lib/cjs/function/relational/largerEq.js +19 -15
- package/lib/cjs/function/relational/smaller.js +18 -16
- package/lib/cjs/function/relational/smallerEq.js +17 -15
- package/lib/cjs/function/relational/unequal.js +15 -21
- package/lib/cjs/function/set/setCartesian.js +6 -8
- package/lib/cjs/function/set/setDifference.js +6 -8
- package/lib/cjs/function/set/setDistinct.js +6 -8
- package/lib/cjs/function/set/setIntersect.js +6 -8
- package/lib/cjs/function/set/setIsSubset.js +5 -7
- package/lib/cjs/function/set/setMultiplicity.js +5 -7
- package/lib/cjs/function/set/setPowerset.js +5 -7
- package/lib/cjs/function/set/setSize.js +2 -4
- package/lib/cjs/function/set/setSymDifference.js +6 -8
- package/lib/cjs/function/set/setUnion.js +7 -9
- package/lib/cjs/function/signal/freqz.js +13 -18
- package/lib/cjs/function/signal/zpk2tf.js +5 -7
- package/lib/cjs/function/special/erf.js +1 -3
- package/lib/cjs/function/special/zeta.js +17 -19
- package/lib/cjs/function/statistics/corr.js +9 -11
- package/lib/cjs/function/statistics/cumsum.js +3 -5
- package/lib/cjs/function/statistics/mad.js +5 -7
- package/lib/cjs/function/statistics/max.js +5 -7
- package/lib/cjs/function/statistics/mean.js +3 -5
- package/lib/cjs/function/statistics/median.js +28 -25
- package/lib/cjs/function/statistics/min.js +5 -7
- package/lib/cjs/function/statistics/mode.js +3 -5
- package/lib/cjs/function/statistics/prod.js +4 -6
- package/lib/cjs/function/statistics/quantileSeq.js +13 -15
- package/lib/cjs/function/statistics/std.js +4 -6
- package/lib/cjs/function/statistics/sum.js +4 -6
- package/lib/cjs/function/statistics/variance.js +7 -9
- package/lib/cjs/function/string/bin.js +2 -4
- package/lib/cjs/function/string/format.js +1 -3
- package/lib/cjs/function/string/hex.js +2 -4
- package/lib/cjs/function/string/oct.js +2 -4
- package/lib/cjs/function/string/print.js +1 -3
- package/lib/cjs/function/trigonometry/acos.js +3 -5
- package/lib/cjs/function/trigonometry/acosh.js +3 -5
- package/lib/cjs/function/trigonometry/acot.js +2 -4
- package/lib/cjs/function/trigonometry/acoth.js +4 -6
- package/lib/cjs/function/trigonometry/acsc.js +4 -6
- package/lib/cjs/function/trigonometry/acsch.js +2 -4
- package/lib/cjs/function/trigonometry/asec.js +4 -6
- package/lib/cjs/function/trigonometry/asech.js +4 -6
- package/lib/cjs/function/trigonometry/asin.js +3 -5
- package/lib/cjs/function/trigonometry/asinh.js +1 -3
- package/lib/cjs/function/trigonometry/atan.js +1 -3
- package/lib/cjs/function/trigonometry/atan2.js +19 -29
- package/lib/cjs/function/trigonometry/atanh.js +3 -5
- package/lib/cjs/function/trigonometry/cos.js +1 -3
- package/lib/cjs/function/trigonometry/cosh.js +1 -3
- package/lib/cjs/function/trigonometry/cot.js +2 -4
- package/lib/cjs/function/trigonometry/coth.js +2 -4
- package/lib/cjs/function/trigonometry/csc.js +2 -4
- package/lib/cjs/function/trigonometry/csch.js +2 -4
- package/lib/cjs/function/trigonometry/sec.js +2 -4
- package/lib/cjs/function/trigonometry/sech.js +2 -4
- package/lib/cjs/function/trigonometry/sin.js +1 -3
- package/lib/cjs/function/trigonometry/sinh.js +1 -3
- package/lib/cjs/function/trigonometry/tan.js +1 -3
- package/lib/cjs/function/trigonometry/tanh.js +1 -3
- package/lib/cjs/function/trigonometry/trigUnit.js +1 -3
- package/lib/cjs/function/unit/to.js +10 -8
- package/lib/cjs/function/unit/toBest.js +1 -3
- package/lib/cjs/function/utils/clone.js +1 -3
- package/lib/cjs/function/utils/hasNumericValue.js +2 -4
- package/lib/cjs/function/utils/isBounded.js +1 -3
- package/lib/cjs/function/utils/isFinite.js +3 -5
- package/lib/cjs/function/utils/isInteger.js +2 -4
- package/lib/cjs/function/utils/isNaN.js +1 -3
- package/lib/cjs/function/utils/isNegative.js +2 -4
- package/lib/cjs/function/utils/isNumeric.js +1 -3
- package/lib/cjs/function/utils/isPositive.js +2 -4
- package/lib/cjs/function/utils/isPrime.js +1 -3
- package/lib/cjs/function/utils/isZero.js +2 -4
- package/lib/cjs/function/utils/numeric.js +3 -5
- package/lib/cjs/function/utils/typeOf.js +1 -3
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/json/reviver.js +1 -3
- package/lib/cjs/type/bigint.js +1 -3
- package/lib/cjs/type/bignumber/BigNumber.js +2 -4
- package/lib/cjs/type/bignumber/function/bignumber.js +2 -4
- package/lib/cjs/type/boolean.js +1 -3
- package/lib/cjs/type/chain/Chain.js +3 -5
- package/lib/cjs/type/chain/function/chain.js +2 -4
- package/lib/cjs/type/complex/function/complex.js +2 -4
- package/lib/cjs/type/fraction/function/fraction.js +2 -4
- package/lib/cjs/type/matrix/DenseMatrix.js +2 -4
- package/lib/cjs/type/matrix/FibonacciHeap.js +2 -4
- package/lib/cjs/type/matrix/ImmutableDenseMatrix.js +2 -4
- package/lib/cjs/type/matrix/MatrixIndex.js +2 -4
- package/lib/cjs/type/matrix/Spa.js +5 -7
- package/lib/cjs/type/matrix/SparseMatrix.js +94 -93
- package/lib/cjs/type/matrix/function/index.js +2 -4
- package/lib/cjs/type/matrix/function/matrix.js +4 -6
- package/lib/cjs/type/matrix/function/sparse.js +2 -4
- package/lib/cjs/type/matrix/utils/matAlgo01xDSid.js +1 -3
- package/lib/cjs/type/matrix/utils/matAlgo02xDS0.js +16 -20
- package/lib/cjs/type/matrix/utils/matAlgo03xDSf.js +1 -3
- package/lib/cjs/type/matrix/utils/matAlgo04xSidSid.js +15 -17
- package/lib/cjs/type/matrix/utils/matAlgo05xSfSf.js +24 -16
- package/lib/cjs/type/matrix/utils/matAlgo06xS0S0.js +15 -17
- package/lib/cjs/type/matrix/utils/matAlgo07xSSf.js +13 -6
- package/lib/cjs/type/matrix/utils/matAlgo08xS0Sid.js +14 -16
- package/lib/cjs/type/matrix/utils/matAlgo09xS0Sf.js +23 -15
- package/lib/cjs/type/matrix/utils/matAlgo10xSids.js +2 -4
- package/lib/cjs/type/matrix/utils/matAlgo11xS0s.js +13 -19
- package/lib/cjs/type/matrix/utils/matAlgo12xSfs.js +30 -13
- package/lib/cjs/type/matrix/utils/matAlgo13xDD.js +1 -3
- package/lib/cjs/type/matrix/utils/matAlgo14xDs.js +4 -43
- package/lib/cjs/type/matrix/utils/matAlgo15xAs.js +31 -0
- package/lib/cjs/type/matrix/utils/matrixAlgorithmSuite.js +8 -8
- package/lib/cjs/type/number.js +1 -3
- package/lib/cjs/type/string.js +1 -3
- package/lib/cjs/type/unit/Unit.js +44 -46
- package/lib/cjs/type/unit/function/createUnit.js +2 -4
- package/lib/cjs/type/unit/function/splitUnit.js +1 -3
- package/lib/cjs/type/unit/function/unit.js +2 -4
- package/lib/cjs/type/unit/physicalConstants.js +5 -9
- package/lib/cjs/utils/array.js +3 -0
- package/lib/cjs/utils/bignumber/formatter.js +4 -5
- package/lib/cjs/utils/collection.js +3 -1
- package/lib/cjs/utils/customs.js +39 -46
- package/lib/cjs/utils/function.js +3 -4
- package/lib/cjs/utils/map.js +2 -2
- package/lib/cjs/utils/number.js +4 -5
- package/lib/cjs/utils/optimizeCallback.js +40 -14
- package/lib/cjs/utils/snapshot.js +6 -6
- package/lib/cjs/version.js +1 -1
- package/lib/esm/constants.js +27 -57
- package/lib/esm/core/function/typed.js +7 -6
- package/lib/esm/entry/dependenciesAny/dependenciesAdd.generated.js +0 -6
- package/lib/esm/entry/dependenciesAny/dependenciesAnd.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesAndTransform.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesAtan2.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesBitAnd.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesBitAndTransform.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesBitOr.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesCatalan.generated.js +8 -4
- package/lib/esm/entry/dependenciesAny/dependenciesCeil.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesCompare.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesCompareText.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesDen.generated.js +12 -0
- package/lib/esm/entry/dependenciesAny/dependenciesDivide.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesDotMultiply.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js +4 -2
- package/lib/esm/entry/dependenciesAny/dependenciesFix.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesFloor.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesGcd.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesInvmod.generated.js +4 -6
- package/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesLcm.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesLeftShift.generated.js +2 -4
- package/lib/esm/entry/dependenciesAny/dependenciesLsolve.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesLsolveAll.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesLup.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesMedian.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesMod.generated.js +2 -4
- package/lib/esm/entry/dependenciesAny/dependenciesMultinomial.generated.js +6 -6
- package/lib/esm/entry/dependenciesAny/dependenciesMultiply.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesNorm.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesNthRoot.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesNum.generated.js +12 -0
- package/lib/esm/entry/dependenciesAny/dependenciesOr.generated.js +0 -4
- package/lib/esm/entry/dependenciesAny/dependenciesQr.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesRightArithShift.generated.js +2 -4
- package/lib/esm/entry/dependenciesAny/dependenciesRightLogShift.generated.js +2 -4
- package/lib/esm/entry/dependenciesAny/dependenciesRound.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesSpaClass.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js +4 -2
- package/lib/esm/entry/dependenciesAny/dependenciesStirlingS2.generated.js +4 -0
- package/lib/esm/entry/dependenciesAny/dependenciesSubtract.generated.js +0 -6
- package/lib/esm/entry/dependenciesAny/dependenciesTo.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesUsolve.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesUsolveAll.generated.js +2 -2
- package/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesCatalan.generated.js +6 -4
- package/lib/esm/entry/dependenciesNumber/dependenciesMedian.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesMultinomial.generated.js +6 -6
- package/lib/esm/entry/dependenciesNumber/dependenciesStirlingS2.generated.js +4 -0
- package/lib/esm/entry/impureFunctionsAny.generated.js +213 -209
- package/lib/esm/entry/impureFunctionsNumber.generated.js +65 -65
- package/lib/esm/entry/pureFunctionsAny.generated.js +597 -626
- package/lib/esm/entry/pureFunctionsNumber.generated.js +97 -93
- package/lib/esm/expression/Help.js +1 -3
- package/lib/esm/expression/Parser.js +15 -9
- package/lib/esm/expression/embeddedDocs/embeddedDocs.js +4 -0
- package/lib/esm/expression/embeddedDocs/function/fraction/den.js +8 -0
- package/lib/esm/expression/embeddedDocs/function/fraction/num.js +8 -0
- package/lib/esm/expression/embeddedDocs/function/matrix/concat.js +3 -3
- package/lib/esm/expression/embeddedDocs/function/probability/multinomial.js +3 -3
- package/lib/esm/expression/function/compile.js +2 -4
- package/lib/esm/expression/function/evaluate.js +2 -4
- package/lib/esm/expression/function/help.js +3 -5
- package/lib/esm/expression/function/parser.js +2 -4
- package/lib/esm/expression/node/AccessorNode.js +2 -4
- package/lib/esm/expression/node/ArrayNode.js +1 -3
- package/lib/esm/expression/node/AssignmentNode.js +3 -5
- package/lib/esm/expression/node/BlockNode.js +2 -4
- package/lib/esm/expression/node/ConditionalNode.js +1 -3
- package/lib/esm/expression/node/ConstantNode.js +2 -4
- package/lib/esm/expression/node/FunctionAssignmentNode.js +2 -4
- package/lib/esm/expression/node/FunctionNode.js +3 -5
- package/lib/esm/expression/node/IndexNode.js +2 -4
- package/lib/esm/expression/node/Node.js +1 -3
- package/lib/esm/expression/node/ObjectNode.js +1 -3
- package/lib/esm/expression/node/OperatorNode.js +1 -3
- package/lib/esm/expression/node/ParenthesisNode.js +1 -3
- package/lib/esm/expression/node/RangeNode.js +1 -3
- package/lib/esm/expression/node/RelationalNode.js +1 -3
- package/lib/esm/expression/node/SymbolNode.js +3 -5
- package/lib/esm/expression/node/utils/access.js +1 -3
- package/lib/esm/expression/node/utils/assign.js +2 -4
- package/lib/esm/expression/parse.js +30 -32
- package/lib/esm/expression/transform/and.transform.js +9 -9
- package/lib/esm/expression/transform/bitAnd.transform.js +9 -9
- package/lib/esm/expression/transform/bitOr.transform.js +5 -7
- package/lib/esm/expression/transform/column.transform.js +4 -6
- package/lib/esm/expression/transform/concat.transform.js +3 -5
- package/lib/esm/expression/transform/cumsum.transform.js +3 -5
- package/lib/esm/expression/transform/diff.transform.js +5 -7
- package/lib/esm/expression/transform/filter.transform.js +1 -3
- package/lib/esm/expression/transform/forEach.transform.js +1 -3
- package/lib/esm/expression/transform/index.transform.js +2 -4
- package/lib/esm/expression/transform/map.transform.js +1 -3
- package/lib/esm/expression/transform/mapSlices.transform.js +2 -4
- package/lib/esm/expression/transform/max.transform.js +5 -7
- package/lib/esm/expression/transform/mean.transform.js +3 -5
- package/lib/esm/expression/transform/min.transform.js +5 -7
- package/lib/esm/expression/transform/nullish.transform.js +5 -7
- package/lib/esm/expression/transform/or.transform.js +5 -7
- package/lib/esm/expression/transform/print.transform.js +4 -6
- package/lib/esm/expression/transform/quantileSeq.transform.js +13 -15
- package/lib/esm/expression/transform/range.transform.js +12 -14
- package/lib/esm/expression/transform/row.transform.js +4 -6
- package/lib/esm/expression/transform/std.transform.js +4 -6
- package/lib/esm/expression/transform/subset.transform.js +4 -6
- package/lib/esm/expression/transform/sum.transform.js +4 -6
- package/lib/esm/expression/transform/utils/lastDimToZeroBase.js +8 -6
- package/lib/esm/expression/transform/utils/transformCallback.js +5 -4
- package/lib/esm/expression/transform/variance.transform.js +7 -9
- package/lib/esm/factoriesAny.js +3 -1
- package/lib/esm/factoriesNumber.js +2 -6
- package/lib/esm/function/algebra/decomposition/lup.js +24 -24
- package/lib/esm/function/algebra/decomposition/qr.js +25 -34
- package/lib/esm/function/algebra/decomposition/schur.js +7 -9
- package/lib/esm/function/algebra/decomposition/slu.js +10 -12
- package/lib/esm/function/algebra/derivative.js +23 -19
- package/lib/esm/function/algebra/leafCount.js +2 -4
- package/lib/esm/function/algebra/lyap.js +5 -7
- package/lib/esm/function/algebra/polynomialRoot.js +20 -17
- package/lib/esm/function/algebra/rationalize.js +26 -28
- package/lib/esm/function/algebra/resolve.js +6 -8
- package/lib/esm/function/algebra/simplify/util.js +3 -5
- package/lib/esm/function/algebra/simplify.js +32 -35
- package/lib/esm/function/algebra/simplifyConstant.js +24 -27
- package/lib/esm/function/algebra/simplifyCore.js +33 -34
- package/lib/esm/function/algebra/solver/lsolve.js +16 -14
- package/lib/esm/function/algebra/solver/lsolveAll.js +17 -14
- package/lib/esm/function/algebra/solver/lusolve.js +7 -9
- package/lib/esm/function/algebra/solver/usolve.js +16 -14
- package/lib/esm/function/algebra/solver/usolveAll.js +14 -14
- package/lib/esm/function/algebra/solver/utils/solveValidation.js +1 -3
- package/lib/esm/function/algebra/sparse/csAmd.js +3 -5
- package/lib/esm/function/algebra/sparse/csChol.js +12 -14
- package/lib/esm/function/algebra/sparse/csCounts.js +1 -3
- package/lib/esm/function/algebra/sparse/csLu.js +7 -9
- package/lib/esm/function/algebra/sparse/csSpsolve.js +3 -5
- package/lib/esm/function/algebra/sparse/csSqr.js +3 -5
- package/lib/esm/function/algebra/sparse/csSymperm.js +2 -4
- package/lib/esm/function/algebra/sylvester.js +16 -18
- package/lib/esm/function/algebra/symbolicEqual.js +9 -7
- package/lib/esm/function/arithmetic/abs.js +1 -3
- package/lib/esm/function/arithmetic/add.js +8 -16
- package/lib/esm/function/arithmetic/addScalar.js +1 -3
- package/lib/esm/function/arithmetic/cbrt.js +8 -10
- package/lib/esm/function/arithmetic/ceil.js +13 -18
- package/lib/esm/function/arithmetic/cube.js +1 -3
- package/lib/esm/function/arithmetic/divide.js +22 -15
- package/lib/esm/function/arithmetic/divideScalar.js +2 -4
- package/lib/esm/function/arithmetic/dotDivide.js +15 -20
- package/lib/esm/function/arithmetic/dotMultiply.js +13 -16
- package/lib/esm/function/arithmetic/dotPow.js +14 -18
- package/lib/esm/function/arithmetic/exp.js +1 -3
- package/lib/esm/function/arithmetic/expm1.js +2 -4
- package/lib/esm/function/arithmetic/fix.js +13 -17
- package/lib/esm/function/arithmetic/floor.js +13 -18
- package/lib/esm/function/arithmetic/gcd.js +31 -26
- package/lib/esm/function/arithmetic/hypot.js +8 -10
- package/lib/esm/function/arithmetic/invmod.js +36 -27
- package/lib/esm/function/arithmetic/lcm.js +14 -15
- package/lib/esm/function/arithmetic/log.js +5 -7
- package/lib/esm/function/arithmetic/log10.js +3 -5
- package/lib/esm/function/arithmetic/log1p.js +5 -7
- package/lib/esm/function/arithmetic/log2.js +3 -5
- package/lib/esm/function/arithmetic/mod.js +38 -33
- package/lib/esm/function/arithmetic/multiply.js +137 -83
- package/lib/esm/function/arithmetic/multiplyScalar.js +1 -3
- package/lib/esm/function/arithmetic/norm.js +21 -18
- package/lib/esm/function/arithmetic/nthRoot.js +13 -20
- package/lib/esm/function/arithmetic/nthRoots.js +4 -6
- package/lib/esm/function/arithmetic/pow.js +9 -11
- package/lib/esm/function/arithmetic/round.js +11 -14
- package/lib/esm/function/arithmetic/sign.js +4 -6
- package/lib/esm/function/arithmetic/sqrt.js +3 -5
- package/lib/esm/function/arithmetic/square.js +1 -3
- package/lib/esm/function/arithmetic/subtract.js +13 -14
- package/lib/esm/function/arithmetic/subtractScalar.js +1 -3
- package/lib/esm/function/arithmetic/unaryMinus.js +1 -3
- package/lib/esm/function/arithmetic/unaryPlus.js +3 -5
- package/lib/esm/function/arithmetic/xgcd.js +45 -8
- package/lib/esm/function/bitwise/bitAnd.js +12 -15
- package/lib/esm/function/bitwise/bitNot.js +1 -3
- package/lib/esm/function/bitwise/bitOr.js +11 -12
- package/lib/esm/function/bitwise/bitXor.js +12 -10
- package/lib/esm/function/bitwise/leftShift.js +36 -26
- package/lib/esm/function/bitwise/rightArithShift.js +36 -26
- package/lib/esm/function/bitwise/rightLogShift.js +40 -39
- package/lib/esm/function/combinatorics/bellNumbers.js +5 -7
- package/lib/esm/function/combinatorics/catalan.js +72 -14
- package/lib/esm/function/combinatorics/composition.js +7 -9
- package/lib/esm/function/combinatorics/stirlingS2.js +69 -48
- package/lib/esm/function/complex/arg.js +1 -3
- package/lib/esm/function/complex/conj.js +1 -3
- package/lib/esm/function/complex/im.js +12 -8
- package/lib/esm/function/complex/re.js +10 -6
- package/lib/esm/function/fraction/den.js +52 -0
- package/lib/esm/function/fraction/num.js +54 -0
- package/lib/esm/function/geometry/distance.js +8 -10
- package/lib/esm/function/geometry/intersect.js +16 -18
- package/lib/esm/function/logical/and.js +15 -17
- package/lib/esm/function/logical/not.js +1 -3
- package/lib/esm/function/logical/nullish.js +5 -7
- package/lib/esm/function/logical/or.js +12 -12
- package/lib/esm/function/logical/xor.js +12 -10
- package/lib/esm/function/matrix/column.js +4 -6
- package/lib/esm/function/matrix/concat.js +33 -14
- package/lib/esm/function/matrix/count.js +3 -5
- package/lib/esm/function/matrix/cross.js +4 -6
- package/lib/esm/function/matrix/ctranspose.js +3 -5
- package/lib/esm/function/matrix/det.js +7 -9
- package/lib/esm/function/matrix/diag.js +4 -6
- package/lib/esm/function/matrix/diff.js +4 -6
- package/lib/esm/function/matrix/dot.js +5 -7
- package/lib/esm/function/matrix/eigs/complexEigs.js +31 -34
- package/lib/esm/function/matrix/eigs/realSymmetric.js +12 -14
- package/lib/esm/function/matrix/eigs.js +62 -47
- package/lib/esm/function/matrix/expm.js +6 -8
- package/lib/esm/function/matrix/fft.js +13 -15
- package/lib/esm/function/matrix/filter.js +1 -3
- package/lib/esm/function/matrix/flatten.js +1 -3
- package/lib/esm/function/matrix/forEach.js +1 -3
- package/lib/esm/function/matrix/getMatrixDataType.js +1 -3
- package/lib/esm/function/matrix/identity.js +6 -8
- package/lib/esm/function/matrix/ifft.js +4 -6
- package/lib/esm/function/matrix/inv.js +9 -11
- package/lib/esm/function/matrix/kron.js +3 -5
- package/lib/esm/function/matrix/map.js +1 -3
- package/lib/esm/function/matrix/mapSlices.js +5 -5
- package/lib/esm/function/matrix/matrixFromColumns.js +4 -6
- package/lib/esm/function/matrix/matrixFromFunction.js +3 -5
- package/lib/esm/function/matrix/matrixFromRows.js +4 -6
- package/lib/esm/function/matrix/ones.js +4 -6
- package/lib/esm/function/matrix/partitionSelect.js +4 -6
- package/lib/esm/function/matrix/pinv.js +18 -19
- package/lib/esm/function/matrix/range.js +11 -13
- package/lib/esm/function/matrix/reshape.js +2 -4
- package/lib/esm/function/matrix/resize.js +2 -4
- package/lib/esm/function/matrix/rotate.js +3 -5
- package/lib/esm/function/matrix/rotationMatrix.js +12 -14
- package/lib/esm/function/matrix/row.js +4 -6
- package/lib/esm/function/matrix/size.js +1 -3
- package/lib/esm/function/matrix/sort.js +4 -6
- package/lib/esm/function/matrix/sqrtm.js +11 -13
- package/lib/esm/function/matrix/squeeze.js +1 -3
- package/lib/esm/function/matrix/subset.js +5 -7
- package/lib/esm/function/matrix/trace.js +5 -7
- package/lib/esm/function/matrix/transpose.js +3 -5
- package/lib/esm/function/matrix/zeros.js +4 -6
- package/lib/esm/function/numeric/solveODE.js +22 -18
- package/lib/esm/function/probability/bernoulli.js +5 -7
- package/lib/esm/function/probability/combinations.js +1 -3
- package/lib/esm/function/probability/combinationsWithRep.js +1 -3
- package/lib/esm/function/probability/factorial.js +2 -4
- package/lib/esm/function/probability/gamma.js +6 -8
- package/lib/esm/function/probability/kldivergence.js +14 -12
- package/lib/esm/function/probability/lgamma.js +2 -4
- package/lib/esm/function/probability/multinomial.js +76 -30
- package/lib/esm/function/probability/permutations.js +2 -4
- package/lib/esm/function/probability/pickRandom.js +7 -10
- package/lib/esm/function/probability/random.js +7 -11
- package/lib/esm/function/probability/randomInt.js +4 -6
- package/lib/esm/function/relational/compare.js +14 -21
- package/lib/esm/function/relational/compareNatural.js +2 -4
- package/lib/esm/function/relational/compareText.js +5 -11
- package/lib/esm/function/relational/compareUnits.js +1 -3
- package/lib/esm/function/relational/deepEqual.js +2 -4
- package/lib/esm/function/relational/equal.js +10 -14
- package/lib/esm/function/relational/equalScalar.js +4 -8
- package/lib/esm/function/relational/equalText.js +3 -5
- package/lib/esm/function/relational/larger.js +19 -16
- package/lib/esm/function/relational/largerEq.js +19 -15
- package/lib/esm/function/relational/smaller.js +18 -16
- package/lib/esm/function/relational/smallerEq.js +17 -15
- package/lib/esm/function/relational/unequal.js +15 -21
- package/lib/esm/function/set/setCartesian.js +6 -8
- package/lib/esm/function/set/setDifference.js +6 -8
- package/lib/esm/function/set/setDistinct.js +6 -8
- package/lib/esm/function/set/setIntersect.js +6 -8
- package/lib/esm/function/set/setIsSubset.js +5 -7
- package/lib/esm/function/set/setMultiplicity.js +5 -7
- package/lib/esm/function/set/setPowerset.js +5 -7
- package/lib/esm/function/set/setSize.js +2 -4
- package/lib/esm/function/set/setSymDifference.js +6 -8
- package/lib/esm/function/set/setUnion.js +7 -9
- package/lib/esm/function/signal/freqz.js +13 -18
- package/lib/esm/function/signal/zpk2tf.js +5 -7
- package/lib/esm/function/special/erf.js +1 -3
- package/lib/esm/function/special/zeta.js +17 -19
- package/lib/esm/function/statistics/corr.js +9 -11
- package/lib/esm/function/statistics/cumsum.js +3 -5
- package/lib/esm/function/statistics/mad.js +5 -7
- package/lib/esm/function/statistics/max.js +5 -7
- package/lib/esm/function/statistics/mean.js +3 -5
- package/lib/esm/function/statistics/median.js +28 -25
- package/lib/esm/function/statistics/min.js +5 -7
- package/lib/esm/function/statistics/mode.js +3 -5
- package/lib/esm/function/statistics/prod.js +4 -6
- package/lib/esm/function/statistics/quantileSeq.js +13 -15
- package/lib/esm/function/statistics/std.js +4 -6
- package/lib/esm/function/statistics/sum.js +4 -6
- package/lib/esm/function/statistics/variance.js +7 -9
- package/lib/esm/function/string/bin.js +2 -4
- package/lib/esm/function/string/format.js +1 -3
- package/lib/esm/function/string/hex.js +2 -4
- package/lib/esm/function/string/oct.js +2 -4
- package/lib/esm/function/string/print.js +1 -3
- package/lib/esm/function/trigonometry/acos.js +3 -5
- package/lib/esm/function/trigonometry/acosh.js +3 -5
- package/lib/esm/function/trigonometry/acot.js +2 -4
- package/lib/esm/function/trigonometry/acoth.js +4 -6
- package/lib/esm/function/trigonometry/acsc.js +4 -6
- package/lib/esm/function/trigonometry/acsch.js +2 -4
- package/lib/esm/function/trigonometry/asec.js +4 -6
- package/lib/esm/function/trigonometry/asech.js +4 -6
- package/lib/esm/function/trigonometry/asin.js +3 -5
- package/lib/esm/function/trigonometry/asinh.js +1 -3
- package/lib/esm/function/trigonometry/atan.js +1 -3
- package/lib/esm/function/trigonometry/atan2.js +19 -29
- package/lib/esm/function/trigonometry/atanh.js +3 -5
- package/lib/esm/function/trigonometry/cos.js +1 -3
- package/lib/esm/function/trigonometry/cosh.js +1 -3
- package/lib/esm/function/trigonometry/cot.js +2 -4
- package/lib/esm/function/trigonometry/coth.js +2 -4
- package/lib/esm/function/trigonometry/csc.js +2 -4
- package/lib/esm/function/trigonometry/csch.js +2 -4
- package/lib/esm/function/trigonometry/sec.js +2 -4
- package/lib/esm/function/trigonometry/sech.js +2 -4
- package/lib/esm/function/trigonometry/sin.js +1 -3
- package/lib/esm/function/trigonometry/sinh.js +1 -3
- package/lib/esm/function/trigonometry/tan.js +1 -3
- package/lib/esm/function/trigonometry/tanh.js +1 -3
- package/lib/esm/function/trigonometry/trigUnit.js +1 -3
- package/lib/esm/function/unit/to.js +10 -8
- package/lib/esm/function/unit/toBest.js +1 -3
- package/lib/esm/function/utils/clone.js +1 -3
- package/lib/esm/function/utils/hasNumericValue.js +2 -4
- package/lib/esm/function/utils/isBounded.js +1 -3
- package/lib/esm/function/utils/isFinite.js +3 -5
- package/lib/esm/function/utils/isInteger.js +2 -4
- package/lib/esm/function/utils/isNaN.js +1 -3
- package/lib/esm/function/utils/isNegative.js +2 -4
- package/lib/esm/function/utils/isNumeric.js +1 -3
- package/lib/esm/function/utils/isPositive.js +2 -4
- package/lib/esm/function/utils/isPrime.js +1 -3
- package/lib/esm/function/utils/isZero.js +2 -4
- package/lib/esm/function/utils/numeric.js +3 -5
- package/lib/esm/function/utils/typeOf.js +1 -3
- package/lib/esm/json/reviver.js +1 -3
- package/lib/esm/type/bigint.js +1 -3
- package/lib/esm/type/bignumber/BigNumber.js +2 -4
- package/lib/esm/type/bignumber/function/bignumber.js +2 -4
- package/lib/esm/type/boolean.js +1 -3
- package/lib/esm/type/chain/Chain.js +3 -5
- package/lib/esm/type/chain/function/chain.js +2 -4
- package/lib/esm/type/complex/function/complex.js +2 -4
- package/lib/esm/type/fraction/function/fraction.js +2 -4
- package/lib/esm/type/matrix/DenseMatrix.js +2 -4
- package/lib/esm/type/matrix/FibonacciHeap.js +2 -4
- package/lib/esm/type/matrix/ImmutableDenseMatrix.js +2 -4
- package/lib/esm/type/matrix/MatrixIndex.js +2 -4
- package/lib/esm/type/matrix/Spa.js +5 -7
- package/lib/esm/type/matrix/SparseMatrix.js +91 -90
- package/lib/esm/type/matrix/function/index.js +2 -4
- package/lib/esm/type/matrix/function/matrix.js +4 -6
- package/lib/esm/type/matrix/function/sparse.js +2 -4
- package/lib/esm/type/matrix/utils/matAlgo01xDSid.js +1 -3
- package/lib/esm/type/matrix/utils/matAlgo02xDS0.js +16 -20
- package/lib/esm/type/matrix/utils/matAlgo03xDSf.js +1 -3
- package/lib/esm/type/matrix/utils/matAlgo04xSidSid.js +15 -17
- package/lib/esm/type/matrix/utils/matAlgo05xSfSf.js +24 -16
- package/lib/esm/type/matrix/utils/matAlgo06xS0S0.js +15 -17
- package/lib/esm/type/matrix/utils/matAlgo07xSSf.js +13 -6
- package/lib/esm/type/matrix/utils/matAlgo08xS0Sid.js +14 -16
- package/lib/esm/type/matrix/utils/matAlgo09xS0Sf.js +23 -15
- package/lib/esm/type/matrix/utils/matAlgo10xSids.js +2 -4
- package/lib/esm/type/matrix/utils/matAlgo11xS0s.js +13 -19
- package/lib/esm/type/matrix/utils/matAlgo12xSfs.js +30 -13
- package/lib/esm/type/matrix/utils/matAlgo13xDD.js +1 -3
- package/lib/esm/type/matrix/utils/matAlgo14xDs.js +4 -43
- package/lib/esm/type/matrix/utils/matAlgo15xAs.js +25 -0
- package/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js +8 -8
- package/lib/esm/type/number.js +1 -3
- package/lib/esm/type/string.js +1 -3
- package/lib/esm/type/unit/Unit.js +44 -46
- package/lib/esm/type/unit/function/createUnit.js +2 -4
- package/lib/esm/type/unit/function/splitUnit.js +1 -3
- package/lib/esm/type/unit/function/unit.js +2 -4
- package/lib/esm/type/unit/physicalConstants.js +5 -9
- package/lib/esm/utils/array.js +3 -0
- package/lib/esm/utils/bignumber/formatter.js +4 -5
- package/lib/esm/utils/collection.js +3 -1
- package/lib/esm/utils/customs.js +42 -56
- package/lib/esm/utils/function.js +3 -4
- package/lib/esm/utils/map.js +3 -3
- package/lib/esm/utils/number.js +4 -5
- package/lib/esm/utils/optimizeCallback.js +39 -14
- package/lib/esm/utils/snapshot.js +4 -5
- package/lib/esm/version.js +1 -1
- package/package.json +19 -17
- package/types/index.d.ts +351 -60
- package/lib/cjs/function/bitwise/useMatrixForArrayScalar.js +0 -19
- package/lib/esm/function/bitwise/useMatrixForArrayScalar.js +0 -13
package/types/index.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ export type NoLiteralType<T> = T extends number
|
|
|
13
13
|
? boolean
|
|
14
14
|
: T
|
|
15
15
|
|
|
16
|
+
// Like NoLiteralType, but also widens bigint literals. Used for values that
|
|
17
|
+
// are computed from the inputs, such as a sum or a mean.
|
|
18
|
+
type NoLiteralScalarType<T> = T extends bigint ? bigint : NoLiteralType<T>
|
|
19
|
+
|
|
16
20
|
export type MathNumericType = number | BigNumber | bigint | Fraction | Complex
|
|
17
21
|
export type MathScalarType = MathNumericType | Unit
|
|
18
22
|
export type MathGeneric<T extends MathScalarType = MathNumericType> = T
|
|
@@ -32,8 +36,7 @@ export type FactoryFunction<T> = (scope: MathScope) => T
|
|
|
32
36
|
|
|
33
37
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
38
|
export type MathScope<TValue = any> =
|
|
35
|
-
|
|
|
36
|
-
| MapLike<string, TValue>
|
|
39
|
+
Record<string, TValue> | MapLike<string, TValue>
|
|
37
40
|
|
|
38
41
|
// FactoryFunctionMap can be nested; all nested objects will be flattened
|
|
39
42
|
export interface FactoryFunctionMap {
|
|
@@ -822,16 +825,21 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
822
825
|
* @param dataType The Matrix data type
|
|
823
826
|
* @returns The created Matrix
|
|
824
827
|
*/
|
|
825
|
-
matrix(
|
|
826
|
-
data: MathCollection
|
|
828
|
+
matrix<T extends MathNumericType>(
|
|
829
|
+
data: MathCollection<T>,
|
|
827
830
|
format?: MatrixStorageFormat,
|
|
828
831
|
dataType?: string
|
|
829
|
-
): Matrix
|
|
832
|
+
): Matrix<T>
|
|
830
833
|
matrix<T extends MathScalarType>(
|
|
831
834
|
data: MathCollection<T>,
|
|
832
835
|
format?: MatrixStorageFormat,
|
|
833
836
|
dataType?: string
|
|
834
837
|
): Matrix<T>
|
|
838
|
+
matrix(
|
|
839
|
+
data: MathCollection | string[],
|
|
840
|
+
format?: MatrixStorageFormat,
|
|
841
|
+
dataType?: string
|
|
842
|
+
): Matrix
|
|
835
843
|
|
|
836
844
|
/**
|
|
837
845
|
* Create a number or convert a string, boolean, or unit to a number.
|
|
@@ -841,14 +849,7 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
841
849
|
*/
|
|
842
850
|
number(
|
|
843
851
|
value?:
|
|
844
|
-
|
|
|
845
|
-
| number
|
|
846
|
-
| BigNumber
|
|
847
|
-
| bigint
|
|
848
|
-
| Fraction
|
|
849
|
-
| boolean
|
|
850
|
-
| Unit
|
|
851
|
-
| null
|
|
852
|
+
string | number | BigNumber | bigint | Fraction | boolean | Unit | null
|
|
852
853
|
): number
|
|
853
854
|
number(value?: MathCollection): number | MathCollection
|
|
854
855
|
/**
|
|
@@ -928,7 +929,7 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
928
929
|
* @param unit The unit to be created
|
|
929
930
|
* @returns The created unit
|
|
930
931
|
*/
|
|
931
|
-
unit(value: MathNumericType, unit?: string): Unit
|
|
932
|
+
unit(value: MathNumericType, unit?: string | Unit): Unit
|
|
932
933
|
unit(value: MathCollection): Unit[]
|
|
933
934
|
|
|
934
935
|
/*************************************************************************
|
|
@@ -1823,6 +1824,26 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
1823
1824
|
re(x: MathJsChain<number | Complex>): MathJsChain<number>
|
|
1824
1825
|
re<T extends BigNumber | MathCollection>(x: MathJsChain<T>): MathJsChain<T>
|
|
1825
1826
|
|
|
1827
|
+
/**
|
|
1828
|
+
* Get the numerator of a fraction. For a fraction a/b, the function
|
|
1829
|
+
* returns a. For matrices, the function is evaluated element wise.
|
|
1830
|
+
* @param x A fraction, BigNumber, or array with fractions
|
|
1831
|
+
* @returns The numerator of x
|
|
1832
|
+
*/
|
|
1833
|
+
num(x: number | BigNumber | bigint | Fraction): bigint
|
|
1834
|
+
num(x: MathArray<MathScalarType>): MathArray<bigint>
|
|
1835
|
+
num(x: Matrix<MathScalarType>): Matrix<bigint>
|
|
1836
|
+
|
|
1837
|
+
/**
|
|
1838
|
+
* Get the denominator of a fraction. For a fraction a/b, the function
|
|
1839
|
+
* returns b. For matrices, the function is evaluated element wise.
|
|
1840
|
+
* @param x A fraction, BigNumber, or array with fractions
|
|
1841
|
+
* @returns The denominator of x
|
|
1842
|
+
*/
|
|
1843
|
+
den(x: number | BigNumber | bigint | Fraction): bigint
|
|
1844
|
+
den(x: MathArray<MathScalarType>): MathArray<bigint>
|
|
1845
|
+
den(x: Matrix<MathScalarType>): Matrix<bigint>
|
|
1846
|
+
|
|
1826
1847
|
/*************************************************************************
|
|
1827
1848
|
* Geometry functions
|
|
1828
1849
|
************************************************************************/
|
|
@@ -2575,14 +2596,16 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
2575
2596
|
lgamma<T extends number | Complex>(n: T): NoLiteralType<T>
|
|
2576
2597
|
|
|
2577
2598
|
/**
|
|
2578
|
-
*
|
|
2579
|
-
* a2, ...,
|
|
2580
|
-
*
|
|
2581
|
-
*
|
|
2582
|
-
*
|
|
2599
|
+
* Computes the number of ways of dividing a1 + a2 + ... + an distinct
|
|
2600
|
+
* items into n groups of sizes a1, a2, ..., an, where the order within
|
|
2601
|
+
* each group does not matter (the multinomial coefficient). multinomial
|
|
2602
|
+
* takes the ai as arguments, or a single one-dimensional array, and throws
|
|
2603
|
+
* an error if any entry is negative or not an integer.
|
|
2604
|
+
* @param a Nonnegative integer sizes of the groups
|
|
2583
2605
|
* @returns multinomial coefficient
|
|
2584
2606
|
*/
|
|
2585
|
-
multinomial<T extends
|
|
2607
|
+
multinomial<T extends MathNumericType>(...a: T[]): NoLiteralType<T>
|
|
2608
|
+
multinomial<T extends MathNumericType>(a: MathCollection<T>): NoLiteralType<T>
|
|
2586
2609
|
|
|
2587
2610
|
/**
|
|
2588
2611
|
* Compute the number of ways of obtaining an ordered subset of k
|
|
@@ -2975,19 +2998,53 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
2975
2998
|
max(...args: MathScalarType[]): MathScalarType
|
|
2976
2999
|
/**
|
|
2977
3000
|
* @param A A single matrix
|
|
3001
|
+
* @returns The maximum value
|
|
3002
|
+
*/
|
|
3003
|
+
max<T extends MathScalarType>(A: T[] | T[][]): T
|
|
3004
|
+
/**
|
|
3005
|
+
* @param A A one dimensional array
|
|
2978
3006
|
* @param dimension The maximum over the selected dimension
|
|
2979
3007
|
* @returns The maximum value
|
|
2980
3008
|
*/
|
|
3009
|
+
max<T extends MathScalarType>(A: T[], dimension: number | BigNumber): T
|
|
3010
|
+
/**
|
|
3011
|
+
* @param A A two dimensional array
|
|
3012
|
+
* @param dimension The maximum over the selected dimension
|
|
3013
|
+
* @returns An array with the maximum over the selected dimension
|
|
3014
|
+
*/
|
|
3015
|
+
max<T extends MathScalarType>(A: T[][], dimension: number | BigNumber): T[]
|
|
3016
|
+
/**
|
|
3017
|
+
* @param A A multi dimensional array
|
|
3018
|
+
* @param dimension The maximum over the selected dimension
|
|
3019
|
+
* @returns The maximum over the selected dimension
|
|
3020
|
+
*/
|
|
2981
3021
|
max<T extends MathScalarType>(
|
|
2982
|
-
A: T
|
|
2983
|
-
dimension
|
|
2984
|
-
): T
|
|
3022
|
+
A: MathArray<T>,
|
|
3023
|
+
dimension: number | BigNumber
|
|
3024
|
+
): T | MathArray<T>
|
|
2985
3025
|
/**
|
|
2986
3026
|
* @param A A single matrix
|
|
2987
3027
|
* @param dimension The maximum over the selected dimension
|
|
3028
|
+
* @returns A matrix with the maximum over the selected dimension
|
|
3029
|
+
*/
|
|
3030
|
+
max<T extends MathScalarType>(
|
|
3031
|
+
A: Matrix<T>,
|
|
3032
|
+
dimension: number | BigNumber
|
|
3033
|
+
): Matrix<T>
|
|
3034
|
+
/**
|
|
3035
|
+
* @param A A single matrix
|
|
2988
3036
|
* @returns The maximum value
|
|
2989
3037
|
*/
|
|
2990
|
-
max(A: MathCollection
|
|
3038
|
+
max(A: MathCollection): MathScalarType
|
|
3039
|
+
/**
|
|
3040
|
+
* @param A A single matrix
|
|
3041
|
+
* @param dimension The maximum over the selected dimension
|
|
3042
|
+
* @returns The maximum over the selected dimension
|
|
3043
|
+
*/
|
|
3044
|
+
max(
|
|
3045
|
+
A: MathCollection,
|
|
3046
|
+
dimension: number | BigNumber
|
|
3047
|
+
): MathScalarType | MathCollection
|
|
2991
3048
|
|
|
2992
3049
|
/**
|
|
2993
3050
|
* Compute the mean value of matrix or a list with values. In case of a
|
|
@@ -3005,19 +3062,59 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
3005
3062
|
mean(...args: MathScalarType[]): MathScalarType
|
|
3006
3063
|
/**
|
|
3007
3064
|
* @param A A single matrix
|
|
3065
|
+
* @returns The mean value
|
|
3066
|
+
*/
|
|
3067
|
+
mean<T extends MathScalarType>(A: T[] | T[][]): T
|
|
3068
|
+
/**
|
|
3069
|
+
* @param A A one dimensional array
|
|
3008
3070
|
* @param dimension The mean over the selected dimension
|
|
3009
3071
|
* @returns The mean value
|
|
3010
3072
|
*/
|
|
3011
3073
|
mean<T extends MathScalarType>(
|
|
3012
|
-
A: T[]
|
|
3013
|
-
dimension
|
|
3014
|
-
): T
|
|
3074
|
+
A: T[],
|
|
3075
|
+
dimension: number | BigNumber
|
|
3076
|
+
): NoLiteralScalarType<T>
|
|
3077
|
+
/**
|
|
3078
|
+
* @param A A two dimensional array
|
|
3079
|
+
* @param dimension The mean over the selected dimension
|
|
3080
|
+
* @returns An array with the mean over the selected dimension
|
|
3081
|
+
*/
|
|
3082
|
+
mean<T extends MathScalarType>(
|
|
3083
|
+
A: T[][],
|
|
3084
|
+
dimension: number | BigNumber
|
|
3085
|
+
): NoLiteralScalarType<T>[]
|
|
3086
|
+
/**
|
|
3087
|
+
* @param A A multi dimensional array
|
|
3088
|
+
* @param dimension The mean over the selected dimension
|
|
3089
|
+
* @returns The mean over the selected dimension
|
|
3090
|
+
*/
|
|
3091
|
+
mean<T extends MathScalarType>(
|
|
3092
|
+
A: MathArray<T>,
|
|
3093
|
+
dimension: number | BigNumber
|
|
3094
|
+
): NoLiteralScalarType<T> | MathArray<NoLiteralScalarType<T>>
|
|
3015
3095
|
/**
|
|
3016
3096
|
* @param A A single matrix
|
|
3017
3097
|
* @param dimension The mean over the selected dimension
|
|
3098
|
+
* @returns A matrix with the mean over the selected dimension
|
|
3099
|
+
*/
|
|
3100
|
+
mean<T extends MathScalarType>(
|
|
3101
|
+
A: Matrix<T>,
|
|
3102
|
+
dimension: number | BigNumber
|
|
3103
|
+
): Matrix<NoLiteralScalarType<T>>
|
|
3104
|
+
/**
|
|
3105
|
+
* @param A A single matrix
|
|
3018
3106
|
* @returns The mean value
|
|
3019
3107
|
*/
|
|
3020
|
-
mean(A: MathCollection
|
|
3108
|
+
mean(A: MathCollection): MathScalarType
|
|
3109
|
+
/**
|
|
3110
|
+
* @param A A single matrix
|
|
3111
|
+
* @param dimension The mean over the selected dimension
|
|
3112
|
+
* @returns The mean over the selected dimension
|
|
3113
|
+
*/
|
|
3114
|
+
mean(
|
|
3115
|
+
A: MathCollection,
|
|
3116
|
+
dimension: number | BigNumber
|
|
3117
|
+
): MathScalarType | MathCollection
|
|
3021
3118
|
|
|
3022
3119
|
/**
|
|
3023
3120
|
* Compute the median of a matrix or a list with values. The values are
|
|
@@ -3062,19 +3159,53 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
3062
3159
|
min(...args: MathScalarType[]): MathScalarType
|
|
3063
3160
|
/**
|
|
3064
3161
|
* @param A A single matrix
|
|
3162
|
+
* @returns The minimum value
|
|
3163
|
+
*/
|
|
3164
|
+
min<T extends MathScalarType>(A: T[] | T[][]): T
|
|
3165
|
+
/**
|
|
3166
|
+
* @param A A one dimensional array
|
|
3065
3167
|
* @param dimension The minimum over the selected dimension
|
|
3066
3168
|
* @returns The minimum value
|
|
3067
3169
|
*/
|
|
3170
|
+
min<T extends MathScalarType>(A: T[], dimension: number | BigNumber): T
|
|
3171
|
+
/**
|
|
3172
|
+
* @param A A two dimensional array
|
|
3173
|
+
* @param dimension The minimum over the selected dimension
|
|
3174
|
+
* @returns An array with the minimum over the selected dimension
|
|
3175
|
+
*/
|
|
3176
|
+
min<T extends MathScalarType>(A: T[][], dimension: number | BigNumber): T[]
|
|
3177
|
+
/**
|
|
3178
|
+
* @param A A multi dimensional array
|
|
3179
|
+
* @param dimension The minimum over the selected dimension
|
|
3180
|
+
* @returns The minimum over the selected dimension
|
|
3181
|
+
*/
|
|
3068
3182
|
min<T extends MathScalarType>(
|
|
3069
|
-
A: T
|
|
3070
|
-
dimension
|
|
3071
|
-
): T
|
|
3183
|
+
A: MathArray<T>,
|
|
3184
|
+
dimension: number | BigNumber
|
|
3185
|
+
): T | MathArray<T>
|
|
3072
3186
|
/**
|
|
3073
3187
|
* @param A A single matrix
|
|
3074
3188
|
* @param dimension The minimum over the selected dimension
|
|
3189
|
+
* @returns A matrix with the minimum over the selected dimension
|
|
3190
|
+
*/
|
|
3191
|
+
min<T extends MathScalarType>(
|
|
3192
|
+
A: Matrix<T>,
|
|
3193
|
+
dimension: number | BigNumber
|
|
3194
|
+
): Matrix<T>
|
|
3195
|
+
/**
|
|
3196
|
+
* @param A A single matrix
|
|
3075
3197
|
* @returns The minimum value
|
|
3076
3198
|
*/
|
|
3077
|
-
min(A: MathCollection
|
|
3199
|
+
min(A: MathCollection): MathScalarType
|
|
3200
|
+
/**
|
|
3201
|
+
* @param A A single matrix
|
|
3202
|
+
* @param dimension The minimum over the selected dimension
|
|
3203
|
+
* @returns The minimum over the selected dimension
|
|
3204
|
+
*/
|
|
3205
|
+
min(
|
|
3206
|
+
A: MathCollection,
|
|
3207
|
+
dimension: number | BigNumber
|
|
3208
|
+
): MathScalarType | MathCollection
|
|
3078
3209
|
|
|
3079
3210
|
/**
|
|
3080
3211
|
* Computes the mode of a set of numbers or a list with values(numbers
|
|
@@ -3191,13 +3322,57 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
3191
3322
|
* @param normalization Determines how to normalize the variance. Choose
|
|
3192
3323
|
* ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. Default value:
|
|
3193
3324
|
* ‘unbiased’.
|
|
3194
|
-
* @returns The standard deviation
|
|
3325
|
+
* @returns The standard deviation over the selected dimension
|
|
3195
3326
|
*/
|
|
3196
3327
|
std(
|
|
3197
|
-
array:
|
|
3198
|
-
dimension
|
|
3328
|
+
array: MathNumericType[],
|
|
3329
|
+
dimension: number | BigNumber,
|
|
3330
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3331
|
+
): MathNumericType
|
|
3332
|
+
/**
|
|
3333
|
+
* @param array A two dimensional array
|
|
3334
|
+
* @param dimension A dimension to compute the standard deviation on
|
|
3335
|
+
* @param normalization Determines how to normalize the variance
|
|
3336
|
+
* @returns An array with the standard deviation over the selected dimension
|
|
3337
|
+
*/
|
|
3338
|
+
std(
|
|
3339
|
+
array: MathNumericType[][],
|
|
3340
|
+
dimension: number | BigNumber,
|
|
3199
3341
|
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3200
3342
|
): MathNumericType[]
|
|
3343
|
+
/**
|
|
3344
|
+
* @param array A multi dimensional array
|
|
3345
|
+
* @param dimension A dimension to compute the standard deviation on
|
|
3346
|
+
* @param normalization Determines how to normalize the variance
|
|
3347
|
+
* @returns The standard deviation over the selected dimension
|
|
3348
|
+
*/
|
|
3349
|
+
std(
|
|
3350
|
+
array: MathArray<MathNumericType>,
|
|
3351
|
+
dimension: number | BigNumber,
|
|
3352
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3353
|
+
): MathNumericType | MathArray<MathNumericType>
|
|
3354
|
+
/**
|
|
3355
|
+
* @param array A single matrix
|
|
3356
|
+
* @param dimension A dimension to compute the standard deviation on
|
|
3357
|
+
* @param normalization Determines how to normalize the variance
|
|
3358
|
+
* @returns A matrix with the standard deviation over the selected dimension
|
|
3359
|
+
*/
|
|
3360
|
+
std(
|
|
3361
|
+
array: Matrix,
|
|
3362
|
+
dimension: number | BigNumber,
|
|
3363
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3364
|
+
): Matrix
|
|
3365
|
+
/**
|
|
3366
|
+
* @param array A single matrix or array
|
|
3367
|
+
* @param dimension A dimension to compute the standard deviation on
|
|
3368
|
+
* @param normalization Determines how to normalize the variance
|
|
3369
|
+
* @returns The standard deviation over the selected dimension
|
|
3370
|
+
*/
|
|
3371
|
+
std(
|
|
3372
|
+
array: MathCollection,
|
|
3373
|
+
dimension: number | BigNumber,
|
|
3374
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3375
|
+
): MathNumericType | MathCollection
|
|
3201
3376
|
/**
|
|
3202
3377
|
* Compute the standard deviation of a matrix or a list with values. The
|
|
3203
3378
|
* standard deviations is defined as the square root of the variance:
|
|
@@ -3216,7 +3391,7 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
3216
3391
|
*/
|
|
3217
3392
|
std(
|
|
3218
3393
|
array: MathCollection,
|
|
3219
|
-
normalization
|
|
3394
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3220
3395
|
): MathNumericType
|
|
3221
3396
|
|
|
3222
3397
|
/**
|
|
@@ -3234,19 +3409,59 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
3234
3409
|
sum(...args: MathScalarType[]): MathScalarType
|
|
3235
3410
|
/**
|
|
3236
3411
|
* @param A A single matrix
|
|
3412
|
+
* @returns The sum of all values
|
|
3413
|
+
*/
|
|
3414
|
+
sum<T extends MathScalarType>(A: T[] | T[][]): T
|
|
3415
|
+
/**
|
|
3416
|
+
* @param A A one dimensional array
|
|
3237
3417
|
* @param dimension The sum over the selected dimension
|
|
3238
3418
|
* @returns The sum of all values
|
|
3239
3419
|
*/
|
|
3240
3420
|
sum<T extends MathScalarType>(
|
|
3241
|
-
A: T[]
|
|
3242
|
-
dimension
|
|
3243
|
-
): T
|
|
3421
|
+
A: T[],
|
|
3422
|
+
dimension: number | BigNumber
|
|
3423
|
+
): NoLiteralScalarType<T>
|
|
3424
|
+
/**
|
|
3425
|
+
* @param A A two dimensional array
|
|
3426
|
+
* @param dimension The sum over the selected dimension
|
|
3427
|
+
* @returns An array with the sum over the selected dimension
|
|
3428
|
+
*/
|
|
3429
|
+
sum<T extends MathScalarType>(
|
|
3430
|
+
A: T[][],
|
|
3431
|
+
dimension: number | BigNumber
|
|
3432
|
+
): NoLiteralScalarType<T>[]
|
|
3433
|
+
/**
|
|
3434
|
+
* @param A A multi dimensional array
|
|
3435
|
+
* @param dimension The sum over the selected dimension
|
|
3436
|
+
* @returns The sum over the selected dimension
|
|
3437
|
+
*/
|
|
3438
|
+
sum<T extends MathScalarType>(
|
|
3439
|
+
A: MathArray<T>,
|
|
3440
|
+
dimension: number | BigNumber
|
|
3441
|
+
): NoLiteralScalarType<T> | MathArray<NoLiteralScalarType<T>>
|
|
3244
3442
|
/**
|
|
3245
3443
|
* @param A A single matrix
|
|
3246
3444
|
* @param dimension The sum over the selected dimension
|
|
3445
|
+
* @returns A matrix with the sum over the selected dimension
|
|
3446
|
+
*/
|
|
3447
|
+
sum<T extends MathScalarType>(
|
|
3448
|
+
A: Matrix<T>,
|
|
3449
|
+
dimension: number | BigNumber
|
|
3450
|
+
): Matrix<NoLiteralScalarType<T>>
|
|
3451
|
+
/**
|
|
3452
|
+
* @param A A single matrix
|
|
3247
3453
|
* @returns The sum of all values
|
|
3248
3454
|
*/
|
|
3249
|
-
sum(A: MathCollection
|
|
3455
|
+
sum(A: MathCollection): MathScalarType
|
|
3456
|
+
/**
|
|
3457
|
+
* @param A A single matrix
|
|
3458
|
+
* @param dimension The sum over the selected dimension
|
|
3459
|
+
* @returns The sum over the selected dimension
|
|
3460
|
+
*/
|
|
3461
|
+
sum(
|
|
3462
|
+
A: MathCollection,
|
|
3463
|
+
dimension: number | BigNumber
|
|
3464
|
+
): MathScalarType | MathCollection
|
|
3250
3465
|
|
|
3251
3466
|
/**
|
|
3252
3467
|
* Count the number of elements of a matrix, array or string.
|
|
@@ -3301,13 +3516,57 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
3301
3516
|
* @param normalization normalization Determines how to normalize the
|
|
3302
3517
|
* variance. Choose ‘unbiased’ (default), ‘uncorrected’, or ‘biased’.
|
|
3303
3518
|
* Default value: ‘unbiased’.
|
|
3304
|
-
* @returns variance
|
|
3519
|
+
* @returns The variance over the selected dimension
|
|
3305
3520
|
*/
|
|
3306
3521
|
variance(
|
|
3307
|
-
array:
|
|
3308
|
-
dimension
|
|
3522
|
+
array: MathNumericType[],
|
|
3523
|
+
dimension: number | BigNumber,
|
|
3524
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3525
|
+
): MathNumericType
|
|
3526
|
+
/**
|
|
3527
|
+
* @param array A two dimensional array
|
|
3528
|
+
* @param dimension A dimension to compute the variance on
|
|
3529
|
+
* @param normalization Determines how to normalize the variance
|
|
3530
|
+
* @returns An array with the variance over the selected dimension
|
|
3531
|
+
*/
|
|
3532
|
+
variance(
|
|
3533
|
+
array: MathNumericType[][],
|
|
3534
|
+
dimension: number | BigNumber,
|
|
3309
3535
|
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3310
3536
|
): MathNumericType[]
|
|
3537
|
+
/**
|
|
3538
|
+
* @param array A multi dimensional array
|
|
3539
|
+
* @param dimension A dimension to compute the variance on
|
|
3540
|
+
* @param normalization Determines how to normalize the variance
|
|
3541
|
+
* @returns The variance over the selected dimension
|
|
3542
|
+
*/
|
|
3543
|
+
variance(
|
|
3544
|
+
array: MathArray<MathNumericType>,
|
|
3545
|
+
dimension: number | BigNumber,
|
|
3546
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3547
|
+
): MathNumericType | MathArray<MathNumericType>
|
|
3548
|
+
/**
|
|
3549
|
+
* @param array A single matrix
|
|
3550
|
+
* @param dimension A dimension to compute the variance on
|
|
3551
|
+
* @param normalization Determines how to normalize the variance
|
|
3552
|
+
* @returns A matrix with the variance over the selected dimension
|
|
3553
|
+
*/
|
|
3554
|
+
variance(
|
|
3555
|
+
array: Matrix,
|
|
3556
|
+
dimension: number | BigNumber,
|
|
3557
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3558
|
+
): Matrix
|
|
3559
|
+
/**
|
|
3560
|
+
* @param array A single matrix or array
|
|
3561
|
+
* @param dimension A dimension to compute the variance on
|
|
3562
|
+
* @param normalization Determines how to normalize the variance
|
|
3563
|
+
* @returns The variance over the selected dimension
|
|
3564
|
+
*/
|
|
3565
|
+
variance(
|
|
3566
|
+
array: MathCollection,
|
|
3567
|
+
dimension: number | BigNumber,
|
|
3568
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3569
|
+
): MathNumericType | MathCollection
|
|
3311
3570
|
/**
|
|
3312
3571
|
* @param array A single matrix
|
|
3313
3572
|
* @param normalization normalization Determines how to normalize the
|
|
@@ -3317,7 +3576,7 @@ export interface MathJsInstance extends MathJsFactory {
|
|
|
3317
3576
|
*/
|
|
3318
3577
|
variance(
|
|
3319
3578
|
array: MathCollection,
|
|
3320
|
-
normalization
|
|
3579
|
+
normalization?: 'unbiased' | 'uncorrected' | 'biased'
|
|
3321
3580
|
): MathNumericType
|
|
3322
3581
|
|
|
3323
3582
|
/**
|
|
@@ -4320,7 +4579,9 @@ export const {
|
|
|
4320
4579
|
stdTransformDependencies,
|
|
4321
4580
|
sumTransformDependencies,
|
|
4322
4581
|
varianceTransformDependencies,
|
|
4323
|
-
printTransformDependencies
|
|
4582
|
+
printTransformDependencies,
|
|
4583
|
+
andTransformDependencies,
|
|
4584
|
+
orTransformDependencies
|
|
4324
4585
|
}: Record<string, FactoryFunctionMap>
|
|
4325
4586
|
|
|
4326
4587
|
export interface Matrix<T = MathGeneric> {
|
|
@@ -4818,13 +5079,7 @@ export interface FormatOptions {
|
|
|
4818
5079
|
* example '123.4' and '1.4e7'.
|
|
4819
5080
|
*/
|
|
4820
5081
|
notation?:
|
|
4821
|
-
| '
|
|
4822
|
-
| 'exponential'
|
|
4823
|
-
| 'engineering'
|
|
4824
|
-
| 'auto'
|
|
4825
|
-
| 'hex'
|
|
4826
|
-
| 'bin'
|
|
4827
|
-
| 'oct'
|
|
5082
|
+
'fixed' | 'exponential' | 'engineering' | 'auto' | 'hex' | 'bin' | 'oct'
|
|
4828
5083
|
|
|
4829
5084
|
/**
|
|
4830
5085
|
* A number between 0 and 16 to round the digits of the number. In case
|
|
@@ -5081,7 +5336,10 @@ export interface MathJsChain<TValue> {
|
|
|
5081
5336
|
* @param unit The unit to be created
|
|
5082
5337
|
*/
|
|
5083
5338
|
unit(this: MathJsChain<string>, unit?: string): MathJsChain<Unit>
|
|
5084
|
-
unit(
|
|
5339
|
+
unit(
|
|
5340
|
+
this: MathJsChain<MathNumericType>,
|
|
5341
|
+
unit?: string | Unit
|
|
5342
|
+
): MathJsChain<Unit>
|
|
5085
5343
|
unit(this: MathJsChain<MathCollection>): MathJsChain<Unit[]>
|
|
5086
5344
|
|
|
5087
5345
|
/*************************************************************************
|
|
@@ -5942,6 +6200,30 @@ export interface MathJsChain<TValue> {
|
|
|
5942
6200
|
re(this: MathJsChain<BigNumber>): MathJsChain<BigNumber>
|
|
5943
6201
|
re(this: MathJsChain<MathCollection>): MathJsChain<MathCollection>
|
|
5944
6202
|
|
|
6203
|
+
/**
|
|
6204
|
+
* Get the numerator of a fraction. For a fraction a/b, the function
|
|
6205
|
+
* returns a. For matrices, the function is evaluated element wise.
|
|
6206
|
+
*/
|
|
6207
|
+
num(
|
|
6208
|
+
this: MathJsChain<number | BigNumber | bigint | Fraction>
|
|
6209
|
+
): MathJsChain<bigint>
|
|
6210
|
+
num(
|
|
6211
|
+
this: MathJsChain<MathArray<MathScalarType>>
|
|
6212
|
+
): MathJsChain<MathArray<bigint>>
|
|
6213
|
+
num(this: MathJsChain<Matrix<MathScalarType>>): MathJsChain<Matrix<bigint>>
|
|
6214
|
+
|
|
6215
|
+
/**
|
|
6216
|
+
* Get the denominator of a fraction. For a fraction a/b, the function
|
|
6217
|
+
* returns b. For matrices, the function is evaluated element wise.
|
|
6218
|
+
*/
|
|
6219
|
+
den(
|
|
6220
|
+
this: MathJsChain<number | BigNumber | bigint | Fraction>
|
|
6221
|
+
): MathJsChain<bigint>
|
|
6222
|
+
den(
|
|
6223
|
+
this: MathJsChain<MathArray<MathScalarType>>
|
|
6224
|
+
): MathJsChain<MathArray<bigint>>
|
|
6225
|
+
den(this: MathJsChain<Matrix<MathScalarType>>): MathJsChain<Matrix<bigint>>
|
|
6226
|
+
|
|
5945
6227
|
/*************************************************************************
|
|
5946
6228
|
* Geometry functions
|
|
5947
6229
|
************************************************************************/
|
|
@@ -6437,14 +6719,19 @@ export interface MathJsChain<TValue> {
|
|
|
6437
6719
|
): MathJsChain<number>
|
|
6438
6720
|
|
|
6439
6721
|
/**
|
|
6440
|
-
*
|
|
6441
|
-
* a2, ...,
|
|
6442
|
-
*
|
|
6443
|
-
*
|
|
6722
|
+
* Computes the number of ways of dividing a1 + a2 + ... + an distinct
|
|
6723
|
+
* items into n groups of sizes a1, a2, ..., an, where the order within
|
|
6724
|
+
* each group does not matter (the multinomial coefficient). multinomial
|
|
6725
|
+
* takes the ai as arguments, or a single one-dimensional array, and
|
|
6726
|
+
* throws an error if any entry
|
|
6727
|
+
* is negative or not an integer.
|
|
6444
6728
|
*/
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6729
|
+
multinomial<T extends MathNumericType>(
|
|
6730
|
+
a1: MathJsChain<T>,
|
|
6731
|
+
...rest: T[]
|
|
6732
|
+
): MathJsChain<NoLiteralType<T>>
|
|
6733
|
+
multinomial<T extends MathNumericType>(
|
|
6734
|
+
a: MathJsChain<MathCollection<T>>
|
|
6448
6735
|
): MathJsChain<NoLiteralType<T>>
|
|
6449
6736
|
|
|
6450
6737
|
/**
|
|
@@ -7633,6 +7920,10 @@ export const {
|
|
|
7633
7920
|
im,
|
|
7634
7921
|
re,
|
|
7635
7922
|
|
|
7923
|
+
// fraction
|
|
7924
|
+
num,
|
|
7925
|
+
den,
|
|
7926
|
+
|
|
7636
7927
|
// geometry
|
|
7637
7928
|
distance,
|
|
7638
7929
|
intersect,
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createUseMatrixForArrayScalar = void 0;
|
|
7
|
-
var _factory = require("../../utils/factory.js");
|
|
8
|
-
const createUseMatrixForArrayScalar = exports.createUseMatrixForArrayScalar = /* #__PURE__ */(0, _factory.factory)('useMatrixForArrayScalar', ['typed', 'matrix'], _ref => {
|
|
9
|
-
let {
|
|
10
|
-
typed,
|
|
11
|
-
matrix
|
|
12
|
-
} = _ref;
|
|
13
|
-
return {
|
|
14
|
-
'Array, number': typed.referTo('DenseMatrix, number', selfDn => (x, y) => selfDn(matrix(x), y).valueOf()),
|
|
15
|
-
'Array, BigNumber': typed.referTo('DenseMatrix, BigNumber', selfDB => (x, y) => selfDB(matrix(x), y).valueOf()),
|
|
16
|
-
'number, Array': typed.referTo('number, DenseMatrix', selfnD => (x, y) => selfnD(x, matrix(y)).valueOf()),
|
|
17
|
-
'BigNumber, Array': typed.referTo('BigNumber, DenseMatrix', selfBD => (x, y) => selfBD(x, matrix(y)).valueOf())
|
|
18
|
-
};
|
|
19
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { factory } from '../../utils/factory.js';
|
|
2
|
-
export var createUseMatrixForArrayScalar = /* #__PURE__ */factory('useMatrixForArrayScalar', ['typed', 'matrix'], _ref => {
|
|
3
|
-
var {
|
|
4
|
-
typed,
|
|
5
|
-
matrix
|
|
6
|
-
} = _ref;
|
|
7
|
-
return {
|
|
8
|
-
'Array, number': typed.referTo('DenseMatrix, number', selfDn => (x, y) => selfDn(matrix(x), y).valueOf()),
|
|
9
|
-
'Array, BigNumber': typed.referTo('DenseMatrix, BigNumber', selfDB => (x, y) => selfDB(matrix(x), y).valueOf()),
|
|
10
|
-
'number, Array': typed.referTo('number, DenseMatrix', selfnD => (x, y) => selfnD(x, matrix(y)).valueOf()),
|
|
11
|
-
'BigNumber, Array': typed.referTo('BigNumber, DenseMatrix', selfBD => (x, y) => selfBD(x, matrix(y)).valueOf())
|
|
12
|
-
};
|
|
13
|
-
});
|