Henrique Ferrolho 308d55dac4 Adds matrix function math.sqrtm(A) (#1086)
* Adds Matrix function math.sqrtm(A)

The current implementation is based on the Babylonian iterative method

* Removing default parameter as they are only supported from ES6/ES2015 onwards

* Increases the robustness of the `math.sqrtm()` Babylonian iterative method

* Adds Denman–Beavers iteration method to compute `X*X = A`

The Babylonian method is numerically unstable and more likely to fail to converge. For that reason, the Denman–Beavers iteration method is the one being used in the current version.

* Adds LaTeX for math.sqrtm(A)

* Updates `math.sqrtm(A)` suggestions list

* Forgot to require latex...

* Adds unit tests for `math.pow(math.sqrtm(A), 2) == A`

* Switches from SyntaxError to Error

Edits error message

* Adds unit tests for non-square matrices and LaTeX conversion

* Changes according to feedback

- Removes Babylonian method implementation;
- Adds unit tests for BigNumber matrices
- sqrtm.test.js refactoring
- Edits LaTeX conversion

* Ensures input/output type persistence

* Changes math.deepEqual to assert.deepEqual (or to approx.deepEqual where appropriate)

* Fixes BigNumber unit test
2018-04-27 22:00:00 +02:00

28 lines
582 B
JavaScript

module.exports = [
require('./concat'),
require('./cross'),
require('./det'),
require('./diag'),
require('./dot'),
require('./eye'),
require('./filter'),
require('./flatten'),
require('./forEach'),
require('./inv'),
require('./kron'),
require('./map'),
require('./ones'),
require('./partitionSelect'),
require('./range'),
require('./reshape'),
require('./resize'),
require('./size'),
require('./sort'),
require('./sqrtm'),
require('./squeeze'),
require('./subset'),
require('./trace'),
require('./transpose'),
require('./zeros')
];