mathjs 9.3.2 → 9.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/HISTORY.md +22 -0
- package/README.md +1 -0
- package/bin/cli.js +11 -11
- package/docs/expressions/parsing.md +21 -4
- package/docs/reference/functions/complex.md +5 -49
- package/docs/reference/functions/eigs.md +12 -12
- package/docs/reference/functions/flatten.md +1 -0
- package/docs/reference/functions/matrixFromColumns.md +1 -1
- package/docs/reference/functions/matrixFromFunction.md +12 -0
- package/docs/reference/functions/matrixFromRows.md +1 -1
- package/docs/reference/functions.md +4 -1
- package/examples/advanced/custom_scope_objects.js +115 -0
- package/lib/browser/math.js +10 -10
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/core/create.js +8 -7
- package/lib/cjs/core/function/import.js +9 -7
- package/lib/cjs/core/function/typed.js +6 -1
- package/lib/cjs/defaultInstance.js +3 -3
- package/lib/cjs/entry/allFactoriesAny.js +3 -3
- package/lib/cjs/entry/allFactoriesNumber.js +3 -3
- package/lib/cjs/entry/configReadonly.js +5 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js +51 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js +29 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js +26 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js +29 -0
- package/lib/cjs/entry/dependenciesAny.generated.js +24 -0
- package/lib/cjs/entry/impureFunctionsAny.generated.js +22 -17
- package/lib/cjs/entry/impureFunctionsNumber.generated.js +11 -9
- package/lib/cjs/entry/pureFunctionsAny.generated.js +78 -41
- package/lib/cjs/expression/Parser.js +22 -15
- package/lib/cjs/expression/embeddedDocs/embeddedDocs.js +9 -0
- package/lib/cjs/expression/embeddedDocs/function/matrix/column.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromColumns.js +15 -0
- package/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromFunction.js +15 -0
- package/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromRows.js +15 -0
- package/lib/cjs/expression/embeddedDocs/function/matrix/row.js +1 -1
- package/lib/cjs/expression/function/evaluate.js +6 -4
- package/lib/cjs/expression/keywords.js +1 -3
- package/lib/cjs/expression/node/AccessorNode.js +1 -0
- package/lib/cjs/expression/node/AssignmentNode.js +6 -3
- package/lib/cjs/expression/node/FunctionAssignmentNode.js +2 -4
- package/lib/cjs/expression/node/FunctionNode.js +76 -46
- package/lib/cjs/expression/node/IndexNode.js +5 -13
- package/lib/cjs/expression/node/Node.js +15 -9
- package/lib/cjs/expression/node/ObjectNode.js +5 -3
- package/lib/cjs/expression/node/SymbolNode.js +2 -2
- package/lib/cjs/expression/node/utils/access.js +5 -3
- package/lib/cjs/expression/node/utils/assign.js +5 -3
- package/lib/cjs/expression/parse.js +10 -14
- package/lib/cjs/expression/transform/utils/compileInlineExpression.js +5 -3
- package/lib/cjs/factoriesAny.js +24 -0
- package/lib/cjs/function/algebra/decomposition/qr.js +5 -3
- package/lib/cjs/function/algebra/simplify/resolve.js +7 -1
- package/lib/cjs/function/algebra/simplify.js +20 -14
- package/lib/cjs/function/algebra/solver/lsolveAll.js +6 -16
- package/lib/cjs/function/algebra/solver/usolveAll.js +6 -16
- package/lib/cjs/function/arithmetic/ceil.js +6 -16
- package/lib/cjs/function/arithmetic/floor.js +6 -16
- package/lib/cjs/function/arithmetic/norm.js +2 -2
- package/lib/cjs/function/arithmetic/pow.js +9 -7
- package/lib/cjs/function/arithmetic/round.js +7 -5
- package/lib/cjs/function/complex/im.js +3 -0
- package/lib/cjs/function/complex/re.js +3 -0
- package/lib/cjs/function/matrix/eigs/complexEigs.js +631 -0
- package/lib/cjs/function/matrix/eigs/realSymetric.js +341 -0
- package/lib/cjs/function/matrix/eigs.js +188 -334
- package/lib/cjs/function/matrix/flatten.js +1 -0
- package/lib/cjs/function/matrix/matrixFromColumns.js +118 -0
- package/lib/cjs/function/matrix/matrixFromFunction.js +85 -0
- package/lib/cjs/function/matrix/matrixFromRows.js +108 -0
- package/lib/cjs/function/probability/pickRandom.js +1 -1
- package/lib/cjs/function/probability/util/seededRNG.js +2 -2
- package/lib/cjs/function/relational/compareNatural.js +2 -2
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/plain/bignumber/index.js +2 -2
- package/lib/cjs/type/bignumber/BigNumber.js +2 -2
- package/lib/cjs/type/complex/Complex.js +5 -5
- package/lib/cjs/type/fraction/Fraction.js +2 -2
- package/lib/cjs/type/matrix/DenseMatrix.js +138 -0
- package/lib/cjs/type/matrix/Matrix.js +10 -0
- package/lib/cjs/type/matrix/SparseMatrix.js +77 -3
- package/lib/cjs/type/matrix/function/matrix.js +2 -1
- package/lib/cjs/type/unit/Unit.js +15 -13
- package/lib/cjs/utils/array.js +1 -1
- package/lib/cjs/utils/customs.js +18 -4
- package/lib/cjs/utils/emitter.js +2 -2
- package/lib/cjs/utils/function.js +6 -2
- package/lib/cjs/utils/is.js +7 -5
- package/lib/cjs/utils/latex.js +2 -2
- package/lib/cjs/utils/map.js +197 -0
- package/lib/cjs/utils/object.js +6 -5
- package/lib/cjs/utils/scope.js +33 -0
- package/lib/cjs/utils/snapshot.js +17 -16
- package/lib/cjs/utils/string.js +6 -4
- package/lib/cjs/version.js +1 -1
- package/lib/esm/constants.js +15 -15
- package/lib/esm/core/create.js +1 -2
- package/lib/esm/core/function/typed.js +5 -1
- package/lib/esm/entry/configReadonly.js +1 -2
- package/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js +34 -0
- package/lib/esm/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js +16 -0
- package/lib/esm/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js +14 -0
- package/lib/esm/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js +16 -0
- package/lib/esm/entry/dependenciesAny.generated.js +3 -0
- package/lib/esm/entry/impureFunctionsAny.generated.js +13 -10
- package/lib/esm/entry/impureFunctionsNumber.generated.js +1 -1
- package/lib/esm/entry/pureFunctionsAny.generated.js +66 -32
- package/lib/esm/expression/Help.js +1 -1
- package/lib/esm/expression/Parser.js +23 -15
- package/lib/esm/expression/embeddedDocs/embeddedDocs.js +6 -0
- package/lib/esm/expression/embeddedDocs/function/matrix/column.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js +8 -0
- package/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js +8 -0
- package/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js +8 -0
- package/lib/esm/expression/embeddedDocs/function/matrix/row.js +1 -1
- package/lib/esm/expression/function/compile.js +1 -1
- package/lib/esm/expression/function/evaluate.js +6 -5
- package/lib/esm/expression/function/help.js +1 -1
- package/lib/esm/expression/function/parser.js +1 -1
- package/lib/esm/expression/keywords.js +1 -3
- package/lib/esm/expression/node/AccessorNode.js +2 -1
- package/lib/esm/expression/node/ArrayNode.js +1 -1
- package/lib/esm/expression/node/AssignmentNode.js +7 -4
- package/lib/esm/expression/node/BlockNode.js +1 -1
- package/lib/esm/expression/node/ConditionalNode.js +1 -1
- package/lib/esm/expression/node/ConstantNode.js +1 -1
- package/lib/esm/expression/node/FunctionAssignmentNode.js +3 -4
- package/lib/esm/expression/node/FunctionNode.js +57 -39
- package/lib/esm/expression/node/IndexNode.js +1 -1
- package/lib/esm/expression/node/Node.js +7 -8
- package/lib/esm/expression/node/ObjectNode.js +1 -1
- package/lib/esm/expression/node/OperatorNode.js +1 -1
- package/lib/esm/expression/node/ParenthesisNode.js +1 -1
- package/lib/esm/expression/node/RangeNode.js +1 -1
- package/lib/esm/expression/node/RelationalNode.js +1 -1
- package/lib/esm/expression/node/SymbolNode.js +3 -3
- package/lib/esm/expression/parse.js +2 -3
- package/lib/esm/expression/transform/apply.transform.js +1 -1
- package/lib/esm/expression/transform/column.transform.js +1 -1
- package/lib/esm/expression/transform/concat.transform.js +1 -1
- package/lib/esm/expression/transform/diff.transform.js +1 -1
- package/lib/esm/expression/transform/filter.transform.js +1 -1
- package/lib/esm/expression/transform/forEach.transform.js +1 -1
- package/lib/esm/expression/transform/index.transform.js +1 -1
- package/lib/esm/expression/transform/map.transform.js +1 -1
- package/lib/esm/expression/transform/max.transform.js +1 -1
- package/lib/esm/expression/transform/mean.transform.js +1 -1
- package/lib/esm/expression/transform/min.transform.js +1 -1
- package/lib/esm/expression/transform/range.transform.js +1 -1
- package/lib/esm/expression/transform/row.transform.js +1 -1
- package/lib/esm/expression/transform/std.transform.js +1 -1
- package/lib/esm/expression/transform/subset.transform.js +1 -1
- package/lib/esm/expression/transform/sum.transform.js +1 -1
- package/lib/esm/expression/transform/utils/compileInlineExpression.js +4 -3
- package/lib/esm/expression/transform/variance.transform.js +1 -1
- package/lib/esm/factoriesAny.js +3 -0
- package/lib/esm/factoriesNumber.js +1 -1
- package/lib/esm/function/algebra/decomposition/lup.js +1 -1
- package/lib/esm/function/algebra/decomposition/qr.js +2 -3
- package/lib/esm/function/algebra/decomposition/slu.js +1 -1
- package/lib/esm/function/algebra/derivative.js +1 -1
- package/lib/esm/function/algebra/rationalize.js +1 -1
- package/lib/esm/function/algebra/simplify/resolve.js +7 -2
- package/lib/esm/function/algebra/simplify/simplifyConstant.js +1 -1
- package/lib/esm/function/algebra/simplify/simplifyCore.js +1 -1
- package/lib/esm/function/algebra/simplify/util.js +1 -1
- package/lib/esm/function/algebra/simplify.js +16 -12
- package/lib/esm/function/algebra/solver/lsolve.js +1 -1
- package/lib/esm/function/algebra/solver/lsolveAll.js +1 -1
- package/lib/esm/function/algebra/solver/lusolve.js +1 -1
- package/lib/esm/function/algebra/solver/usolve.js +1 -1
- package/lib/esm/function/algebra/solver/usolveAll.js +1 -1
- package/lib/esm/function/algebra/sparse/csAmd.js +1 -1
- package/lib/esm/function/algebra/sparse/csChol.js +1 -1
- package/lib/esm/function/algebra/sparse/csCounts.js +1 -1
- package/lib/esm/function/algebra/sparse/csLu.js +1 -1
- package/lib/esm/function/algebra/sparse/csSpsolve.js +1 -1
- package/lib/esm/function/algebra/sparse/csSqr.js +1 -1
- package/lib/esm/function/algebra/sparse/csSymperm.js +1 -1
- package/lib/esm/function/arithmetic/abs.js +1 -1
- package/lib/esm/function/arithmetic/add.js +1 -1
- package/lib/esm/function/arithmetic/addScalar.js +1 -1
- package/lib/esm/function/arithmetic/cbrt.js +1 -1
- package/lib/esm/function/arithmetic/ceil.js +1 -1
- package/lib/esm/function/arithmetic/cube.js +1 -1
- package/lib/esm/function/arithmetic/divide.js +1 -1
- package/lib/esm/function/arithmetic/divideScalar.js +1 -1
- package/lib/esm/function/arithmetic/dotDivide.js +1 -1
- package/lib/esm/function/arithmetic/dotMultiply.js +1 -1
- package/lib/esm/function/arithmetic/dotPow.js +1 -1
- package/lib/esm/function/arithmetic/exp.js +1 -1
- package/lib/esm/function/arithmetic/expm1.js +1 -1
- package/lib/esm/function/arithmetic/fix.js +1 -1
- package/lib/esm/function/arithmetic/floor.js +1 -1
- package/lib/esm/function/arithmetic/gcd.js +1 -1
- package/lib/esm/function/arithmetic/hypot.js +1 -1
- package/lib/esm/function/arithmetic/lcm.js +1 -1
- package/lib/esm/function/arithmetic/log.js +1 -1
- package/lib/esm/function/arithmetic/log10.js +1 -1
- package/lib/esm/function/arithmetic/log1p.js +1 -1
- package/lib/esm/function/arithmetic/log2.js +1 -1
- package/lib/esm/function/arithmetic/mod.js +1 -1
- package/lib/esm/function/arithmetic/multiply.js +1 -1
- package/lib/esm/function/arithmetic/multiplyScalar.js +1 -1
- package/lib/esm/function/arithmetic/norm.js +3 -3
- package/lib/esm/function/arithmetic/nthRoot.js +2 -2
- package/lib/esm/function/arithmetic/nthRoots.js +1 -1
- package/lib/esm/function/arithmetic/pow.js +10 -8
- package/lib/esm/function/arithmetic/round.js +6 -6
- package/lib/esm/function/arithmetic/sign.js +1 -1
- package/lib/esm/function/arithmetic/sqrt.js +1 -1
- package/lib/esm/function/arithmetic/square.js +1 -1
- package/lib/esm/function/arithmetic/subtract.js +1 -1
- package/lib/esm/function/arithmetic/unaryMinus.js +1 -1
- package/lib/esm/function/arithmetic/unaryPlus.js +1 -1
- package/lib/esm/function/arithmetic/xgcd.js +1 -1
- package/lib/esm/function/bitwise/bitAnd.js +1 -1
- package/lib/esm/function/bitwise/bitNot.js +1 -1
- package/lib/esm/function/bitwise/bitOr.js +1 -1
- package/lib/esm/function/bitwise/bitXor.js +1 -1
- package/lib/esm/function/bitwise/leftShift.js +1 -1
- package/lib/esm/function/bitwise/rightArithShift.js +1 -1
- package/lib/esm/function/bitwise/rightLogShift.js +1 -1
- package/lib/esm/function/combinatorics/bellNumbers.js +1 -1
- package/lib/esm/function/combinatorics/catalan.js +1 -1
- package/lib/esm/function/combinatorics/composition.js +1 -1
- package/lib/esm/function/combinatorics/stirlingS2.js +1 -1
- package/lib/esm/function/complex/arg.js +1 -1
- package/lib/esm/function/complex/conj.js +1 -1
- package/lib/esm/function/complex/im.js +4 -1
- package/lib/esm/function/complex/re.js +4 -1
- package/lib/esm/function/geometry/distance.js +1 -1
- package/lib/esm/function/geometry/intersect.js +1 -1
- package/lib/esm/function/logical/and.js +1 -1
- package/lib/esm/function/logical/not.js +1 -1
- package/lib/esm/function/logical/or.js +1 -1
- package/lib/esm/function/logical/xor.js +1 -1
- package/lib/esm/function/matrix/apply.js +1 -1
- package/lib/esm/function/matrix/column.js +1 -1
- package/lib/esm/function/matrix/concat.js +1 -1
- package/lib/esm/function/matrix/count.js +1 -1
- package/lib/esm/function/matrix/cross.js +1 -1
- package/lib/esm/function/matrix/ctranspose.js +1 -1
- package/lib/esm/function/matrix/det.js +1 -1
- package/lib/esm/function/matrix/diag.js +1 -1
- package/lib/esm/function/matrix/diff.js +1 -1
- package/lib/esm/function/matrix/dot.js +1 -1
- package/lib/esm/function/matrix/eigs/complexEigs.js +586 -0
- package/lib/esm/function/matrix/eigs/realSymetric.js +335 -0
- package/lib/esm/function/matrix/eigs.js +187 -335
- package/lib/esm/function/matrix/expm.js +1 -1
- package/lib/esm/function/matrix/filter.js +1 -1
- package/lib/esm/function/matrix/flatten.js +2 -1
- package/lib/esm/function/matrix/forEach.js +1 -1
- package/lib/esm/function/matrix/getMatrixDataType.js +1 -1
- package/lib/esm/function/matrix/identity.js +1 -1
- package/lib/esm/function/matrix/inv.js +1 -1
- package/lib/esm/function/matrix/kron.js +1 -1
- package/lib/esm/function/matrix/map.js +1 -1
- package/lib/esm/function/matrix/matrixFromColumns.js +93 -0
- package/lib/esm/function/matrix/matrixFromFunction.js +78 -0
- package/lib/esm/function/matrix/matrixFromRows.js +83 -0
- package/lib/esm/function/matrix/ones.js +1 -1
- package/lib/esm/function/matrix/partitionSelect.js +1 -1
- package/lib/esm/function/matrix/range.js +1 -1
- package/lib/esm/function/matrix/reshape.js +1 -1
- package/lib/esm/function/matrix/resize.js +1 -1
- package/lib/esm/function/matrix/rotate.js +1 -1
- package/lib/esm/function/matrix/rotationMatrix.js +1 -1
- package/lib/esm/function/matrix/row.js +1 -1
- package/lib/esm/function/matrix/size.js +1 -1
- package/lib/esm/function/matrix/sort.js +1 -1
- package/lib/esm/function/matrix/sqrtm.js +1 -1
- package/lib/esm/function/matrix/squeeze.js +1 -1
- package/lib/esm/function/matrix/subset.js +1 -1
- package/lib/esm/function/matrix/trace.js +1 -1
- package/lib/esm/function/matrix/transpose.js +1 -1
- package/lib/esm/function/matrix/zeros.js +1 -1
- package/lib/esm/function/probability/combinations.js +1 -1
- package/lib/esm/function/probability/combinationsWithRep.js +1 -1
- package/lib/esm/function/probability/factorial.js +1 -1
- package/lib/esm/function/probability/gamma.js +1 -1
- package/lib/esm/function/probability/kldivergence.js +1 -1
- package/lib/esm/function/probability/multinomial.js +1 -1
- package/lib/esm/function/probability/permutations.js +1 -1
- package/lib/esm/function/probability/pickRandom.js +2 -2
- package/lib/esm/function/probability/random.js +2 -2
- package/lib/esm/function/probability/randomInt.js +1 -1
- package/lib/esm/function/relational/compare.js +2 -2
- package/lib/esm/function/relational/compareNatural.js +1 -1
- package/lib/esm/function/relational/compareText.js +2 -2
- package/lib/esm/function/relational/deepEqual.js +1 -1
- package/lib/esm/function/relational/equal.js +2 -2
- package/lib/esm/function/relational/equalScalar.js +2 -2
- package/lib/esm/function/relational/equalText.js +1 -1
- package/lib/esm/function/relational/larger.js +2 -2
- package/lib/esm/function/relational/largerEq.js +2 -2
- package/lib/esm/function/relational/smaller.js +2 -2
- package/lib/esm/function/relational/smallerEq.js +2 -2
- package/lib/esm/function/relational/unequal.js +2 -2
- package/lib/esm/function/set/setCartesian.js +1 -1
- package/lib/esm/function/set/setDifference.js +1 -1
- package/lib/esm/function/set/setDistinct.js +1 -1
- package/lib/esm/function/set/setIntersect.js +1 -1
- package/lib/esm/function/set/setIsSubset.js +1 -1
- package/lib/esm/function/set/setMultiplicity.js +1 -1
- package/lib/esm/function/set/setPowerset.js +1 -1
- package/lib/esm/function/set/setSize.js +1 -1
- package/lib/esm/function/set/setSymDifference.js +1 -1
- package/lib/esm/function/set/setUnion.js +1 -1
- package/lib/esm/function/special/erf.js +1 -1
- package/lib/esm/function/statistics/mad.js +1 -1
- package/lib/esm/function/statistics/max.js +1 -1
- package/lib/esm/function/statistics/mean.js +1 -1
- package/lib/esm/function/statistics/median.js +1 -1
- package/lib/esm/function/statistics/min.js +1 -1
- package/lib/esm/function/statistics/mode.js +1 -1
- package/lib/esm/function/statistics/prod.js +1 -1
- package/lib/esm/function/statistics/quantileSeq.js +1 -1
- package/lib/esm/function/statistics/std.js +1 -1
- package/lib/esm/function/statistics/sum.js +1 -1
- package/lib/esm/function/statistics/variance.js +1 -1
- package/lib/esm/function/string/bin.js +1 -1
- package/lib/esm/function/string/format.js +1 -1
- package/lib/esm/function/string/hex.js +1 -1
- package/lib/esm/function/string/oct.js +1 -1
- package/lib/esm/function/string/print.js +1 -1
- package/lib/esm/function/trigonometry/acos.js +1 -1
- package/lib/esm/function/trigonometry/acosh.js +1 -1
- package/lib/esm/function/trigonometry/acot.js +1 -1
- package/lib/esm/function/trigonometry/acoth.js +1 -1
- package/lib/esm/function/trigonometry/acsc.js +1 -1
- package/lib/esm/function/trigonometry/acsch.js +1 -1
- package/lib/esm/function/trigonometry/asec.js +1 -1
- package/lib/esm/function/trigonometry/asech.js +1 -1
- package/lib/esm/function/trigonometry/asin.js +1 -1
- package/lib/esm/function/trigonometry/asinh.js +1 -1
- package/lib/esm/function/trigonometry/atan.js +1 -1
- package/lib/esm/function/trigonometry/atan2.js +1 -1
- package/lib/esm/function/trigonometry/atanh.js +1 -1
- package/lib/esm/function/trigonometry/cos.js +1 -1
- package/lib/esm/function/trigonometry/cosh.js +1 -1
- package/lib/esm/function/trigonometry/cot.js +1 -1
- package/lib/esm/function/trigonometry/coth.js +1 -1
- package/lib/esm/function/trigonometry/csc.js +1 -1
- package/lib/esm/function/trigonometry/csch.js +1 -1
- package/lib/esm/function/trigonometry/sec.js +1 -1
- package/lib/esm/function/trigonometry/sech.js +1 -1
- package/lib/esm/function/trigonometry/sin.js +1 -1
- package/lib/esm/function/trigonometry/sinh.js +1 -1
- package/lib/esm/function/trigonometry/tan.js +1 -1
- package/lib/esm/function/trigonometry/tanh.js +1 -1
- package/lib/esm/function/unit/to.js +1 -1
- package/lib/esm/function/utils/clone.js +1 -1
- package/lib/esm/function/utils/hasNumericValue.js +1 -1
- package/lib/esm/function/utils/isInteger.js +1 -1
- package/lib/esm/function/utils/isNaN.js +1 -1
- package/lib/esm/function/utils/isNegative.js +1 -1
- package/lib/esm/function/utils/isNumeric.js +1 -1
- package/lib/esm/function/utils/isPositive.js +1 -1
- package/lib/esm/function/utils/isPrime.js +1 -1
- package/lib/esm/function/utils/isZero.js +1 -1
- package/lib/esm/function/utils/numeric.js +1 -1
- package/lib/esm/function/utils/typeOf.js +1 -1
- package/lib/esm/json/reviver.js +1 -1
- package/lib/esm/type/bignumber/BigNumber.js +1 -1
- package/lib/esm/type/bignumber/function/bignumber.js +1 -1
- package/lib/esm/type/boolean.js +1 -1
- package/lib/esm/type/chain/Chain.js +1 -1
- package/lib/esm/type/chain/function/chain.js +1 -1
- package/lib/esm/type/complex/function/complex.js +1 -1
- package/lib/esm/type/fraction/function/fraction.js +1 -1
- package/lib/esm/type/matrix/DenseMatrix.js +75 -1
- package/lib/esm/type/matrix/FibonacciHeap.js +1 -1
- package/lib/esm/type/matrix/ImmutableDenseMatrix.js +1 -1
- package/lib/esm/type/matrix/Matrix.js +10 -0
- package/lib/esm/type/matrix/MatrixIndex.js +1 -1
- package/lib/esm/type/matrix/Spa.js +1 -1
- package/lib/esm/type/matrix/SparseMatrix.js +37 -3
- package/lib/esm/type/matrix/function/index.js +1 -1
- package/lib/esm/type/matrix/function/matrix.js +3 -2
- package/lib/esm/type/matrix/function/sparse.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm01.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm02.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm03.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm04.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm05.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm06.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm07.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm08.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm09.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm10.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm11.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm12.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm13.js +1 -1
- package/lib/esm/type/matrix/utils/algorithm14.js +1 -1
- package/lib/esm/type/number.js +1 -1
- package/lib/esm/type/string.js +1 -1
- package/lib/esm/type/unit/Unit.js +4 -5
- package/lib/esm/type/unit/function/createUnit.js +1 -1
- package/lib/esm/type/unit/function/splitUnit.js +1 -1
- package/lib/esm/type/unit/function/unit.js +1 -1
- package/lib/esm/type/unit/physicalConstants.js +2 -2
- package/lib/esm/utils/array.js +1 -1
- package/lib/esm/utils/customs.js +10 -0
- package/lib/esm/utils/map.js +135 -0
- package/lib/esm/utils/scope.js +26 -0
- package/lib/esm/utils/snapshot.js +3 -4
- package/lib/esm/version.js +1 -1
- package/package.json +18 -9
@@ -4,7 +4,7 @@ import { factory } from '../../utils/factory.js';
|
|
4
4
|
import { format } from '../../utils/string.js';
|
5
5
|
var name = 'inv';
|
6
6
|
var dependencies = ['typed', 'matrix', 'divideScalar', 'addScalar', 'multiply', 'unaryMinus', 'det', 'identity', 'abs'];
|
7
|
-
export var createInv = /* #__PURE__ */factory(name, dependencies,
|
7
|
+
export var createInv = /* #__PURE__ */factory(name, dependencies, _ref => {
|
8
8
|
var {
|
9
9
|
typed,
|
10
10
|
matrix,
|
@@ -2,7 +2,7 @@ import { arraySize as size } from '../../utils/array.js';
|
|
2
2
|
import { factory } from '../../utils/factory.js';
|
3
3
|
var name = 'kron';
|
4
4
|
var dependencies = ['typed', 'matrix', 'multiplyScalar'];
|
5
|
-
export var createKron = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createKron = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed,
|
8
8
|
matrix,
|
@@ -2,7 +2,7 @@ import { maxArgumentCount } from '../../utils/function.js';
|
|
2
2
|
import { factory } from '../../utils/factory.js';
|
3
3
|
var name = 'map';
|
4
4
|
var dependencies = ['typed'];
|
5
|
-
export var createMap = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createMap = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed
|
8
8
|
} = _ref;
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { factory } from '../../utils/factory.js';
|
2
|
+
var name = 'matrixFromColumns';
|
3
|
+
var dependencies = ['typed', 'matrix', 'flatten', 'size'];
|
4
|
+
export var createMatrixFromColumns = /* #__PURE__ */factory(name, dependencies, _ref => {
|
5
|
+
var {
|
6
|
+
typed,
|
7
|
+
matrix,
|
8
|
+
flatten,
|
9
|
+
size
|
10
|
+
} = _ref;
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Create a dense matrix from vectors as individual columns.
|
14
|
+
* If you pass row vectors, they will be transposed (but not conjugated!)
|
15
|
+
*
|
16
|
+
* Syntax:
|
17
|
+
*
|
18
|
+
* math.matrixFromColumns(...arr)
|
19
|
+
* math.matrixFromColumns(col1, col2)
|
20
|
+
* math.matrixFromColumns(col1, col2, col3)
|
21
|
+
*
|
22
|
+
* Examples:
|
23
|
+
*
|
24
|
+
* math.matrixFromColumns([1, 2, 3], [[4],[5],[6]])
|
25
|
+
* math.matrixFromColumns(...vectors)
|
26
|
+
*
|
27
|
+
* See also:
|
28
|
+
*
|
29
|
+
* matrix, matrixFromRows, matrixFromFunction, zeros
|
30
|
+
*
|
31
|
+
* @param {... Array | Matrix} cols Multiple columns
|
32
|
+
* @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned
|
33
|
+
*/
|
34
|
+
return typed(name, {
|
35
|
+
'...Array': function Array(arr) {
|
36
|
+
return _createArray(arr);
|
37
|
+
},
|
38
|
+
'...Matrix': function Matrix(arr) {
|
39
|
+
return matrix(_createArray(arr.map(m => m.toArray())));
|
40
|
+
} // TODO implement this properly for SparseMatrix
|
41
|
+
|
42
|
+
});
|
43
|
+
|
44
|
+
function _createArray(arr) {
|
45
|
+
if (arr.length === 0) throw new TypeError('At least one column is needed to construct a matrix.');
|
46
|
+
var N = checkVectorTypeAndReturnLength(arr[0]); // create an array with empty rows
|
47
|
+
|
48
|
+
var result = [];
|
49
|
+
|
50
|
+
for (var i = 0; i < N; i++) {
|
51
|
+
result[i] = [];
|
52
|
+
} // loop columns
|
53
|
+
|
54
|
+
|
55
|
+
for (var col of arr) {
|
56
|
+
var colLength = checkVectorTypeAndReturnLength(col);
|
57
|
+
|
58
|
+
if (colLength !== N) {
|
59
|
+
throw new TypeError('The vectors had different length: ' + (N | 0) + ' ≠ ' + (colLength | 0));
|
60
|
+
}
|
61
|
+
|
62
|
+
var f = flatten(col); // push a value to each row
|
63
|
+
|
64
|
+
for (var _i = 0; _i < N; _i++) {
|
65
|
+
result[_i].push(f[_i]);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
return result;
|
70
|
+
}
|
71
|
+
|
72
|
+
function checkVectorTypeAndReturnLength(vec) {
|
73
|
+
var s = size(vec);
|
74
|
+
|
75
|
+
if (s.length === 1) {
|
76
|
+
// 1D vector
|
77
|
+
return s[0];
|
78
|
+
} else if (s.length === 2) {
|
79
|
+
// 2D vector
|
80
|
+
if (s[0] === 1) {
|
81
|
+
// row vector
|
82
|
+
return s[1];
|
83
|
+
} else if (s[1] === 1) {
|
84
|
+
// col vector
|
85
|
+
return s[0];
|
86
|
+
} else {
|
87
|
+
throw new TypeError('At least one of the arguments is not a vector.');
|
88
|
+
}
|
89
|
+
} else {
|
90
|
+
throw new TypeError('Only one- or two-dimensional vectors are supported.');
|
91
|
+
}
|
92
|
+
}
|
93
|
+
});
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import { factory } from '../../utils/factory.js';
|
2
|
+
var name = 'matrixFromFunction';
|
3
|
+
var dependencies = ['typed', 'matrix', 'isZero'];
|
4
|
+
export var createMatrixFromFunction = /* #__PURE__ */factory(name, dependencies, _ref => {
|
5
|
+
var {
|
6
|
+
typed,
|
7
|
+
matrix,
|
8
|
+
isZero
|
9
|
+
} = _ref;
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Create a matrix by evaluating a generating function at each index.
|
13
|
+
* The simplest overload returns a multi-dimensional array as long as `size` is an array.
|
14
|
+
* Passing `size` as a Matrix or specifying a `format` will result in returning a Matrix.
|
15
|
+
*
|
16
|
+
* Syntax:
|
17
|
+
*
|
18
|
+
* math.matrixFromFunction(size, fn)
|
19
|
+
* math.matrixFromFunction(size, fn, format)
|
20
|
+
* math.matrixFromFunction(size, fn, format, datatype)
|
21
|
+
* math.matrixFromFunction(size, format, fn)
|
22
|
+
* math.matrixFromFunction(size, format, datatype, fn)
|
23
|
+
*
|
24
|
+
* Examples:
|
25
|
+
*
|
26
|
+
* math.matrixFromFunction([3,3], i => i[0] - i[1]) // an antisymmetric matrix
|
27
|
+
* math.matrixFromFunction([100, 100], 'sparse', i => i[0] - i[1] === 1 ? 4 : 0) // a sparse subdiagonal matrix
|
28
|
+
* math.matrixFromFunction([5], i => math.random()) // a random vector
|
29
|
+
*
|
30
|
+
* See also:
|
31
|
+
*
|
32
|
+
* matrix, zeros
|
33
|
+
*
|
34
|
+
* @param {Array | Matrix} size The size of the matrix to be created
|
35
|
+
* @param {function} fn Callback function invoked for every entry in the matrix
|
36
|
+
* @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`
|
37
|
+
* @param {string} [datatype] Type of the values
|
38
|
+
* @return {Array | Matrix} Returns the created matrix
|
39
|
+
*/
|
40
|
+
return typed(name, {
|
41
|
+
'Array | Matrix, function, string, string': function ArrayMatrixFunctionStringString(size, fn, format, datatype) {
|
42
|
+
return _create(size, fn, format, datatype);
|
43
|
+
},
|
44
|
+
'Array | Matrix, function, string': function ArrayMatrixFunctionString(size, fn, format) {
|
45
|
+
return _create(size, fn, format);
|
46
|
+
},
|
47
|
+
'Matrix, function': function MatrixFunction(size, fn) {
|
48
|
+
return _create(size, fn, 'dense');
|
49
|
+
},
|
50
|
+
'Array, function': function ArrayFunction(size, fn) {
|
51
|
+
return _create(size, fn, 'dense').toArray();
|
52
|
+
},
|
53
|
+
'Array | Matrix, string, function': function ArrayMatrixStringFunction(size, format, fn) {
|
54
|
+
return _create(size, fn, format);
|
55
|
+
},
|
56
|
+
'Array | Matrix, string, string, function': function ArrayMatrixStringStringFunction(size, format, datatype, fn) {
|
57
|
+
return _create(size, fn, format, datatype);
|
58
|
+
}
|
59
|
+
});
|
60
|
+
|
61
|
+
function _create(size, fn, format, datatype) {
|
62
|
+
var m;
|
63
|
+
|
64
|
+
if (datatype !== undefined) {
|
65
|
+
m = matrix(format, datatype);
|
66
|
+
} else {
|
67
|
+
m = matrix(format);
|
68
|
+
}
|
69
|
+
|
70
|
+
m.resize(size);
|
71
|
+
m.forEach(function (_, index) {
|
72
|
+
var val = fn(index);
|
73
|
+
if (isZero(val)) return;
|
74
|
+
m.set(index, val);
|
75
|
+
});
|
76
|
+
return m;
|
77
|
+
}
|
78
|
+
});
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { factory } from '../../utils/factory.js';
|
2
|
+
var name = 'matrixFromRows';
|
3
|
+
var dependencies = ['typed', 'matrix', 'flatten', 'size'];
|
4
|
+
export var createMatrixFromRows = /* #__PURE__ */factory(name, dependencies, _ref => {
|
5
|
+
var {
|
6
|
+
typed,
|
7
|
+
matrix,
|
8
|
+
flatten,
|
9
|
+
size
|
10
|
+
} = _ref;
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Create a dense matrix from vectors as individual rows.
|
14
|
+
* If you pass column vectors, they will be transposed (but not conjugated!)
|
15
|
+
*
|
16
|
+
* Syntax:
|
17
|
+
*
|
18
|
+
* math.matrixFromRows(...arr)
|
19
|
+
* math.matrixFromRows(row1, row2)
|
20
|
+
* math.matrixFromRows(row1, row2, row3)
|
21
|
+
*
|
22
|
+
* Examples:
|
23
|
+
*
|
24
|
+
* math.matrixFromRows([1, 2, 3], [[4],[5],[6]])
|
25
|
+
* math.matrixFromRows(...vectors)
|
26
|
+
*
|
27
|
+
* See also:
|
28
|
+
*
|
29
|
+
* matrix, matrixFromColumns, matrixFromFunction, zeros
|
30
|
+
*
|
31
|
+
* @param {... Array | Matrix} rows Multiple rows
|
32
|
+
* @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned
|
33
|
+
*/
|
34
|
+
return typed(name, {
|
35
|
+
'...Array': function Array(arr) {
|
36
|
+
return _createArray(arr);
|
37
|
+
},
|
38
|
+
'...Matrix': function Matrix(arr) {
|
39
|
+
return matrix(_createArray(arr.map(m => m.toArray())));
|
40
|
+
} // TODO implement this properly for SparseMatrix
|
41
|
+
|
42
|
+
});
|
43
|
+
|
44
|
+
function _createArray(arr) {
|
45
|
+
if (arr.length === 0) throw new TypeError('At least one row is needed to construct a matrix.');
|
46
|
+
var N = checkVectorTypeAndReturnLength(arr[0]);
|
47
|
+
var result = [];
|
48
|
+
|
49
|
+
for (var row of arr) {
|
50
|
+
var rowLength = checkVectorTypeAndReturnLength(row);
|
51
|
+
|
52
|
+
if (rowLength !== N) {
|
53
|
+
throw new TypeError('The vectors had different length: ' + (N | 0) + ' ≠ ' + (rowLength | 0));
|
54
|
+
}
|
55
|
+
|
56
|
+
result.push(flatten(row));
|
57
|
+
}
|
58
|
+
|
59
|
+
return result;
|
60
|
+
}
|
61
|
+
|
62
|
+
function checkVectorTypeAndReturnLength(vec) {
|
63
|
+
var s = size(vec);
|
64
|
+
|
65
|
+
if (s.length === 1) {
|
66
|
+
// 1D vector
|
67
|
+
return s[0];
|
68
|
+
} else if (s.length === 2) {
|
69
|
+
// 2D vector
|
70
|
+
if (s[0] === 1) {
|
71
|
+
// row vector
|
72
|
+
return s[1];
|
73
|
+
} else if (s[1] === 1) {
|
74
|
+
// col vector
|
75
|
+
return s[0];
|
76
|
+
} else {
|
77
|
+
throw new TypeError('At least one of the arguments is not a vector.');
|
78
|
+
}
|
79
|
+
} else {
|
80
|
+
throw new TypeError('Only one- or two-dimensional vectors are supported.');
|
81
|
+
}
|
82
|
+
}
|
83
|
+
});
|
@@ -4,7 +4,7 @@ import { resize } from '../../utils/array.js';
|
|
4
4
|
import { factory } from '../../utils/factory.js';
|
5
5
|
var name = 'ones';
|
6
6
|
var dependencies = ['typed', 'config', 'matrix', 'BigNumber'];
|
7
|
-
export var createOnes = /* #__PURE__ */factory(name, dependencies,
|
7
|
+
export var createOnes = /* #__PURE__ */factory(name, dependencies, _ref => {
|
8
8
|
var {
|
9
9
|
typed,
|
10
10
|
config,
|
@@ -3,7 +3,7 @@ import { isInteger } from '../../utils/number.js';
|
|
3
3
|
import { factory } from '../../utils/factory.js';
|
4
4
|
var name = 'partitionSelect';
|
5
5
|
var dependencies = ['typed', 'isNumeric', 'isNaN', 'compare'];
|
6
|
-
export var createPartitionSelect = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createPartitionSelect = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed,
|
9
9
|
isNumeric,
|
@@ -2,7 +2,7 @@ import { factory } from '../../utils/factory.js';
|
|
2
2
|
import { noBignumber, noMatrix } from '../../utils/noop.js';
|
3
3
|
var name = 'range';
|
4
4
|
var dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq'];
|
5
|
-
export var createRange = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createRange = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed,
|
8
8
|
config,
|
@@ -2,7 +2,7 @@ import { reshape as arrayReshape } from '../../utils/array.js';
|
|
2
2
|
import { factory } from '../../utils/factory.js';
|
3
3
|
var name = 'reshape';
|
4
4
|
var dependencies = ['typed', 'isInteger', 'matrix'];
|
5
|
-
export var createReshape = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createReshape = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed,
|
8
8
|
isInteger
|
@@ -8,7 +8,7 @@ import { resize as arrayResize } from '../../utils/array.js';
|
|
8
8
|
import { factory } from '../../utils/factory.js';
|
9
9
|
var name = 'resize';
|
10
10
|
var dependencies = ['config', 'matrix'];
|
11
|
-
export var createResize = /* #__PURE__ */factory(name, dependencies,
|
11
|
+
export var createResize = /* #__PURE__ */factory(name, dependencies, _ref => {
|
12
12
|
var {
|
13
13
|
config,
|
14
14
|
matrix
|
@@ -2,7 +2,7 @@ import { factory } from '../../utils/factory.js';
|
|
2
2
|
import { arraySize } from '../../utils/array.js';
|
3
3
|
var name = 'rotate';
|
4
4
|
var dependencies = ['typed', 'multiply', 'rotationMatrix'];
|
5
|
-
export var createRotate = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createRotate = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed,
|
8
8
|
multiply,
|
@@ -2,7 +2,7 @@ import { isBigNumber } from '../../utils/is.js';
|
|
2
2
|
import { factory } from '../../utils/factory.js';
|
3
3
|
var name = 'rotationMatrix';
|
4
4
|
var dependencies = ['typed', 'config', 'multiplyScalar', 'addScalar', 'unaryMinus', 'norm', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix', 'cos', 'sin'];
|
5
|
-
export var createRotationMatrix = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createRotationMatrix = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed,
|
8
8
|
config,
|
@@ -3,7 +3,7 @@ import { clone } from '../../utils/object.js';
|
|
3
3
|
import { validateIndex } from '../../utils/array.js';
|
4
4
|
var name = 'row';
|
5
5
|
var dependencies = ['typed', 'Index', 'matrix', 'range'];
|
6
|
-
export var createRow = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createRow = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed,
|
9
9
|
Index,
|
@@ -3,7 +3,7 @@ import { factory } from '../../utils/factory.js';
|
|
3
3
|
import { noMatrix } from '../../utils/noop.js';
|
4
4
|
var name = 'size';
|
5
5
|
var dependencies = ['typed', 'config', '?matrix'];
|
6
|
-
export var createSize = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createSize = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed,
|
9
9
|
config,
|
@@ -2,7 +2,7 @@ import { arraySize as size } from '../../utils/array.js';
|
|
2
2
|
import { factory } from '../../utils/factory.js';
|
3
3
|
var name = 'sort';
|
4
4
|
var dependencies = ['typed', 'matrix', 'compare', 'compareNatural'];
|
5
|
-
export var createSort = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createSort = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed,
|
8
8
|
matrix,
|
@@ -4,7 +4,7 @@ import { arraySize } from '../../utils/array.js';
|
|
4
4
|
import { factory } from '../../utils/factory.js';
|
5
5
|
var name = 'sqrtm';
|
6
6
|
var dependencies = ['typed', 'abs', 'add', 'multiply', 'sqrt', 'subtract', 'inv', 'size', 'max', 'identity'];
|
7
|
-
export var createSqrtm = /* #__PURE__ */factory(name, dependencies,
|
7
|
+
export var createSqrtm = /* #__PURE__ */factory(name, dependencies, _ref => {
|
8
8
|
var {
|
9
9
|
typed,
|
10
10
|
abs,
|
@@ -3,7 +3,7 @@ import { squeeze as arraySqueeze } from '../../utils/array.js';
|
|
3
3
|
import { factory } from '../../utils/factory.js';
|
4
4
|
var name = 'squeeze';
|
5
5
|
var dependencies = ['typed', 'matrix'];
|
6
|
-
export var createSqueeze = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createSqueeze = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed,
|
9
9
|
matrix
|
@@ -6,7 +6,7 @@ import { DimensionError } from '../../error/DimensionError.js';
|
|
6
6
|
import { factory } from '../../utils/factory.js';
|
7
7
|
var name = 'subset';
|
8
8
|
var dependencies = ['typed', 'matrix'];
|
9
|
-
export var createSubset = /* #__PURE__ */factory(name, dependencies,
|
9
|
+
export var createSubset = /* #__PURE__ */factory(name, dependencies, _ref => {
|
10
10
|
var {
|
11
11
|
typed,
|
12
12
|
matrix
|
@@ -3,7 +3,7 @@ import { format } from '../../utils/string.js';
|
|
3
3
|
import { factory } from '../../utils/factory.js';
|
4
4
|
var name = 'trace';
|
5
5
|
var dependencies = ['typed', 'matrix', 'add'];
|
6
|
-
export var createTrace = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createTrace = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed,
|
9
9
|
matrix,
|
@@ -3,7 +3,7 @@ import { format } from '../../utils/string.js';
|
|
3
3
|
import { factory } from '../../utils/factory.js';
|
4
4
|
var name = 'transpose';
|
5
5
|
var dependencies = ['typed', 'matrix'];
|
6
|
-
export var createTranspose = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createTranspose = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed,
|
9
9
|
matrix
|
@@ -4,7 +4,7 @@ import { resize } from '../../utils/array.js';
|
|
4
4
|
import { factory } from '../../utils/factory.js';
|
5
5
|
var name = 'zeros';
|
6
6
|
var dependencies = ['typed', 'config', 'matrix', 'BigNumber'];
|
7
|
-
export var createZeros = /* #__PURE__ */factory(name, dependencies,
|
7
|
+
export var createZeros = /* #__PURE__ */factory(name, dependencies, _ref => {
|
8
8
|
var {
|
9
9
|
typed,
|
10
10
|
config,
|
@@ -2,7 +2,7 @@ import { factory } from '../../utils/factory.js';
|
|
2
2
|
import { combinationsNumber } from '../../plain/number/combinations.js';
|
3
3
|
var name = 'combinations';
|
4
4
|
var dependencies = ['typed'];
|
5
|
-
export var createCombinations = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createCombinations = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed
|
8
8
|
} = _ref;
|
@@ -3,7 +3,7 @@ import { isInteger } from '../../utils/number.js';
|
|
3
3
|
import { product } from '../../utils/product.js';
|
4
4
|
var name = 'combinationsWithRep';
|
5
5
|
var dependencies = ['typed'];
|
6
|
-
export var createCombinationsWithRep = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createCombinationsWithRep = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed
|
9
9
|
} = _ref;
|
@@ -2,7 +2,7 @@ import { deepMap } from '../../utils/collection.js';
|
|
2
2
|
import { factory } from '../../utils/factory.js';
|
3
3
|
var name = 'factorial';
|
4
4
|
var dependencies = ['typed', 'gamma'];
|
5
|
-
export var createFactorial = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createFactorial = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed,
|
8
8
|
gamma
|
@@ -3,7 +3,7 @@ import { factory } from '../../utils/factory.js';
|
|
3
3
|
import { gammaG, gammaNumber, gammaP } from '../../plain/number/index.js';
|
4
4
|
var name = 'gamma';
|
5
5
|
var dependencies = ['typed', 'config', 'multiplyScalar', 'pow', 'BigNumber', 'Complex'];
|
6
|
-
export var createGamma = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createGamma = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed,
|
9
9
|
config,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { factory } from '../../utils/factory.js';
|
2
2
|
var name = 'kldivergence';
|
3
3
|
var dependencies = ['typed', 'matrix', 'divide', 'sum', 'multiply', 'dotDivide', 'log', 'isNumeric'];
|
4
|
-
export var createKldivergence = /* #__PURE__ */factory(name, dependencies,
|
4
|
+
export var createKldivergence = /* #__PURE__ */factory(name, dependencies, _ref => {
|
5
5
|
var {
|
6
6
|
typed,
|
7
7
|
matrix,
|
@@ -2,7 +2,7 @@ import { deepForEach } from '../../utils/collection.js';
|
|
2
2
|
import { factory } from '../../utils/factory.js';
|
3
3
|
var name = 'multinomial';
|
4
4
|
var dependencies = ['typed', 'add', 'divide', 'multiply', 'factorial', 'isInteger', 'isPositive'];
|
5
|
-
export var createMultinomial = /* #__PURE__ */factory(name, dependencies,
|
5
|
+
export var createMultinomial = /* #__PURE__ */factory(name, dependencies, _ref => {
|
6
6
|
var {
|
7
7
|
typed,
|
8
8
|
add,
|
@@ -3,7 +3,7 @@ import { product } from '../../utils/product.js';
|
|
3
3
|
import { factory } from '../../utils/factory.js';
|
4
4
|
var name = 'permutations';
|
5
5
|
var dependencies = ['typed', 'factorial'];
|
6
|
-
export var createPermutations = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createPermutations = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed,
|
9
9
|
factorial
|
@@ -4,7 +4,7 @@ import { isMatrix, isNumber } from '../../utils/is.js';
|
|
4
4
|
import { createRng } from './util/seededRNG.js';
|
5
5
|
var name = 'pickRandom';
|
6
6
|
var dependencies = ['typed', 'config', '?on'];
|
7
|
-
export var createPickRandom = /* #__PURE__ */factory(name, dependencies,
|
7
|
+
export var createPickRandom = /* #__PURE__ */factory(name, dependencies, _ref => {
|
8
8
|
var {
|
9
9
|
typed,
|
10
10
|
config,
|
@@ -57,7 +57,7 @@ export var createPickRandom = /* #__PURE__ */factory(name, dependencies, (_ref)
|
|
57
57
|
*/
|
58
58
|
|
59
59
|
|
60
|
-
return typed({
|
60
|
+
return typed(name, {
|
61
61
|
'Array | Matrix': function ArrayMatrix(possibles) {
|
62
62
|
return _pickRandom(possibles, {});
|
63
63
|
},
|
@@ -4,7 +4,7 @@ import { createRng } from './util/seededRNG.js';
|
|
4
4
|
import { randomMatrix } from './util/randomMatrix.js';
|
5
5
|
var name = 'random';
|
6
6
|
var dependencies = ['typed', 'config', '?on'];
|
7
|
-
export var createRandom = /* #__PURE__ */factory(name, dependencies,
|
7
|
+
export var createRandom = /* #__PURE__ */factory(name, dependencies, _ref => {
|
8
8
|
var {
|
9
9
|
typed,
|
10
10
|
config,
|
@@ -72,7 +72,7 @@ export var createRandom = /* #__PURE__ */factory(name, dependencies, (_ref) => {
|
|
72
72
|
}); // number only implementation of random, no matrix support
|
73
73
|
// TODO: there is quite some duplicate code in both createRandom and createRandomNumber, can we improve that?
|
74
74
|
|
75
|
-
export var createRandomNumber = /* #__PURE__ */factory(name, ['typed', 'config', '?on'],
|
75
|
+
export var createRandomNumber = /* #__PURE__ */factory(name, ['typed', 'config', '?on'], _ref2 => {
|
76
76
|
var {
|
77
77
|
typed,
|
78
78
|
config,
|
@@ -4,7 +4,7 @@ import { createRng } from './util/seededRNG.js';
|
|
4
4
|
import { isMatrix } from '../../utils/is.js';
|
5
5
|
var name = 'randomInt';
|
6
6
|
var dependencies = ['typed', 'config', '?on'];
|
7
|
-
export var createRandomInt = /* #__PURE__ */factory(name, dependencies,
|
7
|
+
export var createRandomInt = /* #__PURE__ */factory(name, dependencies, _ref => {
|
8
8
|
var {
|
9
9
|
typed,
|
10
10
|
config,
|
@@ -8,7 +8,7 @@ import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js';
|
|
8
8
|
import { createAlgorithm05 } from '../../type/matrix/utils/algorithm05.js';
|
9
9
|
var name = 'compare';
|
10
10
|
var dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'BigNumber', 'Fraction', 'DenseMatrix'];
|
11
|
-
export var createCompare = /* #__PURE__ */factory(name, dependencies,
|
11
|
+
export var createCompare = /* #__PURE__ */factory(name, dependencies, _ref => {
|
12
12
|
var {
|
13
13
|
typed,
|
14
14
|
config,
|
@@ -142,7 +142,7 @@ export var createCompare = /* #__PURE__ */factory(name, dependencies, (_ref) =>
|
|
142
142
|
}
|
143
143
|
});
|
144
144
|
});
|
145
|
-
export var createCompareNumber = /* #__PURE__ */factory(name, ['typed', 'config'],
|
145
|
+
export var createCompareNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {
|
146
146
|
var {
|
147
147
|
typed,
|
148
148
|
config
|
@@ -3,7 +3,7 @@ import { isDenseMatrix, isSparseMatrix, typeOf } from '../../utils/is.js';
|
|
3
3
|
import { factory } from '../../utils/factory.js';
|
4
4
|
var name = 'compareNatural';
|
5
5
|
var dependencies = ['typed', 'compare'];
|
6
|
-
export var createCompareNatural = /* #__PURE__ */factory(name, dependencies,
|
6
|
+
export var createCompareNatural = /* #__PURE__ */factory(name, dependencies, _ref => {
|
7
7
|
var {
|
8
8
|
typed,
|
9
9
|
compare
|
@@ -4,7 +4,7 @@ import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js';
|
|
4
4
|
import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js';
|
5
5
|
var name = 'compareText';
|
6
6
|
var dependencies = ['typed', 'matrix'];
|
7
|
-
export var createCompareText = /* #__PURE__ */factory(name, dependencies,
|
7
|
+
export var createCompareText = /* #__PURE__ */factory(name, dependencies, _ref => {
|
8
8
|
var {
|
9
9
|
typed,
|
10
10
|
matrix
|
@@ -77,7 +77,7 @@ export var createCompareText = /* #__PURE__ */factory(name, dependencies, (_ref)
|
|
77
77
|
}
|
78
78
|
});
|
79
79
|
});
|
80
|
-
export var createCompareTextNumber = /* #__PURE__ */factory(name, ['typed'],
|
80
|
+
export var createCompareTextNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => {
|
81
81
|
var {
|
82
82
|
typed
|
83
83
|
} = _ref2;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { factory } from '../../utils/factory.js';
|
2
2
|
var name = 'deepEqual';
|
3
3
|
var dependencies = ['typed', 'equal'];
|
4
|
-
export var createDeepEqual = /* #__PURE__ */factory(name, dependencies,
|
4
|
+
export var createDeepEqual = /* #__PURE__ */factory(name, dependencies, _ref => {
|
5
5
|
var {
|
6
6
|
typed,
|
7
7
|
equal
|
@@ -6,7 +6,7 @@ import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js';
|
|
6
6
|
import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js';
|
7
7
|
var name = 'equal';
|
8
8
|
var dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix'];
|
9
|
-
export var createEqual = /* #__PURE__ */factory(name, dependencies,
|
9
|
+
export var createEqual = /* #__PURE__ */factory(name, dependencies, _ref => {
|
10
10
|
var {
|
11
11
|
typed,
|
12
12
|
matrix,
|
@@ -142,7 +142,7 @@ export var createEqual = /* #__PURE__ */factory(name, dependencies, (_ref) => {
|
|
142
142
|
}
|
143
143
|
});
|
144
144
|
});
|
145
|
-
export var createEqualNumber = factory(name, ['typed', 'equalScalar'],
|
145
|
+
export var createEqualNumber = factory(name, ['typed', 'equalScalar'], _ref2 => {
|
146
146
|
var {
|
147
147
|
typed,
|
148
148
|
equalScalar
|