* added correlation function to statistics
* added implemenation for signature Matrix, Matrix and support for BigNumbers
* reverted changes to default for version numbers of devDepenencies
* reverted changes to default for version numbers of devDepenencies in package-lock.json
* change variable name from xArray, yArray to x and y
* added Matrix as param in index.d.ts
* corrected the file and function names for correlation function
* renamed createCorrelation to createCorr in factoriesNumber.js
* fixed failing test case for matrix and added params and return in corr
* Riemann Zeta Function
* Big Number zeta and added docs
* Original algorithm paper credited
* Update index.d.ts
* Update riemannZeta.js
* Update index.d.ts
* Renamed files to reflect zeta
* chore: make all the tests pass
* chore: refactor `zeta` (WIP)
* chore: reuse the validation logic of both number and BigNumber
* fix: type definitions of `zeta`
* fix: test the accuracy with numbers and BigNumbers (WIP)
* chore: make linter happy
* docs: fix example outputs
* docs: update history
* docs: update history
* docs: describe the limited precision of `zeta`
---------
Co-authored-by: BuildTools <anikpatel1322@gmail.com>
Co-authored-by: Anik Patel <74193405+Bobingstern@users.noreply.github.com>
* reange refactoring
* update authors
* Made _range to work also for _bigNumbers
* Range with units
* Included some Unit type in _range
* Included TypeScript types for function range
* Formatting
---------
Co-authored-by: David Contreras <david.contreras@guentner.com>
* Add Zpk2tf function
* Add zpk2tf function documentation
* Fix
* Add freqz function implementation
* Fix format
* Add freqz function documentation
* Fix
* Fix format
* Update index.d.ts
* Fix Dependency error
* Fix
* Fix index.d.ts
* Fix Documentation
* Fix Lint
* Fix index.d.ts
* Fix The Matrix parameter support and index.d.ts
* Fix Format
* Add Unit Tests for Matrix cases
* Fix Docs and Lint
* Add tests for coverage
* Fix Format
* Update AUTHORS
---------
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
* feat: extend function `fraction` with support for units (see #2918)
* fix: update the TypeScript definitions with the new `math.fraction(value: Unit)` support
* feat: implement `math.bignumber(value: Unit)`
* feat: update type definitions of function `math.bignumber`
* fix: linting issue
* feat: implement support for `math.number(unit)` (was formerly throwing an exception)
* refactor index.d.ts
* testTypes fixes
* add string to unaryPlus type
* add string to unaryPlus chain type
* use mathnumerictype instead and remove fraction from trigonometric functions
* code review
* code review
* Change types in matrix map() and forEach()
* Add new line in the end of index.d.ts
Signed-off-by: Jay Wang <xiao.hk1997@gmail.com>
---------
Signed-off-by: Jay Wang <xiao.hk1997@gmail.com>
Fix correct types for `multiply( number[][], number[] )`, `multiply( number[], number[][] )` and `multiply( number[][], number[][] )`
Type errors were introduced with https://github.com/josdejong/mathjs/pull/2623/files which used MathArray directly (where MathArray could be number[] or number[][]), causing the return type to be number[] | number[][].
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
* feat: add polynomialRoot function
This is intended as a benchmark for general arithmetic/basic algebra
functionality of mathjs, but was chosen to be something of potential
independent utility as well, worth adding to mathjs in its own right.
Currently ol=nly computes the numerical roots for real or complex
polynomials of degree three or less.
As usual, adds documentation, embedded documentation, tests, TypeScript
declaration, and TypeScript tests.
Also updates doc.test.js to make it easier to specify an array of complex
numbers as the expected output, and comapres with the appropriate fuzz
in such cases.
Finally, adds a benchmark that computes the roots of all cubics with
nonnegative integer coefficients no larger than five.
* doc: fix typo in polynomialRoot embedded docs
Thanks, SamuelTLG
* style: avoid slightly cryptic Boolean flag stand-in
* Added matrix functions `schur`, `sylvester` and `lyap`
* Added docs for `schur`, `sylvester` and `lyap`
* Added unit tests for `schur`, `sylvester` and `lyap`
* Fixed lint and tests errors
* fixed typescript and added Matrix + Array tests
* lint fixed
* fixed example in sylvester.js doc
* Fixed docs and ci
* fixed definition of lyap and sylvester
* remark on diff defs for lyap
* rm a trailing space
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
* fix#2603: added type definition for SymbolNode.onUndefinedSymbol and FuctionNode.onUndefinedFunction
* fix return type of onUndefinedFunction
* fix return type of onUndefinedFunction
* fix onUndefinedSymbol & onUndefinedFunction types, added examples
* update onUndefinedFunction ts example
* fix(pinv): write a typescript definition
* fix(pinv): write a typescript test
* fix(pinv): format types/index.ts
* fix(pinv): format types/index.ts
* fix(pinv): format types/index.d.ts
* fix(pinv): format types/index.ts
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
The TS type for pickRandom currently restricts the given array to numbers, however (AFAIK) it doesn't actually care what the array given to it contains.
This PR:
- Uses a generic to type the given array
- Varies the return type (T or T[]) depending on the given args