@danielsimonjr/mathts-functions 0.2.3 → 0.2.4
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/dist/algebra/decomposition/lup.d.ts +78 -0
- package/dist/algebra/decomposition/lup.d.ts.map +1 -0
- package/dist/algebra/decomposition/qr.d.ts +60 -0
- package/dist/algebra/decomposition/qr.d.ts.map +1 -0
- package/dist/algebra/decomposition/schur.d.ts +40 -0
- package/dist/algebra/decomposition/schur.d.ts.map +1 -0
- package/dist/algebra/decomposition/slu.d.ts +37 -0
- package/dist/algebra/decomposition/slu.d.ts.map +1 -0
- package/dist/algebra/derivative.d.ts +35 -0
- package/dist/algebra/derivative.d.ts.map +1 -0
- package/dist/algebra/leafCount.d.ts +9 -0
- package/dist/algebra/leafCount.d.ts.map +1 -0
- package/dist/algebra/lyap.d.ts +14 -0
- package/dist/algebra/lyap.d.ts.map +1 -0
- package/dist/algebra/polynomialRoot.d.ts +22 -0
- package/dist/algebra/polynomialRoot.d.ts.map +1 -0
- package/dist/algebra/rationalize.d.ts +43 -0
- package/dist/algebra/rationalize.d.ts.map +1 -0
- package/dist/algebra/resolve.d.ts +25 -0
- package/dist/algebra/resolve.d.ts.map +1 -0
- package/dist/algebra/simplify/util.d.ts +35 -0
- package/dist/algebra/simplify/util.d.ts.map +1 -0
- package/dist/algebra/simplify/wildcards.d.ts +5 -0
- package/dist/algebra/simplify/wildcards.d.ts.map +1 -0
- package/dist/algebra/simplify.d.ts +57 -0
- package/dist/algebra/simplify.d.ts.map +1 -0
- package/dist/algebra/simplifyConstant.d.ts +20 -0
- package/dist/algebra/simplifyConstant.d.ts.map +1 -0
- package/dist/algebra/simplifyCore.d.ts +21 -0
- package/dist/algebra/simplifyCore.d.ts.map +1 -0
- package/dist/algebra/solver/lsolve.d.ts +46 -0
- package/dist/algebra/solver/lsolve.d.ts.map +1 -0
- package/dist/algebra/solver/lsolveAll.d.ts +53 -0
- package/dist/algebra/solver/lsolveAll.d.ts.map +1 -0
- package/dist/algebra/solver/lusolve.d.ts +62 -0
- package/dist/algebra/solver/lusolve.d.ts.map +1 -0
- package/dist/algebra/solver/usolve.d.ts +46 -0
- package/dist/algebra/solver/usolve.d.ts.map +1 -0
- package/dist/algebra/solver/usolveAll.d.ts +53 -0
- package/dist/algebra/solver/usolveAll.d.ts.map +1 -0
- package/dist/algebra/solver/utils/solveValidation.d.ts +31 -0
- package/dist/algebra/solver/utils/solveValidation.d.ts.map +1 -0
- package/dist/algebra/sparse/csAmd.d.ts +15 -0
- package/dist/algebra/sparse/csAmd.d.ts.map +1 -0
- package/dist/algebra/sparse/csChol.d.ts +39 -0
- package/dist/algebra/sparse/csChol.d.ts.map +1 -0
- package/dist/algebra/sparse/csCounts.d.ts +13 -0
- package/dist/algebra/sparse/csCounts.d.ts.map +1 -0
- package/dist/algebra/sparse/csCumsum.d.ts +9 -0
- package/dist/algebra/sparse/csCumsum.d.ts.map +1 -0
- package/dist/algebra/sparse/csDfs.d.ts +23 -0
- package/dist/algebra/sparse/csDfs.d.ts.map +1 -0
- package/dist/algebra/sparse/csEreach.d.ts +20 -0
- package/dist/algebra/sparse/csEreach.d.ts.map +1 -0
- package/dist/algebra/sparse/csEtree.d.ts +16 -0
- package/dist/algebra/sparse/csEtree.d.ts.map +1 -0
- package/dist/algebra/sparse/csFkeep.d.ts +22 -0
- package/dist/algebra/sparse/csFkeep.d.ts.map +1 -0
- package/dist/algebra/sparse/csFlip.d.ts +7 -0
- package/dist/algebra/sparse/csFlip.d.ts.map +1 -0
- package/dist/algebra/sparse/csIpvec.d.ts +10 -0
- package/dist/algebra/sparse/csIpvec.d.ts.map +1 -0
- package/dist/algebra/sparse/csLeaf.d.ts +21 -0
- package/dist/algebra/sparse/csLeaf.d.ts.map +1 -0
- package/dist/algebra/sparse/csLu.d.ts +37 -0
- package/dist/algebra/sparse/csLu.d.ts.map +1 -0
- package/dist/algebra/sparse/csMark.d.ts +8 -0
- package/dist/algebra/sparse/csMark.d.ts.map +1 -0
- package/dist/algebra/sparse/csMarked.d.ts +8 -0
- package/dist/algebra/sparse/csMarked.d.ts.map +1 -0
- package/dist/algebra/sparse/csPermute.d.ts +27 -0
- package/dist/algebra/sparse/csPermute.d.ts.map +1 -0
- package/dist/algebra/sparse/csPost.d.ts +8 -0
- package/dist/algebra/sparse/csPost.d.ts.map +1 -0
- package/dist/algebra/sparse/csReach.d.ts +23 -0
- package/dist/algebra/sparse/csReach.d.ts.map +1 -0
- package/dist/algebra/sparse/csSpsolve.d.ts +15 -0
- package/dist/algebra/sparse/csSpsolve.d.ts.map +1 -0
- package/dist/algebra/sparse/csSqr.d.ts +25 -0
- package/dist/algebra/sparse/csSqr.d.ts.map +1 -0
- package/dist/algebra/sparse/csSymperm.d.ts +22 -0
- package/dist/algebra/sparse/csSymperm.d.ts.map +1 -0
- package/dist/algebra/sparse/csTdfs.d.ts +13 -0
- package/dist/algebra/sparse/csTdfs.d.ts.map +1 -0
- package/dist/algebra/sparse/csUnflip.d.ts +7 -0
- package/dist/algebra/sparse/csUnflip.d.ts.map +1 -0
- package/dist/algebra/sylvester.d.ts +30 -0
- package/dist/algebra/sylvester.d.ts.map +1 -0
- package/dist/algebra/symbolicEqual.d.ts +18 -0
- package/dist/algebra/symbolicEqual.d.ts.map +1 -0
- package/dist/arithmetic/abs.d.ts +7 -0
- package/dist/arithmetic/abs.d.ts.map +1 -0
- package/dist/arithmetic/addScalar.d.ts +7 -0
- package/dist/arithmetic/addScalar.d.ts.map +1 -0
- package/dist/arithmetic/cbrt.d.ts +37 -0
- package/dist/arithmetic/cbrt.d.ts.map +1 -0
- package/dist/arithmetic/ceil.d.ts +22 -0
- package/dist/arithmetic/ceil.d.ts.map +1 -0
- package/dist/arithmetic/cube.d.ts +7 -0
- package/dist/arithmetic/cube.d.ts.map +1 -0
- package/dist/arithmetic/divide.d.ts +42 -0
- package/dist/arithmetic/divide.d.ts.map +1 -0
- package/dist/arithmetic/divideScalar.d.ts +8 -0
- package/dist/arithmetic/divideScalar.d.ts.map +1 -0
- package/dist/arithmetic/dotDivide.d.ts +13 -0
- package/dist/arithmetic/dotDivide.d.ts.map +1 -0
- package/dist/arithmetic/dotMultiply.d.ts +11 -0
- package/dist/arithmetic/dotMultiply.d.ts.map +1 -0
- package/dist/arithmetic/dotPow.d.ts +16 -0
- package/dist/arithmetic/dotPow.d.ts.map +1 -0
- package/dist/arithmetic/exp.d.ts +7 -0
- package/dist/arithmetic/exp.d.ts.map +1 -0
- package/dist/arithmetic/expm1.d.ts +15 -0
- package/dist/arithmetic/expm1.d.ts.map +1 -0
- package/dist/arithmetic/fix.d.ts +30 -0
- package/dist/arithmetic/fix.d.ts.map +1 -0
- package/dist/arithmetic/floor.d.ts +22 -0
- package/dist/arithmetic/floor.d.ts.map +1 -0
- package/dist/arithmetic/gcd.d.ts +25 -0
- package/dist/arithmetic/gcd.d.ts.map +1 -0
- package/dist/arithmetic/hypot.d.ts +14 -0
- package/dist/arithmetic/hypot.d.ts.map +1 -0
- package/dist/arithmetic/invmod.d.ts +19 -0
- package/dist/arithmetic/invmod.d.ts.map +1 -0
- package/dist/arithmetic/lcm.d.ts +10 -0
- package/dist/arithmetic/lcm.d.ts.map +1 -0
- package/dist/arithmetic/log.d.ts +18 -0
- package/dist/arithmetic/log.d.ts.map +1 -0
- package/dist/arithmetic/log10.d.ts +18 -0
- package/dist/arithmetic/log10.d.ts.map +1 -0
- package/dist/arithmetic/log1p.d.ts +19 -0
- package/dist/arithmetic/log1p.d.ts.map +1 -0
- package/dist/arithmetic/log2.d.ts +17 -0
- package/dist/arithmetic/log2.d.ts.map +1 -0
- package/dist/arithmetic/mod.d.ts +15 -0
- package/dist/arithmetic/mod.d.ts.map +1 -0
- package/dist/arithmetic/multiplyScalar.d.ts +7 -0
- package/dist/arithmetic/multiplyScalar.d.ts.map +1 -0
- package/dist/arithmetic/norm.d.ts +33 -0
- package/dist/arithmetic/norm.d.ts.map +1 -0
- package/dist/arithmetic/nthRoot.d.ts +38 -0
- package/dist/arithmetic/nthRoot.d.ts.map +1 -0
- package/dist/arithmetic/nthRoots.d.ts +23 -0
- package/dist/arithmetic/nthRoots.d.ts.map +1 -0
- package/dist/arithmetic/pow.d.ts +34 -0
- package/dist/arithmetic/pow.d.ts.map +1 -0
- package/dist/arithmetic/round.d.ts +27 -0
- package/dist/arithmetic/round.d.ts.map +1 -0
- package/dist/arithmetic/sign.d.ts +31 -0
- package/dist/arithmetic/sign.d.ts.map +1 -0
- package/dist/arithmetic/sqrt.d.ts +16 -0
- package/dist/arithmetic/sqrt.d.ts.map +1 -0
- package/dist/arithmetic/square.d.ts +7 -0
- package/dist/arithmetic/square.d.ts.map +1 -0
- package/dist/arithmetic/subtract.d.ts +18 -0
- package/dist/arithmetic/subtract.d.ts.map +1 -0
- package/dist/arithmetic/subtractScalar.d.ts +7 -0
- package/dist/arithmetic/subtractScalar.d.ts.map +1 -0
- package/dist/arithmetic/unaryMinus.d.ts +10 -0
- package/dist/arithmetic/unaryMinus.d.ts.map +1 -0
- package/dist/arithmetic/unaryPlus.d.ts +10 -0
- package/dist/arithmetic/unaryPlus.d.ts.map +1 -0
- package/dist/arithmetic/utils/nodeOperations.d.ts +37 -0
- package/dist/arithmetic/utils/nodeOperations.d.ts.map +1 -0
- package/dist/arithmetic/xgcd.d.ts +25 -0
- package/dist/arithmetic/xgcd.d.ts.map +1 -0
- package/dist/bitwise/bitAnd.d.ts +10 -0
- package/dist/bitwise/bitAnd.d.ts.map +1 -0
- package/dist/bitwise/bitNot.d.ts +7 -0
- package/dist/bitwise/bitNot.d.ts.map +1 -0
- package/dist/bitwise/bitOr.d.ts +11 -0
- package/dist/bitwise/bitOr.d.ts.map +1 -0
- package/dist/bitwise/bitXor.d.ts +11 -0
- package/dist/bitwise/bitXor.d.ts.map +1 -0
- package/dist/bitwise/leftShift.d.ts +17 -0
- package/dist/bitwise/leftShift.d.ts.map +1 -0
- package/dist/bitwise/rightArithShift.d.ts +17 -0
- package/dist/bitwise/rightArithShift.d.ts.map +1 -0
- package/dist/bitwise/rightLogShift.d.ts +17 -0
- package/dist/bitwise/rightLogShift.d.ts.map +1 -0
- package/dist/bitwise/useMatrixForArrayScalar.d.ts +19 -0
- package/dist/bitwise/useMatrixForArrayScalar.d.ts.map +1 -0
- package/dist/combinatorics/bellNumbers.d.ts +14 -0
- package/dist/combinatorics/bellNumbers.d.ts.map +1 -0
- package/dist/combinatorics/catalan.d.ts +16 -0
- package/dist/combinatorics/catalan.d.ts.map +1 -0
- package/dist/combinatorics/composition.d.ts +16 -0
- package/dist/combinatorics/composition.d.ts.map +1 -0
- package/dist/combinatorics/stirlingS2.d.ts +22 -0
- package/dist/combinatorics/stirlingS2.d.ts.map +1 -0
- package/dist/complex/arg.d.ts +7 -0
- package/dist/complex/arg.d.ts.map +1 -0
- package/dist/complex/conj.d.ts +7 -0
- package/dist/complex/conj.d.ts.map +1 -0
- package/dist/complex/im.d.ts +7 -0
- package/dist/complex/im.d.ts.map +1 -0
- package/dist/complex/re.d.ts +7 -0
- package/dist/complex/re.d.ts.map +1 -0
- package/dist/core/config.d.ts +17 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/create.d.ts +137 -0
- package/dist/core/create.d.ts.map +1 -0
- package/dist/core/function/config.d.ts +35 -0
- package/dist/core/function/config.d.ts.map +1 -0
- package/dist/core/function/import.d.ts +30 -0
- package/dist/core/function/import.d.ts.map +1 -0
- package/dist/core/function/typed.d.ts +127 -0
- package/dist/core/function/typed.d.ts.map +1 -0
- package/dist/error/ArgumentsError.d.ts +21 -0
- package/dist/error/ArgumentsError.d.ts.map +1 -0
- package/dist/error/DimensionError.d.ts +18 -0
- package/dist/error/DimensionError.d.ts.map +1 -0
- package/dist/error/IndexError.d.ts +24 -0
- package/dist/error/IndexError.d.ts.map +1 -0
- package/dist/error/MathjsError.d.ts +13 -0
- package/dist/error/MathjsError.d.ts.map +1 -0
- package/dist/expression/operators.d.ts +942 -0
- package/dist/expression/operators.d.ts.map +1 -0
- package/dist/factories/evaluate.d.ts +91 -0
- package/dist/factories/evaluate.d.ts.map +1 -0
- package/dist/factories/index.d.ts +317 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories/matrix-bridge.d.ts +241 -0
- package/dist/factories/matrix-bridge.d.ts.map +1 -0
- package/dist/factories/scope.d.ts +12 -0
- package/dist/factories/scope.d.ts.map +1 -0
- package/dist/geometry/distance.d.ts +15 -0
- package/dist/geometry/distance.d.ts.map +1 -0
- package/dist/geometry/intersect.d.ts +26 -0
- package/dist/geometry/intersect.d.ts.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/logical/and.d.ts +17 -0
- package/dist/logical/and.d.ts.map +1 -0
- package/dist/logical/not.d.ts +7 -0
- package/dist/logical/not.d.ts.map +1 -0
- package/dist/logical/nullish.d.ts +11 -0
- package/dist/logical/nullish.d.ts.map +1 -0
- package/dist/logical/or.d.ts +15 -0
- package/dist/logical/or.d.ts.map +1 -0
- package/dist/logical/xor.d.ts +15 -0
- package/dist/logical/xor.d.ts.map +1 -0
- package/dist/matrix/column.d.ts +22 -0
- package/dist/matrix/column.d.ts.map +1 -0
- package/dist/matrix/concat.d.ts +6 -0
- package/dist/matrix/concat.d.ts.map +1 -0
- package/dist/matrix/count.d.ts +9 -0
- package/dist/matrix/count.d.ts.map +1 -0
- package/dist/matrix/cross.d.ts +7 -0
- package/dist/matrix/cross.d.ts.map +1 -0
- package/dist/matrix/ctranspose.d.ts +9 -0
- package/dist/matrix/ctranspose.d.ts.map +1 -0
- package/dist/matrix/det.d.ts +42 -0
- package/dist/matrix/det.d.ts.map +1 -0
- package/dist/matrix/diag.d.ts +26 -0
- package/dist/matrix/diag.d.ts.map +1 -0
- package/dist/matrix/diff.d.ts +8 -0
- package/dist/matrix/diff.d.ts.map +1 -0
- package/dist/matrix/dot.d.ts +17 -0
- package/dist/matrix/dot.d.ts.map +1 -0
- package/dist/matrix/eigs/complexEigs.d.ts +48 -0
- package/dist/matrix/eigs/complexEigs.d.ts.map +1 -0
- package/dist/matrix/eigs/realSymmetric.d.ts +34 -0
- package/dist/matrix/eigs/realSymmetric.d.ts.map +1 -0
- package/dist/matrix/eigs.d.ts +75 -0
- package/dist/matrix/eigs.d.ts.map +1 -0
- package/dist/matrix/expm.d.ts +26 -0
- package/dist/matrix/expm.d.ts.map +1 -0
- package/dist/matrix/fft.d.ts +41 -0
- package/dist/matrix/fft.d.ts.map +1 -0
- package/dist/matrix/filter.d.ts +7 -0
- package/dist/matrix/filter.d.ts.map +1 -0
- package/dist/matrix/flatten.d.ts +7 -0
- package/dist/matrix/flatten.d.ts.map +1 -0
- package/dist/matrix/forEach.d.ts +7 -0
- package/dist/matrix/forEach.d.ts.map +1 -0
- package/dist/matrix/getMatrixDataType.d.ts +7 -0
- package/dist/matrix/getMatrixDataType.d.ts.map +1 -0
- package/dist/matrix/identity.d.ts +41 -0
- package/dist/matrix/identity.d.ts.map +1 -0
- package/dist/matrix/ifft.d.ts +33 -0
- package/dist/matrix/ifft.d.ts.map +1 -0
- package/dist/matrix/inv.d.ts +48 -0
- package/dist/matrix/inv.d.ts.map +1 -0
- package/dist/matrix/kron.d.ts +17 -0
- package/dist/matrix/kron.d.ts.map +1 -0
- package/dist/matrix/map.d.ts +7 -0
- package/dist/matrix/map.d.ts.map +1 -0
- package/dist/matrix/mapSlices.d.ts +6 -0
- package/dist/matrix/mapSlices.d.ts.map +1 -0
- package/dist/matrix/matrixFromColumns.d.ts +36 -0
- package/dist/matrix/matrixFromColumns.d.ts.map +1 -0
- package/dist/matrix/matrixFromFunction.d.ts +7 -0
- package/dist/matrix/matrixFromFunction.d.ts.map +1 -0
- package/dist/matrix/matrixFromRows.d.ts +36 -0
- package/dist/matrix/matrixFromRows.d.ts.map +1 -0
- package/dist/matrix/ones.d.ts +3 -0
- package/dist/matrix/ones.d.ts.map +1 -0
- package/dist/matrix/partitionSelect.d.ts +13 -0
- package/dist/matrix/partitionSelect.d.ts.map +1 -0
- package/dist/matrix/pinv.d.ts +51 -0
- package/dist/matrix/pinv.d.ts.map +1 -0
- package/dist/matrix/range.d.ts +27 -0
- package/dist/matrix/range.d.ts.map +1 -0
- package/dist/matrix/reshape.d.ts +8 -0
- package/dist/matrix/reshape.d.ts.map +1 -0
- package/dist/matrix/resize.d.ts +17 -0
- package/dist/matrix/resize.d.ts.map +1 -0
- package/dist/matrix/rotate.d.ts +7 -0
- package/dist/matrix/rotate.d.ts.map +1 -0
- package/dist/matrix/rotationMatrix.d.ts +17 -0
- package/dist/matrix/rotationMatrix.d.ts.map +1 -0
- package/dist/matrix/row.d.ts +22 -0
- package/dist/matrix/row.d.ts.map +1 -0
- package/dist/matrix/size.d.ts +9 -0
- package/dist/matrix/size.d.ts.map +1 -0
- package/dist/matrix/sort.d.ts +8 -0
- package/dist/matrix/sort.d.ts.map +1 -0
- package/dist/matrix/sqrtm.d.ts +33 -0
- package/dist/matrix/sqrtm.d.ts.map +1 -0
- package/dist/matrix/squeeze.d.ts +7 -0
- package/dist/matrix/squeeze.d.ts.map +1 -0
- package/dist/matrix/subset.d.ts +7 -0
- package/dist/matrix/subset.d.ts.map +1 -0
- package/dist/matrix/trace.d.ts +25 -0
- package/dist/matrix/trace.d.ts.map +1 -0
- package/dist/matrix/transpose.d.ts +45 -0
- package/dist/matrix/transpose.d.ts.map +1 -0
- package/dist/matrix/utils/zerosAndOnes.d.ts +32 -0
- package/dist/matrix/utils/zerosAndOnes.d.ts.map +1 -0
- package/dist/matrix/zeros.d.ts +3 -0
- package/dist/matrix/zeros.d.ts.map +1 -0
- package/dist/numeric/solveODE.d.ts +2 -0
- package/dist/numeric/solveODE.d.ts.map +1 -0
- package/dist/plain/number/arithmetic.d.ts +168 -0
- package/dist/plain/number/arithmetic.d.ts.map +1 -0
- package/dist/plain/number/bitwise.d.ts +29 -0
- package/dist/plain/number/bitwise.d.ts.map +1 -0
- package/dist/plain/number/combinations.d.ts +5 -0
- package/dist/plain/number/combinations.d.ts.map +1 -0
- package/dist/plain/number/constants.d.ts +5 -0
- package/dist/plain/number/constants.d.ts.map +1 -0
- package/dist/plain/number/index.d.ts +10 -0
- package/dist/plain/number/index.d.ts.map +1 -0
- package/dist/plain/number/logical.d.ts +17 -0
- package/dist/plain/number/logical.d.ts.map +1 -0
- package/dist/plain/number/probability.d.ts +15 -0
- package/dist/plain/number/probability.d.ts.map +1 -0
- package/dist/plain/number/relational.d.ts +29 -0
- package/dist/plain/number/relational.d.ts.map +1 -0
- package/dist/plain/number/trigonometry.d.ts +101 -0
- package/dist/plain/number/trigonometry.d.ts.map +1 -0
- package/dist/plain/number/utils.d.ts +21 -0
- package/dist/plain/number/utils.d.ts.map +1 -0
- package/dist/probability/bernoulli.d.ts +19 -0
- package/dist/probability/bernoulli.d.ts.map +1 -0
- package/dist/probability/combinations.d.ts +7 -0
- package/dist/probability/combinations.d.ts.map +1 -0
- package/dist/probability/combinationsWithRep.d.ts +7 -0
- package/dist/probability/combinationsWithRep.d.ts.map +1 -0
- package/dist/probability/factorial.d.ts +8 -0
- package/dist/probability/factorial.d.ts.map +1 -0
- package/dist/probability/gamma.d.ts +45 -0
- package/dist/probability/gamma.d.ts.map +1 -0
- package/dist/probability/kldivergence.d.ts +18 -0
- package/dist/probability/kldivergence.d.ts.map +1 -0
- package/dist/probability/lgamma.d.ts +24 -0
- package/dist/probability/lgamma.d.ts.map +1 -0
- package/dist/probability/multinomial.d.ts +13 -0
- package/dist/probability/multinomial.d.ts.map +1 -0
- package/dist/probability/permutations.d.ts +8 -0
- package/dist/probability/permutations.d.ts.map +1 -0
- package/dist/probability/pickRandom.d.ts +10 -0
- package/dist/probability/pickRandom.d.ts.map +1 -0
- package/dist/probability/random.d.ts +11 -0
- package/dist/probability/random.d.ts.map +1 -0
- package/dist/probability/randomInt.d.ts +11 -0
- package/dist/probability/randomInt.d.ts.map +1 -0
- package/dist/probability/util/randomMatrix.d.ts +10 -0
- package/dist/probability/util/randomMatrix.d.ts.map +1 -0
- package/dist/probability/util/seededRNG.d.ts +4 -0
- package/dist/probability/util/seededRNG.d.ts.map +1 -0
- package/dist/relational/compare.d.ts +38 -0
- package/dist/relational/compare.d.ts.map +1 -0
- package/dist/relational/compareNatural.d.ts +8 -0
- package/dist/relational/compareNatural.d.ts.map +1 -0
- package/dist/relational/compareText.d.ts +15 -0
- package/dist/relational/compareText.d.ts.map +1 -0
- package/dist/relational/compareUnits.d.ts +9 -0
- package/dist/relational/compareUnits.d.ts.map +1 -0
- package/dist/relational/deepEqual.d.ts +8 -0
- package/dist/relational/deepEqual.d.ts.map +1 -0
- package/dist/relational/equal.d.ts +26 -0
- package/dist/relational/equal.d.ts.map +1 -0
- package/dist/relational/equalScalar.d.ts +11 -0
- package/dist/relational/equalScalar.d.ts.map +1 -0
- package/dist/relational/equalText.d.ts +9 -0
- package/dist/relational/equalText.d.ts.map +1 -0
- package/dist/relational/larger.d.ts +34 -0
- package/dist/relational/larger.d.ts.map +1 -0
- package/dist/relational/largerEq.d.ts +27 -0
- package/dist/relational/largerEq.d.ts.map +1 -0
- package/dist/relational/smaller.d.ts +34 -0
- package/dist/relational/smaller.d.ts.map +1 -0
- package/dist/relational/smallerEq.d.ts +27 -0
- package/dist/relational/smallerEq.d.ts.map +1 -0
- package/dist/relational/unequal.d.ts +28 -0
- package/dist/relational/unequal.d.ts.map +1 -0
- package/dist/set/setCartesian.d.ts +15 -0
- package/dist/set/setCartesian.d.ts.map +1 -0
- package/dist/set/setDifference.d.ts +15 -0
- package/dist/set/setDifference.d.ts.map +1 -0
- package/dist/set/setDistinct.d.ts +2 -0
- package/dist/set/setDistinct.d.ts.map +1 -0
- package/dist/set/setIntersect.d.ts +15 -0
- package/dist/set/setIntersect.d.ts.map +1 -0
- package/dist/set/setIsSubset.d.ts +2 -0
- package/dist/set/setIsSubset.d.ts.map +1 -0
- package/dist/set/setMultiplicity.d.ts +2 -0
- package/dist/set/setMultiplicity.d.ts.map +1 -0
- package/dist/set/setPowerset.d.ts +2 -0
- package/dist/set/setPowerset.d.ts.map +1 -0
- package/dist/set/setSize.d.ts +2 -0
- package/dist/set/setSize.d.ts.map +1 -0
- package/dist/set/setSymDifference.d.ts +15 -0
- package/dist/set/setSymDifference.d.ts.map +1 -0
- package/dist/set/setUnion.d.ts +16 -0
- package/dist/set/setUnion.d.ts.map +1 -0
- package/dist/signal/freqz.d.ts +2 -0
- package/dist/signal/freqz.d.ts.map +1 -0
- package/dist/signal/zpk2tf.d.ts +2 -0
- package/dist/signal/zpk2tf.d.ts.map +1 -0
- package/dist/special/erf.d.ts +7 -0
- package/dist/special/erf.d.ts.map +1 -0
- package/dist/special/zeta.d.ts +38 -0
- package/dist/special/zeta.d.ts.map +1 -0
- package/dist/statistics/corr.d.ts +18 -0
- package/dist/statistics/corr.d.ts.map +1 -0
- package/dist/statistics/cumsum.d.ts +9 -0
- package/dist/statistics/cumsum.d.ts.map +1 -0
- package/dist/statistics/mad.d.ts +11 -0
- package/dist/statistics/mad.d.ts.map +1 -0
- package/dist/statistics/max.d.ts +12 -0
- package/dist/statistics/max.d.ts.map +1 -0
- package/dist/statistics/mean.d.ts +9 -0
- package/dist/statistics/mean.d.ts.map +1 -0
- package/dist/statistics/median.d.ts +11 -0
- package/dist/statistics/median.d.ts.map +1 -0
- package/dist/statistics/min.d.ts +12 -0
- package/dist/statistics/min.d.ts.map +1 -0
- package/dist/statistics/mode.d.ts +9 -0
- package/dist/statistics/mode.d.ts.map +1 -0
- package/dist/statistics/prod.d.ts +12 -0
- package/dist/statistics/prod.d.ts.map +1 -0
- package/dist/statistics/quantileSeq.d.ts +26 -0
- package/dist/statistics/quantileSeq.d.ts.map +1 -0
- package/dist/statistics/std.d.ts +10 -0
- package/dist/statistics/std.d.ts.map +1 -0
- package/dist/statistics/sum.d.ts +12 -0
- package/dist/statistics/sum.d.ts.map +1 -0
- package/dist/statistics/utils/improveErrorMessage.d.ts +18 -0
- package/dist/statistics/utils/improveErrorMessage.d.ts.map +1 -0
- package/dist/statistics/variance.d.ts +13 -0
- package/dist/statistics/variance.d.ts.map +1 -0
- package/dist/string/bin.d.ts +36 -0
- package/dist/string/bin.d.ts.map +1 -0
- package/dist/string/format.d.ts +7 -0
- package/dist/string/format.d.ts.map +1 -0
- package/dist/string/hex.d.ts +35 -0
- package/dist/string/hex.d.ts.map +1 -0
- package/dist/string/oct.d.ts +36 -0
- package/dist/string/oct.d.ts.map +1 -0
- package/dist/string/print.d.ts +7 -0
- package/dist/string/print.d.ts.map +1 -0
- package/dist/trigonometry/acos.d.ts +16 -0
- package/dist/trigonometry/acos.d.ts.map +1 -0
- package/dist/trigonometry/acosh.d.ts +14 -0
- package/dist/trigonometry/acosh.d.ts.map +1 -0
- package/dist/trigonometry/acot.d.ts +12 -0
- package/dist/trigonometry/acot.d.ts.map +1 -0
- package/dist/trigonometry/acoth.d.ts +19 -0
- package/dist/trigonometry/acoth.d.ts.map +1 -0
- package/dist/trigonometry/acsc.d.ts +19 -0
- package/dist/trigonometry/acsc.d.ts.map +1 -0
- package/dist/trigonometry/acsch.d.ts +12 -0
- package/dist/trigonometry/acsch.d.ts.map +1 -0
- package/dist/trigonometry/asec.d.ts +19 -0
- package/dist/trigonometry/asec.d.ts.map +1 -0
- package/dist/trigonometry/asech.d.ts +19 -0
- package/dist/trigonometry/asech.d.ts.map +1 -0
- package/dist/trigonometry/asin.d.ts +16 -0
- package/dist/trigonometry/asin.d.ts.map +1 -0
- package/dist/trigonometry/asinh.d.ts +5 -0
- package/dist/trigonometry/asinh.d.ts.map +1 -0
- package/dist/trigonometry/atan.d.ts +7 -0
- package/dist/trigonometry/atan.d.ts.map +1 -0
- package/dist/trigonometry/atan2.d.ts +22 -0
- package/dist/trigonometry/atan2.d.ts.map +1 -0
- package/dist/trigonometry/atanh.d.ts +14 -0
- package/dist/trigonometry/atanh.d.ts.map +1 -0
- package/dist/trigonometry/cos.d.ts +7 -0
- package/dist/trigonometry/cos.d.ts.map +1 -0
- package/dist/trigonometry/cosh.d.ts +7 -0
- package/dist/trigonometry/cosh.d.ts.map +1 -0
- package/dist/trigonometry/cot.d.ts +12 -0
- package/dist/trigonometry/cot.d.ts.map +1 -0
- package/dist/trigonometry/coth.d.ts +12 -0
- package/dist/trigonometry/coth.d.ts.map +1 -0
- package/dist/trigonometry/csc.d.ts +12 -0
- package/dist/trigonometry/csc.d.ts.map +1 -0
- package/dist/trigonometry/csch.d.ts +12 -0
- package/dist/trigonometry/csch.d.ts.map +1 -0
- package/dist/trigonometry/sec.d.ts +12 -0
- package/dist/trigonometry/sec.d.ts.map +1 -0
- package/dist/trigonometry/sech.d.ts +12 -0
- package/dist/trigonometry/sech.d.ts.map +1 -0
- package/dist/trigonometry/sin.d.ts +7 -0
- package/dist/trigonometry/sin.d.ts.map +1 -0
- package/dist/trigonometry/sinh.d.ts +7 -0
- package/dist/trigonometry/sinh.d.ts.map +1 -0
- package/dist/trigonometry/tan.d.ts +7 -0
- package/dist/trigonometry/tan.d.ts.map +1 -0
- package/dist/trigonometry/tanh.d.ts +7 -0
- package/dist/trigonometry/tanh.d.ts.map +1 -0
- package/dist/trigonometry/trigUnit.d.ts +9 -0
- package/dist/trigonometry/trigUnit.d.ts.map +1 -0
- package/dist/type/bignumber/BigNumber.d.ts +46 -0
- package/dist/type/bignumber/BigNumber.d.ts.map +1 -0
- package/dist/type/chain/Chain.d.ts +58 -0
- package/dist/type/chain/Chain.d.ts.map +1 -0
- package/dist/type/chain/function/chain.d.ts +6 -0
- package/dist/type/chain/function/chain.d.ts.map +1 -0
- package/dist/type/complex/Complex.d.ts +74 -0
- package/dist/type/complex/Complex.d.ts.map +1 -0
- package/dist/type/local/Decimal.d.ts +223 -0
- package/dist/type/local/Decimal.d.ts.map +1 -0
- package/dist/type/matrix/FibonacciHeap.d.ts +59 -0
- package/dist/type/matrix/FibonacciHeap.d.ts.map +1 -0
- package/dist/type/matrix/ImmutableDenseMatrix.d.ts +282 -0
- package/dist/type/matrix/ImmutableDenseMatrix.d.ts.map +1 -0
- package/dist/type/matrix/MatrixIndex.d.ts +386 -0
- package/dist/type/matrix/MatrixIndex.d.ts.map +1 -0
- package/dist/type/matrix/Spa.d.ts +40 -0
- package/dist/type/matrix/Spa.d.ts.map +1 -0
- package/dist/type/matrix/function/index.d.ts +11 -0
- package/dist/type/matrix/function/index.d.ts.map +1 -0
- package/dist/type/matrix/types.d.ts +435 -0
- package/dist/type/matrix/types.d.ts.map +1 -0
- package/dist/type/matrix/utils/broadcast.d.ts +18 -0
- package/dist/type/matrix/utils/broadcast.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo01xDSid.d.ts +34 -0
- package/dist/type/matrix/utils/matAlgo01xDSid.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo02xDS0.d.ts +32 -0
- package/dist/type/matrix/utils/matAlgo02xDS0.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo03xDSf.d.ts +31 -0
- package/dist/type/matrix/utils/matAlgo03xDSf.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo04xSidSid.d.ts +21 -0
- package/dist/type/matrix/utils/matAlgo04xSidSid.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo05xSfSf.d.ts +21 -0
- package/dist/type/matrix/utils/matAlgo05xSfSf.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo06xS0S0.d.ts +21 -0
- package/dist/type/matrix/utils/matAlgo06xS0S0.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo07xSSf.d.ts +26 -0
- package/dist/type/matrix/utils/matAlgo07xSSf.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo08xS0Sid.d.ts +21 -0
- package/dist/type/matrix/utils/matAlgo08xS0Sid.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo09xS0Sf.d.ts +21 -0
- package/dist/type/matrix/utils/matAlgo09xS0Sf.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo10xSids.d.ts +33 -0
- package/dist/type/matrix/utils/matAlgo10xSids.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo11xS0s.d.ts +19 -0
- package/dist/type/matrix/utils/matAlgo11xS0s.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo12xSfs.d.ts +33 -0
- package/dist/type/matrix/utils/matAlgo12xSfs.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo13xDD.d.ts +20 -0
- package/dist/type/matrix/utils/matAlgo13xDD.d.ts.map +1 -0
- package/dist/type/matrix/utils/matAlgo14xDs.d.ts +19 -0
- package/dist/type/matrix/utils/matAlgo14xDs.d.ts.map +1 -0
- package/dist/type/matrix/utils/matrixAlgorithmSuite.d.ts +23 -0
- package/dist/type/matrix/utils/matrixAlgorithmSuite.d.ts.map +1 -0
- package/dist/type/resultset/ResultSet.d.ts +28 -0
- package/dist/type/resultset/ResultSet.d.ts.map +1 -0
- package/dist/type/unit/Unit.d.ts +13907 -0
- package/dist/type/unit/Unit.d.ts.map +1 -0
- package/dist/type/unit/function/createUnit.d.ts +40 -0
- package/dist/type/unit/function/createUnit.d.ts.map +1 -0
- package/dist/type/unit/function/splitUnit.d.ts +10 -0
- package/dist/type/unit/function/splitUnit.d.ts.map +1 -0
- package/dist/type/unit/function/unit.d.ts +27 -0
- package/dist/type/unit/function/unit.d.ts.map +1 -0
- package/dist/type/unit/physicalConstants.d.ts +89 -0
- package/dist/type/unit/physicalConstants.d.ts.map +1 -0
- package/dist/typed/algebra.d.ts +418 -0
- package/dist/typed/algebra.d.ts.map +1 -0
- package/dist/typed/arithmetic.d.ts +302 -0
- package/dist/typed/arithmetic.d.ts.map +1 -0
- package/dist/typed/bitwise.d.ts +48 -0
- package/dist/typed/bitwise.d.ts.map +1 -0
- package/dist/typed/cas.d.ts +691 -0
- package/dist/typed/cas.d.ts.map +1 -0
- package/dist/typed/combinatorics.d.ts +333 -0
- package/dist/typed/combinatorics.d.ts.map +1 -0
- package/dist/typed/complex.d.ts +91 -0
- package/dist/typed/complex.d.ts.map +1 -0
- package/dist/typed/dist-objects.d.ts +219 -0
- package/dist/typed/dist-objects.d.ts.map +1 -0
- package/dist/typed/distributions.d.ts +247 -0
- package/dist/typed/distributions.d.ts.map +1 -0
- package/dist/typed/geometry.d.ts +329 -0
- package/dist/typed/geometry.d.ts.map +1 -0
- package/dist/typed/gpu.d.ts +62 -0
- package/dist/typed/gpu.d.ts.map +1 -0
- package/dist/typed/graph.d.ts +339 -0
- package/dist/typed/graph.d.ts.map +1 -0
- package/dist/typed/hypothesis.d.ts +274 -0
- package/dist/typed/hypothesis.d.ts.map +1 -0
- package/dist/typed/index.d.ts +299 -0
- package/dist/typed/index.d.ts.map +1 -0
- package/dist/typed/integration.d.ts +219 -0
- package/dist/typed/integration.d.ts.map +1 -0
- package/dist/typed/interpolation.d.ts +189 -0
- package/dist/typed/interpolation.d.ts.map +1 -0
- package/dist/typed/logical.d.ts +87 -0
- package/dist/typed/logical.d.ts.map +1 -0
- package/dist/typed/matrix-ops.d.ts +303 -0
- package/dist/typed/matrix-ops.d.ts.map +1 -0
- package/dist/typed/numeric.d.ts +395 -0
- package/dist/typed/numeric.d.ts.map +1 -0
- package/dist/typed/probability.d.ts +165 -0
- package/dist/typed/probability.d.ts.map +1 -0
- package/dist/typed/relational.d.ts +136 -0
- package/dist/typed/relational.d.ts.map +1 -0
- package/dist/typed/set.d.ts +145 -0
- package/dist/typed/set.d.ts.map +1 -0
- package/dist/typed/signal.d.ts +427 -0
- package/dist/typed/signal.d.ts.map +1 -0
- package/dist/typed/special.d.ts +469 -0
- package/dist/typed/special.d.ts.map +1 -0
- package/dist/typed/statistics.d.ts +174 -0
- package/dist/typed/statistics.d.ts.map +1 -0
- package/dist/typed/string.d.ts +114 -0
- package/dist/typed/string.d.ts.map +1 -0
- package/dist/typed/trigonometry.d.ts +111 -0
- package/dist/typed/trigonometry.d.ts.map +1 -0
- package/dist/typed/typed-bridge.d.ts +6 -0
- package/dist/typed/typed-bridge.d.ts.map +1 -0
- package/dist/typed/unit.d.ts +60 -0
- package/dist/typed/unit.d.ts.map +1 -0
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/unit/to.d.ts +13 -0
- package/dist/unit/to.d.ts.map +1 -0
- package/dist/unit/toBest.d.ts +5 -0
- package/dist/unit/toBest.d.ts.map +1 -0
- package/dist/utils/array.d.ts +249 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/bigint.d.ts +18 -0
- package/dist/utils/bigint.d.ts.map +1 -0
- package/dist/utils/bignumber/bitwise.d.ts +99 -0
- package/dist/utils/bignumber/bitwise.d.ts.map +1 -0
- package/dist/utils/bignumber/constants.d.ts +25 -0
- package/dist/utils/bignumber/constants.d.ts.map +1 -0
- package/dist/utils/bignumber/formatter.d.ts +105 -0
- package/dist/utils/bignumber/formatter.d.ts.map +1 -0
- package/dist/utils/bignumber/nearlyEqual.d.ts +18 -0
- package/dist/utils/bignumber/nearlyEqual.d.ts.map +1 -0
- package/dist/utils/clone.d.ts +7 -0
- package/dist/utils/clone.d.ts.map +1 -0
- package/dist/utils/collection.d.ts +67 -0
- package/dist/utils/collection.d.ts.map +1 -0
- package/dist/utils/complex.d.ts +11 -0
- package/dist/utils/complex.d.ts.map +1 -0
- package/dist/utils/customs.d.ts +51 -0
- package/dist/utils/customs.d.ts.map +1 -0
- package/dist/utils/emitter.d.ts +13 -0
- package/dist/utils/emitter.d.ts.map +1 -0
- package/dist/utils/factory.d.ts +112 -0
- package/dist/utils/factory.d.ts.map +1 -0
- package/dist/utils/function.d.ts +44 -0
- package/dist/utils/function.d.ts.map +1 -0
- package/dist/utils/hasNumericValue.d.ts +8 -0
- package/dist/utils/hasNumericValue.d.ts.map +1 -0
- package/dist/utils/is.d.ts +204 -0
- package/dist/utils/is.d.ts.map +1 -0
- package/dist/utils/isBounded.d.ts +6 -0
- package/dist/utils/isBounded.d.ts.map +1 -0
- package/dist/utils/isFinite.d.ts +10 -0
- package/dist/utils/isFinite.d.ts.map +1 -0
- package/dist/utils/isInteger.d.ts +8 -0
- package/dist/utils/isInteger.d.ts.map +1 -0
- package/dist/utils/isNaN.d.ts +7 -0
- package/dist/utils/isNaN.d.ts.map +1 -0
- package/dist/utils/isNegative.d.ts +9 -0
- package/dist/utils/isNegative.d.ts.map +1 -0
- package/dist/utils/isNumeric.d.ts +6 -0
- package/dist/utils/isNumeric.d.ts.map +1 -0
- package/dist/utils/isPositive.d.ts +9 -0
- package/dist/utils/isPositive.d.ts.map +1 -0
- package/dist/utils/isPrime.d.ts +7 -0
- package/dist/utils/isPrime.d.ts.map +1 -0
- package/dist/utils/isZero.d.ts +8 -0
- package/dist/utils/isZero.d.ts.map +1 -0
- package/dist/utils/log.d.ts +5 -0
- package/dist/utils/log.d.ts.map +1 -0
- package/dist/utils/lruQueue.d.ts +6 -0
- package/dist/utils/lruQueue.d.ts.map +1 -0
- package/dist/utils/map.d.ts +95 -0
- package/dist/utils/map.d.ts.map +1 -0
- package/dist/utils/node.d.ts +2 -0
- package/dist/utils/node.d.ts.map +1 -0
- package/dist/utils/noop.d.ts +6 -0
- package/dist/utils/noop.d.ts.map +1 -0
- package/dist/utils/number.d.ts +314 -0
- package/dist/utils/number.d.ts.map +1 -0
- package/dist/utils/numeric.d.ts +10 -0
- package/dist/utils/numeric.d.ts.map +1 -0
- package/dist/utils/object.d.ts +123 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/optimizeCallback.d.ts +22 -0
- package/dist/utils/optimizeCallback.d.ts.map +1 -0
- package/dist/utils/parseNumber.d.ts +2 -0
- package/dist/utils/parseNumber.d.ts.map +1 -0
- package/dist/utils/print.d.ts +2 -0
- package/dist/utils/print.d.ts.map +1 -0
- package/dist/utils/product.d.ts +6 -0
- package/dist/utils/product.d.ts.map +1 -0
- package/dist/utils/string.d.ts +66 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/switch.d.ts +8 -0
- package/dist/utils/switch.d.ts.map +1 -0
- package/dist/utils/typeOf.d.ts +7 -0
- package/dist/utils/typeOf.d.ts.map +1 -0
- package/dist/wasm/WasmLoader.d.ts +395 -0
- package/dist/wasm/WasmLoader.d.ts.map +1 -0
- package/dist/wasm/bitwise/wasm-bridge.d.ts +65 -0
- package/dist/wasm/bitwise/wasm-bridge.d.ts.map +1 -0
- package/dist/wasm/integrity.d.ts +48 -0
- package/dist/wasm/integrity.d.ts.map +1 -0
- package/dist/wasm/interpolation/wasm-bridge.d.ts +95 -0
- package/dist/wasm/interpolation/wasm-bridge.d.ts.map +1 -0
- package/dist/wasm/poly/wasm-bridge.d.ts +99 -0
- package/dist/wasm/poly/wasm-bridge.d.ts.map +1 -0
- package/dist/wasm/signal/wasm-bridge.d.ts +61 -0
- package/dist/wasm/signal/wasm-bridge.d.ts.map +1 -0
- package/dist/wasm/sort/wasm-bridge.d.ts +43 -0
- package/dist/wasm/sort/wasm-bridge.d.ts.map +1 -0
- package/dist/wasm/special/wasm-bridge.d.ts +133 -0
- package/dist/wasm/special/wasm-bridge.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interpolation Functions
|
|
3
|
+
*
|
|
4
|
+
* Provides polynomial and spline interpolation methods:
|
|
5
|
+
* - linearInterp: Linear interpolation between data points
|
|
6
|
+
* - lagrangeInterp: Lagrange polynomial interpolation
|
|
7
|
+
* - cubicSpline: Natural cubic spline (returns evaluation function)
|
|
8
|
+
* - hermiteInterp: Hermite interpolation with derivative data
|
|
9
|
+
* - pchipInterp: Piecewise Cubic Hermite Interpolating Polynomial (shape-preserving)
|
|
10
|
+
* - polyFit: Least-squares polynomial fitting
|
|
11
|
+
*
|
|
12
|
+
* These use plain exports since some return functions.
|
|
13
|
+
*
|
|
14
|
+
* The hot-loop tridiagonal solver used by `cubicSpline` is dispatched
|
|
15
|
+
* through `functions/src/wasm/interpolation/wasm-bridge.ts` when the
|
|
16
|
+
* knot count reaches the WASM_TRIDIAG_THRESHOLD (1024).
|
|
17
|
+
*
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
*/
|
|
20
|
+
import { WASM_INTERP_THRESHOLD } from '../wasm/interpolation/wasm-bridge.js';
|
|
21
|
+
/**
|
|
22
|
+
* Linear interpolation between data points.
|
|
23
|
+
*
|
|
24
|
+
* Finds the interval containing x and linearly interpolates.
|
|
25
|
+
* Extrapolates linearly outside the data range.
|
|
26
|
+
*
|
|
27
|
+
* @param xs - Sorted x-coordinates (ascending)
|
|
28
|
+
* @param ys - Corresponding y-values
|
|
29
|
+
* @param x - Point to interpolate at
|
|
30
|
+
* @returns Interpolated value
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* linearInterp([0, 1], [0, 1], 0.5) // => 0.5
|
|
34
|
+
* linearInterp([0, 1, 2], [0, 1, 4], 1.5) // => 2.5
|
|
35
|
+
*/
|
|
36
|
+
export declare function linearInterp(xs: number[], ys: number[], x: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Lagrange polynomial interpolation.
|
|
39
|
+
*
|
|
40
|
+
* Computes the unique polynomial of degree n-1 passing through n data points,
|
|
41
|
+
* evaluated at x.
|
|
42
|
+
*
|
|
43
|
+
* When `xs.length >= WASM_INTERP_THRESHOLD` (256), the O(n²)
|
|
44
|
+
* divided-difference table is computed via the WASM kernel (Rust primary,
|
|
45
|
+
* AssemblyScript fallback) and the result is evaluated in Newton form.
|
|
46
|
+
* Below the threshold the classical direct Lagrange formula is used.
|
|
47
|
+
*
|
|
48
|
+
* @param xs - Distinct x-coordinates
|
|
49
|
+
* @param ys - Corresponding y-values
|
|
50
|
+
* @param x - Point to evaluate at
|
|
51
|
+
* @returns Interpolated value
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* lagrangeInterp([0, 1, 2], [0, 1, 4], 1.5) // => 2.25
|
|
55
|
+
*/
|
|
56
|
+
export declare function lagrangeInterp(xs: number[], ys: number[], x: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* Newton's divided-difference polynomial interpolation.
|
|
59
|
+
*
|
|
60
|
+
* Evaluates the unique interpolating polynomial of degree n-1 at `x` using
|
|
61
|
+
* Newton's divided-difference representation. Mathematically identical to
|
|
62
|
+
* Lagrange interpolation but computed via a different (and more numerically
|
|
63
|
+
* efficient) algorithm.
|
|
64
|
+
*
|
|
65
|
+
* When `xs.length >= WASM_INTERP_THRESHOLD` (256), the O(n²)
|
|
66
|
+
* divided-difference table is dispatched to the WASM kernel; otherwise the
|
|
67
|
+
* pure-JS path runs.
|
|
68
|
+
*
|
|
69
|
+
* @param xs - Distinct x-coordinates
|
|
70
|
+
* @param ys - Corresponding y-values
|
|
71
|
+
* @param x - Point to evaluate at
|
|
72
|
+
* @returns Interpolated value
|
|
73
|
+
* @throws RangeError when any two xs are equal (degenerate / duplicate nodes)
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* newtonInterp([0, 1, 2], [0, 1, 4], 1.5) // => 2.25
|
|
77
|
+
*/
|
|
78
|
+
export declare function newtonInterp(xs: number[], ys: number[], x: number): number;
|
|
79
|
+
/**
|
|
80
|
+
* Re-export the WASM_INTERP_THRESHOLD constant for external consumers
|
|
81
|
+
* that need to know the dispatch boundary.
|
|
82
|
+
*/
|
|
83
|
+
export { WASM_INTERP_THRESHOLD };
|
|
84
|
+
/**
|
|
85
|
+
* Natural cubic spline interpolation.
|
|
86
|
+
*
|
|
87
|
+
* Computes spline coefficients and returns a function that evaluates
|
|
88
|
+
* the spline at any point. Uses natural boundary conditions (second
|
|
89
|
+
* derivative = 0 at endpoints).
|
|
90
|
+
*
|
|
91
|
+
* @param xs - Sorted x-coordinates (ascending, at least 3 points)
|
|
92
|
+
* @param ys - Corresponding y-values
|
|
93
|
+
* @returns Evaluation function
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* const spline = cubicSpline([0, 1, 2, 3], [0, 1, 4, 9]);
|
|
97
|
+
* spline(1.5) // => ~2.25
|
|
98
|
+
*/
|
|
99
|
+
export declare function cubicSpline(xs: number[], ys: number[]): (x: number) => number;
|
|
100
|
+
/**
|
|
101
|
+
* Hermite interpolation using function values and derivatives.
|
|
102
|
+
*
|
|
103
|
+
* Constructs the unique polynomial that matches both function values
|
|
104
|
+
* and first derivatives at each data point.
|
|
105
|
+
*
|
|
106
|
+
* @param xs - Distinct x-coordinates
|
|
107
|
+
* @param ys - Function values at xs
|
|
108
|
+
* @param dys - Derivative values at xs
|
|
109
|
+
* @param x - Point to evaluate at
|
|
110
|
+
* @returns Interpolated value
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* hermiteInterp([0, 1], [0, 1], [1, 1], 0.5) // => 0.5 (linear)
|
|
114
|
+
*/
|
|
115
|
+
export declare function hermiteInterp(xs: number[], ys: number[], dys: number[], x: number): number;
|
|
116
|
+
/**
|
|
117
|
+
* Shape-preserving piecewise cubic Hermite interpolation (PCHIP).
|
|
118
|
+
*
|
|
119
|
+
* Unlike cubic splines, PCHIP preserves monotonicity and avoids overshoot.
|
|
120
|
+
* Uses Fritsch-Carlson method to compute slopes.
|
|
121
|
+
*
|
|
122
|
+
* @param xs - Sorted x-coordinates (ascending, at least 2 points)
|
|
123
|
+
* @param ys - Corresponding y-values
|
|
124
|
+
* @param x - Point to interpolate at
|
|
125
|
+
* @returns Interpolated value
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* pchipInterp([0, 1, 2, 3], [0, 1, 4, 9], 1.5)
|
|
129
|
+
*/
|
|
130
|
+
export declare function pchipInterp(xs: number[], ys: number[], x: number): number;
|
|
131
|
+
/**
|
|
132
|
+
* Least-squares polynomial fit.
|
|
133
|
+
*
|
|
134
|
+
* Fits a polynomial of given degree to data points using Vandermonde + QR.
|
|
135
|
+
* Returns coefficients [a0, a1, ..., a_degree] where p(x) = a0 + a1*x + ... + a_d*x^d.
|
|
136
|
+
*
|
|
137
|
+
* When xs.length >= WASM_POLY_FIT_THRESHOLD (1024), the hot-loop is dispatched
|
|
138
|
+
* to the WASM Rust backend (or AS fallback). Below the threshold, a normal-
|
|
139
|
+
* equation / Gaussian-elimination path runs in pure JS.
|
|
140
|
+
*
|
|
141
|
+
* @param xs - x-coordinates
|
|
142
|
+
* @param ys - y-values
|
|
143
|
+
* @param degree - Polynomial degree (must be < number of data points)
|
|
144
|
+
* @returns Array of coefficients [a0, a1, ..., a_degree]
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* polyFit([0, 1, 2, 3], [0, 1, 4, 9], 2) // => ~[0, 0, 1] (x^2)
|
|
148
|
+
*/
|
|
149
|
+
export declare function polyFit(xs: number[], ys: number[], degree: number): number[];
|
|
150
|
+
/**
|
|
151
|
+
* Fit a Chebyshev-series of given degree to data points.
|
|
152
|
+
*
|
|
153
|
+
* Returns coefficients [c0, c1, ..., c_degree] in the Chebyshev-T basis so
|
|
154
|
+
* that f(x) ≈ c0·T_0(x) + c1·T_1(x) + ... + c_d·T_d(x).
|
|
155
|
+
*
|
|
156
|
+
* When xs.length >= WASM_POLY_FIT_THRESHOLD, the QR solve is dispatched
|
|
157
|
+
* to WASM. Below the threshold, a normal-equation JS path is used.
|
|
158
|
+
*
|
|
159
|
+
* @param xs - x-coordinates (ideally in [-1, 1] for numerical stability)
|
|
160
|
+
* @param ys - y-values
|
|
161
|
+
* @param degree - Chebyshev degree
|
|
162
|
+
* @returns Array of Chebyshev coefficients [c0, ..., c_degree]
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* // T_2(x) = 2x² - 1: coefficients should be approx [-1, 0, 2] (wait — basis order)
|
|
166
|
+
* // T_0 = 1, T_1 = x, T_2 = 2x²-1 → recovery coefficients [0, 0, 1] for T_2 alone
|
|
167
|
+
* chebyshevFit(xs, ys, 2) // ys = T_2(xs): => ~[0, 0, 1]
|
|
168
|
+
*/
|
|
169
|
+
export declare function chebyshevFit(xs: number[], ys: number[], degree: number): number[];
|
|
170
|
+
/**
|
|
171
|
+
* Fit a Legendre-series of given degree to data points.
|
|
172
|
+
*
|
|
173
|
+
* Returns coefficients [c0, c1, ..., c_degree] in the Legendre-P basis so
|
|
174
|
+
* that f(x) ≈ c0·P_0(x) + c1·P_1(x) + ... + c_d·P_d(x).
|
|
175
|
+
*
|
|
176
|
+
* When xs.length >= WASM_POLY_FIT_THRESHOLD, the QR solve is dispatched
|
|
177
|
+
* to WASM. Below the threshold, a normal-equation JS path is used.
|
|
178
|
+
*
|
|
179
|
+
* @param xs - x-coordinates (ideally in [-1, 1] for numerical stability)
|
|
180
|
+
* @param ys - y-values
|
|
181
|
+
* @param degree - Legendre degree
|
|
182
|
+
* @returns Array of Legendre coefficients [c0, ..., c_degree]
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* // P_2(x) = (3x² - 1)/2: recovery coefficients [0, 0, 1] for P_2 alone
|
|
186
|
+
* legendreFit(xs, ys, 2) // ys = P_2(xs): => ~[0, 0, 1]
|
|
187
|
+
*/
|
|
188
|
+
export declare function legendreFit(xs: number[], ys: number[], degree: number): number[];
|
|
189
|
+
//# sourceMappingURL=interpolation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../../src/typed/interpolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAGL,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAY9C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAmB1E;AA8BD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CA+B5E;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAiB1E;AAED;;;GAGG;AACH,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAMjC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAsF7E;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAmC1F;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAsEzE;AA8BD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAsE5E;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAqEjF;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAqEhF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed Logical Functions
|
|
3
|
+
*
|
|
4
|
+
* Polymorphic logical operations using typed-function for runtime dispatch.
|
|
5
|
+
* Supports number, bigint, BigNumber, and Complex types.
|
|
6
|
+
*
|
|
7
|
+
* Truthiness rules (a value is FALSY if):
|
|
8
|
+
* - number: === 0 or NaN
|
|
9
|
+
* - bigint: === 0n
|
|
10
|
+
* - BigNumber: .isZero() || .isNaN()
|
|
11
|
+
* - Complex: re === 0 && im === 0
|
|
12
|
+
* - any: JS-falsy (null, undefined, '', false, 0, 0n, NaN)
|
|
13
|
+
*
|
|
14
|
+
* These match the mathjs `and`/`or`/`xor`/`not` semantics exactly.
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Logical `not`. Flips the boolean value of a given parameter.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* not(2) // false
|
|
24
|
+
* not(0) // true
|
|
25
|
+
* not(true) // false
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const not: import("typed-function").TypedFunction;
|
|
29
|
+
/**
|
|
30
|
+
* Logical `and`. Returns true when both inputs are truthy (non-zero/non-empty).
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* and(1, 2) // true
|
|
35
|
+
* and(0, 2) // false
|
|
36
|
+
* and(1, 2, 3) // true (variadic)
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare const and: import("typed-function").TypedFunction;
|
|
40
|
+
/**
|
|
41
|
+
* Logical `or`. Returns true when at least one input is truthy.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* or(0, 2) // true
|
|
46
|
+
* or(0, 0) // false
|
|
47
|
+
* or(0, 0, 1) // true (variadic)
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare const or: import("typed-function").TypedFunction;
|
|
51
|
+
/**
|
|
52
|
+
* Logical `xor`. Returns true when exactly one input is truthy.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* xor(1, 0) // true
|
|
57
|
+
* xor(1, 2) // false
|
|
58
|
+
* xor(1, 0, 0) // true (variadic: odd number of truthy values)
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare const xor: import("typed-function").TypedFunction;
|
|
62
|
+
/**
|
|
63
|
+
* Nullish coalescing operator (??).
|
|
64
|
+
* Returns `b` when `a` is `null` or `undefined`, otherwise returns `a`.
|
|
65
|
+
*
|
|
66
|
+
* Unlike `or`, a value of `0`, `false`, or `''` is NOT considered nullish.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* nullish(null, 5) // 5
|
|
71
|
+
* nullish(undefined, 5) // 5
|
|
72
|
+
* nullish(0, 5) // 0 (not nullish!)
|
|
73
|
+
* nullish(false, 5) // false
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare const nullish: import("typed-function").TypedFunction;
|
|
77
|
+
/**
|
|
78
|
+
* All typed logical functions.
|
|
79
|
+
*/
|
|
80
|
+
export declare const typedLogical: {
|
|
81
|
+
not: import("typed-function").TypedFunction;
|
|
82
|
+
and: import("typed-function").TypedFunction;
|
|
83
|
+
or: import("typed-function").TypedFunction;
|
|
84
|
+
xor: import("typed-function").TypedFunction;
|
|
85
|
+
nullish: import("typed-function").TypedFunction;
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=logical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logical.d.ts","sourceRoot":"","sources":["../../src/typed/logical.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgCH;;;;;;;;;GASG;AACH,eAAO,MAAM,GAAG,wCAUd,CAAC;AAMH;;;;;;;;;GASG;AACH,eAAO,MAAM,GAAG,wCAmBd,CAAC;AAMH;;;;;;;;;GASG;AACH,eAAO,MAAM,EAAE,wCAmBb,CAAC;AAMH;;;;;;;;;GASG;AACH,eAAO,MAAM,GAAG,wCAwBd,CAAC;AAMH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,wCAmBlB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;CAMxB,CAAC"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed Matrix Operations
|
|
3
|
+
*
|
|
4
|
+
* Advanced matrix operations including characteristic polynomial,
|
|
5
|
+
* row reduction (RREF), Cholesky decomposition, Hessenberg form,
|
|
6
|
+
* matrix power/log, polar decomposition, and Jordan form.
|
|
7
|
+
*
|
|
8
|
+
* All functions operate on number[][] (nested arrays) for consistency
|
|
9
|
+
* with the rest of the typed functions layer. SVD and eigendecomposition
|
|
10
|
+
* are delegated to @danielsimonjr/mathts-matrix when needed.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
type f64 = number;
|
|
15
|
+
type i32 = number;
|
|
16
|
+
/**
|
|
17
|
+
* Compute the characteristic polynomial of a square matrix.
|
|
18
|
+
*
|
|
19
|
+
* Returns coefficients of det(A - lambda*I) in ascending power order:
|
|
20
|
+
* [c0, c1, ..., cn] represents c0 + c1*lambda + ... + cn*lambda^n.
|
|
21
|
+
*
|
|
22
|
+
* Uses the Faddeev-LeVerrier algorithm which computes the coefficients
|
|
23
|
+
* from traces of successive matrix powers, achieving O(n^4) complexity.
|
|
24
|
+
*
|
|
25
|
+
* @param A - Square matrix (n x n)
|
|
26
|
+
* @returns Coefficient array of length n+1 (ascending power order)
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Matrix [[2,1],[1,2]] has char poly lambda^2 - 4*lambda + 3
|
|
30
|
+
* characteristicPolynomial([[2,1],[1,2]]) // => [3, -4, 1]
|
|
31
|
+
*/
|
|
32
|
+
export declare function characteristicPolynomial(A: number[][]): Promise<number[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Compute the reduced row echelon form (RREF) of a matrix.
|
|
35
|
+
*
|
|
36
|
+
* Uses Gauss-Jordan elimination with partial pivoting for numerical
|
|
37
|
+
* stability. The result has leading 1s in each pivot column and zeros
|
|
38
|
+
* in all other entries of pivot columns.
|
|
39
|
+
*
|
|
40
|
+
* @param A - Matrix (m x n), not modified in place
|
|
41
|
+
* @param tol - Tolerance for zero detection (default 1e-10)
|
|
42
|
+
* @returns RREF matrix (m x n)
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* rowReduce([[1,2,3],[4,5,6],[7,8,9]])
|
|
46
|
+
* // => [[1,0,-1],[0,1,2],[0,0,0]]
|
|
47
|
+
*/
|
|
48
|
+
export declare function rowReduce(A: number[][], tol?: f64): number[][];
|
|
49
|
+
/**
|
|
50
|
+
* Compute the rank of a matrix using RREF.
|
|
51
|
+
*
|
|
52
|
+
* The rank is the number of nonzero rows in the reduced row echelon form,
|
|
53
|
+
* which equals the number of pivot columns.
|
|
54
|
+
*
|
|
55
|
+
* @param A - Matrix (m x n)
|
|
56
|
+
* @param tol - Tolerance for zero detection (default 1e-10)
|
|
57
|
+
* @returns Rank (number of linearly independent rows/columns)
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* matrixRank([[1,2],[2,4]]) // => 1
|
|
61
|
+
* matrixRank([[1,0],[0,1]]) // => 2
|
|
62
|
+
*/
|
|
63
|
+
export declare function matrixRank(A: number[][], tol?: f64): i32;
|
|
64
|
+
/**
|
|
65
|
+
* Result of Cholesky decomposition.
|
|
66
|
+
*/
|
|
67
|
+
export interface CholeskyResult {
|
|
68
|
+
/** Lower triangular matrix L such that A = L * L^T */
|
|
69
|
+
L: number[][];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Cholesky decomposition of a symmetric positive-definite matrix.
|
|
73
|
+
*
|
|
74
|
+
* Decomposes A = L * L^T where L is lower triangular with positive
|
|
75
|
+
* diagonal entries. The matrix must be symmetric and positive definite,
|
|
76
|
+
* otherwise an error is thrown.
|
|
77
|
+
*
|
|
78
|
+
* @param A - Symmetric positive-definite matrix (n x n)
|
|
79
|
+
* @returns Object with L (lower triangular factor)
|
|
80
|
+
* @throws Error if matrix is not symmetric or not positive definite
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* cholesky([[4,2],[2,3]])
|
|
84
|
+
* // => { L: [[2,0],[1, Math.sqrt(2)]] }
|
|
85
|
+
*/
|
|
86
|
+
export declare function cholesky(A: number[][]): CholeskyResult;
|
|
87
|
+
/**
|
|
88
|
+
* Result of Hessenberg reduction.
|
|
89
|
+
*/
|
|
90
|
+
export interface HessenbergResult {
|
|
91
|
+
/** Upper Hessenberg matrix H */
|
|
92
|
+
H: number[][];
|
|
93
|
+
/** Orthogonal transformation matrix Q such that A = Q * H * Q^T */
|
|
94
|
+
Q: number[][];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Reduce a square matrix to upper Hessenberg form using Householder reflections.
|
|
98
|
+
*
|
|
99
|
+
* Computes Q and H such that A = Q * H * Q^T, where H is upper Hessenberg
|
|
100
|
+
* (zero below the first subdiagonal) and Q is orthogonal.
|
|
101
|
+
*
|
|
102
|
+
* @param A - Square matrix (n x n)
|
|
103
|
+
* @returns Object with H (Hessenberg) and Q (orthogonal)
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* const { H, Q } = hessenbergForm([[1,2,3],[4,5,6],[7,8,9]]);
|
|
107
|
+
* // H is upper Hessenberg, Q is orthogonal, A = Q * H * Q^T
|
|
108
|
+
*/
|
|
109
|
+
export declare function hessenbergForm(A: number[][]): HessenbergResult;
|
|
110
|
+
/**
|
|
111
|
+
* Compute a matrix raised to an integer or fractional power.
|
|
112
|
+
*
|
|
113
|
+
* For non-negative integers: uses binary exponentiation (repeated squaring).
|
|
114
|
+
* For p = -1: computes the matrix inverse via Gauss-Jordan elimination.
|
|
115
|
+
* For negative integers: computes inverse then raises to |p|.
|
|
116
|
+
* For fractional p: uses eigendecomposition A = V * diag(lambda) * V^{-1},
|
|
117
|
+
* then A^p = V * diag(lambda^p) * V^{-1}.
|
|
118
|
+
*
|
|
119
|
+
* @param A - Square matrix (n x n)
|
|
120
|
+
* @param p - Exponent (integer or fractional)
|
|
121
|
+
* @returns A^p as an n x n matrix
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* matrixPower([[1,1],[0,1]], 3) // => [[1,3],[0,1]]
|
|
125
|
+
* matrixPower([[4,0],[0,9]], 0.5) // => [[2,0],[0,3]]
|
|
126
|
+
*/
|
|
127
|
+
export declare function matrixPower(A: number[][], p: f64): Promise<number[][]>;
|
|
128
|
+
/**
|
|
129
|
+
* Compute the matrix logarithm.
|
|
130
|
+
*
|
|
131
|
+
* For matrices near the identity, uses the Padé approximant of log(I + X)
|
|
132
|
+
* with inverse scaling and squaring. For general matrices, uses eigendecomposition:
|
|
133
|
+
* log(A) = V * diag(log(lambda_i)) * V^{-1}.
|
|
134
|
+
*
|
|
135
|
+
* @param A - Square matrix with positive real eigenvalues
|
|
136
|
+
* @returns log(A) as an n x n matrix
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* // log(exp([[0,1],[0,0]])) should recover [[0,1],[0,0]]
|
|
140
|
+
* matrixLog([[1,1],[0,1]]) // => [[0,1],[0,0]]
|
|
141
|
+
*/
|
|
142
|
+
export declare function matrixLog(A: number[][]): Promise<number[][]>;
|
|
143
|
+
/**
|
|
144
|
+
* Result of polar decomposition.
|
|
145
|
+
*/
|
|
146
|
+
export interface PolarResult {
|
|
147
|
+
/** Unitary factor U (orthogonal for real matrices) */
|
|
148
|
+
U: number[][];
|
|
149
|
+
/** Positive semi-definite factor P */
|
|
150
|
+
P: number[][];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Compute the polar decomposition A = U * P.
|
|
154
|
+
*
|
|
155
|
+
* U is unitary (orthogonal for real matrices) and P is symmetric positive
|
|
156
|
+
* semi-definite. Computed via SVD: if A = W*S*V^T, then U = W*V^T and P = V*S*V^T.
|
|
157
|
+
*
|
|
158
|
+
* @param A - Square matrix (n x n)
|
|
159
|
+
* @returns Object with U (unitary) and P (positive semi-definite)
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* const { U, P } = polarDecomposition([[1,0],[0,2]]);
|
|
163
|
+
* // U is identity (or close), P = [[1,0],[0,2]]
|
|
164
|
+
*/
|
|
165
|
+
export declare function polarDecomposition(A: number[][]): Promise<PolarResult>;
|
|
166
|
+
/**
|
|
167
|
+
* Result of Jordan decomposition.
|
|
168
|
+
*/
|
|
169
|
+
export interface JordanResult {
|
|
170
|
+
/** Jordan normal form matrix J */
|
|
171
|
+
J: number[][];
|
|
172
|
+
/** Transformation matrix P such that A = P * J * P^{-1} */
|
|
173
|
+
P: number[][];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Compute the Jordan normal form of a square matrix.
|
|
177
|
+
*
|
|
178
|
+
* For matrices with distinct eigenvalues, this is simply the diagonal
|
|
179
|
+
* matrix of eigenvalues. For repeated eigenvalues, Jordan blocks are
|
|
180
|
+
* formed by analyzing the null spaces of (A - lambda*I)^k.
|
|
181
|
+
*
|
|
182
|
+
* Note: This implementation works best for matrices with real eigenvalues
|
|
183
|
+
* and reasonably well-conditioned eigenvectors. For matrices with complex
|
|
184
|
+
* eigenvalues, only the real parts are used.
|
|
185
|
+
*
|
|
186
|
+
* @param A - Square matrix (n x n)
|
|
187
|
+
* @returns Object with J (Jordan form) and P (transformation matrix)
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* // Diagonal matrix with distinct eigenvalues
|
|
191
|
+
* jordanForm([[2,0],[0,3]]) // => { J: [[2,0],[0,3]], P: ... }
|
|
192
|
+
*/
|
|
193
|
+
export declare function jordanForm(A: number[][]): Promise<JordanResult>;
|
|
194
|
+
/**
|
|
195
|
+
* Compute the Moore-Penrose pseudoinverse of a DenseMatrix (Option A — Slice 4.2 primitive).
|
|
196
|
+
*
|
|
197
|
+
* Delegates to the DenseMatrix-based `matrixPinv` from `@danielsimonjr/mathts-matrix`,
|
|
198
|
+
* which uses full SVD with `rcond · max(S)` singular-value thresholding.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* const A = DenseMatrix.fromArray([[1,2],[3,4],[5,6]]);
|
|
202
|
+
* const Ap = pinv(A); // shape 2x3
|
|
203
|
+
* const Ap2 = pinv(A, { rcond: 1e-6 });
|
|
204
|
+
*/
|
|
205
|
+
export declare const pinv: import("typed-function").TypedFunction;
|
|
206
|
+
/**
|
|
207
|
+
* Compute the condition number of a matrix (ratio σ_max / σ_min via SVD).
|
|
208
|
+
*
|
|
209
|
+
* Returns `Infinity` for singular or rank-deficient matrices.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* cond([[1,0],[0,2]]) // => 2
|
|
213
|
+
* cond([[1,2],[2,4]]) // => Infinity
|
|
214
|
+
*/
|
|
215
|
+
export declare const cond: import("typed-function").TypedFunction;
|
|
216
|
+
/**
|
|
217
|
+
* Compute the spectral norm (2-norm) of a matrix — the largest singular value.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* norm2([[3,0],[0,2]]) // => 3
|
|
221
|
+
*/
|
|
222
|
+
export declare const norm2: import("typed-function").TypedFunction;
|
|
223
|
+
/**
|
|
224
|
+
* Compute the Frobenius norm of a matrix — `sqrt(sum(A_ij²))`.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* normFro([[1,0],[0,1]]) // => sqrt(2) ≈ 1.414
|
|
228
|
+
*/
|
|
229
|
+
export declare const normFro: import("typed-function").TypedFunction;
|
|
230
|
+
/**
|
|
231
|
+
* Compute a rank-k approximation of a matrix using truncated SVD.
|
|
232
|
+
*
|
|
233
|
+
* Returns the best rank-k approximation in the Frobenius-norm sense:
|
|
234
|
+
* `A_k = U[:, :k] * diag(S[:k]) * V[:, :k]^T`.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* lowRankApprox([[1,2],[3,4],[5,6]], 1)
|
|
238
|
+
*/
|
|
239
|
+
export declare const lowRankApprox: import("typed-function").TypedFunction;
|
|
240
|
+
/**
|
|
241
|
+
* Return the singular values of a matrix in descending order.
|
|
242
|
+
*
|
|
243
|
+
* The result has length `min(m, n)` and all values are non-negative.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* singularValues([[3,0],[0,2]]) // => [3, 2]
|
|
247
|
+
*/
|
|
248
|
+
export declare const singularValues: import("typed-function").TypedFunction;
|
|
249
|
+
/**
|
|
250
|
+
* Compute the matrix exponential via Padé-13 scaling-and-squaring.
|
|
251
|
+
*
|
|
252
|
+
* Dispatches on `DenseMatrix` (returns `DenseMatrix`) or `Array` (number[][],
|
|
253
|
+
* wraps in DenseMatrix, returns number[][]).
|
|
254
|
+
*
|
|
255
|
+
* Algorithm: Higham (2005) "The scaling and squaring method for the matrix
|
|
256
|
+
* exponential revisited." Accurate to near machine precision for general real
|
|
257
|
+
* matrices.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* matrixExpm(DenseMatrix.zeros(3, 3)) // => identity DenseMatrix
|
|
261
|
+
* matrixExpm([[0,0],[0,0]]) // => [[1,0],[0,1]]
|
|
262
|
+
* matrixExpm([[1,0],[0,1]]) // => [[e,0],[0,e]]
|
|
263
|
+
*/
|
|
264
|
+
export declare const matrixExpm: import("typed-function").TypedFunction;
|
|
265
|
+
/**
|
|
266
|
+
* Compute the principal matrix logarithm via inverse scaling-and-squaring
|
|
267
|
+
* with 16-point Gauss-Legendre quadrature for log(I + X).
|
|
268
|
+
*
|
|
269
|
+
* Dispatches on `DenseMatrix` (returns `DenseMatrix`) or `Array` (returns
|
|
270
|
+
* number[][]). Throws for matrices with non-positive or complex eigenvalues.
|
|
271
|
+
*
|
|
272
|
+
* Slice 5.9a limitations:
|
|
273
|
+
* - Non-positive eigenvalues: throws (principal log undefined).
|
|
274
|
+
* - Complex eigenvalues: throws.
|
|
275
|
+
* - Full Schur-based algorithm for non-diagonalisable A: Slice 5.9b.
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* matrixLogm(DenseMatrix.eye(3)) // => zero DenseMatrix
|
|
279
|
+
* matrixLogm([[Math.E,0],[0,Math.E]]) // => [[1,0],[0,1]]
|
|
280
|
+
*/
|
|
281
|
+
export declare const matrixLogm: import("typed-function").TypedFunction;
|
|
282
|
+
/**
|
|
283
|
+
* Compute the principal square root of a matrix.
|
|
284
|
+
*
|
|
285
|
+
* For symmetric positive semi-definite A: uses Newton iteration (robust for
|
|
286
|
+
* all non-negative eigenvalue cases). For general diagonalisable A: Newton
|
|
287
|
+
* iteration falling back to eigendecomposition.
|
|
288
|
+
*
|
|
289
|
+
* Dispatches on `DenseMatrix` (returns `DenseMatrix`) or `Array` (returns
|
|
290
|
+
* number[][]). Throws for matrices with negative or complex eigenvalues.
|
|
291
|
+
*
|
|
292
|
+
* Slice 5.9a limitations:
|
|
293
|
+
* - Negative eigenvalues: throws (complex sqrt not supported).
|
|
294
|
+
* - Complex eigenvalues: throws.
|
|
295
|
+
* - Full Schur-based Björck-Hammarling: Slice 5.9b.
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* matrixSqrtm(DenseMatrix.fromArray([[4,0],[0,9]])) // => [[2,0],[0,3]] DenseMatrix
|
|
299
|
+
* matrixSqrtm([[4,0],[0,9]]) // => [[2,0],[0,3]]
|
|
300
|
+
*/
|
|
301
|
+
export declare const matrixSqrtm: import("typed-function").TypedFunction;
|
|
302
|
+
export {};
|
|
303
|
+
//# sourceMappingURL=matrix-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix-ops.d.ts","sourceRoot":"","sources":["../../src/typed/matrix-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA2BH,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,GAAG,GAAG,MAAM,CAAC;AAgGlB;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wBAAwB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAyB/E;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,GAAE,GAAW,GAAG,MAAM,EAAE,EAAE,CAqDrE;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,GAAE,GAAW,GAAG,GAAG,CAc/D;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,cAAc,CAmCtD;AAMD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IACd,mEAAmE;IACnE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACf;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,gBAAgB,CAuE9D;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAwB5E;AA8FD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAMlE;AAqJD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IACd,sCAAsC;IACtC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACf;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAiB5E;AAMD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IACd,2DAA2D;IAC3D,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAwErE;AA+MD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,wCAIf,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,wCAEf,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,KAAK,wCAEhB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,OAAO,wCAElB,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,wCAExB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,wCAEzB,CAAC;AAMH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,wCAQrB,CAAC;AAMH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,wCAQrB,CAAC;AAMH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,wCAQtB,CAAC"}
|