9 Commits

Author SHA1 Message Date
Jos de Jong
7332993df7
Merge pull request #976 from ericman314/expm
Matrix exponential
2018-05-05 21:13:12 +02:00
Harry Sarson
af417d8384
add use strict to the top of a bunch of files 2018-04-27 21:28:28 +01:00
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
ericman314
a2922641d3 Matrix exponential
Implementation of the matrix exponential with unit tests.

NOT tested with sparse matrices or with complex-valued matrices.
2017-11-22 22:28:34 -07:00
Pat Grasso
8e01076ec9 Merge branch 'matrix.reshape' into develop 2017-02-24 10:12:20 -05:00
Pat Grasso
6e5dfe5b46 Create an exportable function for reshape()
Add `reshape()` to the list of matrix functions so that it can be called
via `mathjs.reshape()`.
2017-02-24 09:18:36 -05:00
Adam Kelly
6e63a112a2 Add Kronecker Product (Direct / Tensor Product)
Adds Kronecker Product as math.kron(x, y);
2017-01-17 22:31:42 +00:00
jos
e2a3878ba9 Moved functions format and print to section string 2016-03-03 20:17:41 +01:00
jos
e9e87cd938 Refactored ones and zeros to typed-functions. Created an index.js file for all matrix functions. 2015-04-28 20:14:08 +02:00