179 Commits

Author SHA1 Message Date
jos
cf5c1c1af8 Fixes #1054: renamed eye to identity 2018-06-06 10:52:08 +02:00
jos
63d05479b4 Merge branch 'develop' into v5 2018-06-06 09:45:13 +02:00
Eric Mansfield
07a48b4209 Bug fix in inv.js 2018-06-01 18:54:56 -06:00
Eric Mansfield
f6e5a47cda Improved performance of determinant 2018-05-29 22:37:47 -06:00
Eric Mansfield
ad390e8903 Add pivoting to matrix inverse algorithm, and tests 2018-05-28 14:58:55 -06:00
jos
7c4920a9a3 Merge branch 'develop' into v5 2018-05-05 21:20:50 +02:00
jos
29aebc51b4 Updated history 2018-05-05 21:16:29 +02:00
Jos de Jong
7332993df7
Merge pull request #976 from ericman314/expm
Matrix exponential
2018-05-05 21:13:12 +02:00
Jack Schmidt
088ac99f65 ctranspose: Simplify method selection 2018-05-05 11:33:26 -04:00
Eric Mansfield
e46934541b Adjust return code in expm.js 2018-05-05 08:10:51 -06:00
Eric Mansfield
7d66e34bad Added support for SparseMatrix 2018-05-02 20:51:43 -06:00
Jack Schmidt
e1f0791574 Add complex transpose. A' now takes conjugate.
In matlab and octave the expression A' produces the Hermitian
conjugate, the complex conjugate of the transpose.

Now transpose produces the transpose, while ctranspose produces
the conjugate transpose. These are equal for real numbers, while
for complex numbers only the conjugate transpose is of much use.
2018-05-02 10:14:10 -04:00
jos
6308e5b7fc Added missing embedded docs 2018-05-02 09:51:08 +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
jos
0b9f22e9d8 Refactoring in handling DenseMatrix/SparseMatrix cases in most functions 2018-02-21 10:51:21 +01:00
jos
b9c30ebcc7 Updated some docs 2018-01-23 16:43:44 +01:00
ericman314
2ce60d2f3c Optimizations and fixes 2017-11-24 07:27:09 -07:00
ericman314
c4e8d9d524 Added example to function doc 2017-11-22 22:33:49 -07: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
jos
949261f92b Refactored usage of properties .isRange, .isIndex, .isResultSet, and .isHelp for their (safe) function equivalents 2017-08-12 13:31:09 +02:00
jos
fa01e993af Refactored x && x.isMatrix === true into type.isMatrix(x), same with isDenseMatrix and isSparseMatrix 2017-08-12 13:24:39 +02:00
jos
e10dd5bce5 Refactored x && x.isBigNumber === true into type.isBigNumber(x) 2017-08-12 11:54:53 +02:00
jos
9666c16378 Fixed #846: Issues in the functions map, forEach, and filter when used in the expression parser 2017-07-29 14:05:27 +02:00
jos
0557e7ae1f Back to compareNatural WIP (see #837) 2017-06-25 21:02:59 +02:00
jos
ae7728a1d4 Renamed compareNatural to deepStrictCompare 2017-06-23 13:50:27 +02:00
jos
151bc655d6 Implemented a first version of math.compareNatural 2017-06-18 21:13:31 +02:00
jos
f61bb6cf94 Fixed #856: function subset not returning non-primitive scalars from Arrays correctly 2017-05-16 21:41:03 +02:00
jos
c2c1888012 Fixed security vulnerabilities in math.subset 2017-04-22 13:58:26 +02:00
jos
52462a8e29 Released v3.10.2 2017-03-31 10:26:04 +02:00
ericman314
8b56efe670 Reshape now uses each matrix type's reshape function, if it exists 2017-02-27 20:17:53 -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
jos
ddb8fc4374 Released v3.9.0 2017-01-23 20:47:52 +01:00
Adam Kelly
4608afecc6 Change from multiply to multiplyScalar with kron 2017-01-22 18:46:11 +00:00
Adam Kelly
b564c20f19 Add Support for Complex Numbers in kron 2017-01-20 22:51:01 +00:00
Adam Kelly
44515ba7ed Add support for 1D Vectors in math.kron 2017-01-20 18:09:42 +00: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
Pat Grasso
30ae9c071f Change dimensionality of vector returned by cross()
If one of the input vectors/matrices has a dimension greater than 1, the
output vector will be a 1x3 matrix. Otherwise, the result will be a flat
3-component vector. Closes #716
2016-10-12 01:20:59 -04:00
patgrasso
a7f5bb27ef Extend cross() to support n-d vectors. Closes #716
Squeeze arrays before attempting to cross them so that n-dimensional
vectors can be cross multiplied (as long as only one direction has a
series of 3 elements)
2016-09-25 21:22:40 -04:00
jos
924694eeda Improved docs on transpose function (see #706) 2016-09-20 21:07:23 +02:00
jos
b016385fe0 Fixed #665: functions map, forEach, and filter now invoke callbacks which are a typed-function with the correct number of arguments 2016-05-18 22:10:34 +02:00
jos
b2066e53f6 Replaced toTex definitions using the default toTex template with "undefined" and a comment (see #636) 2016-04-15 11:00:03 +02:00
jos
8068f4afa8 Fixed #636: More strict toTex templates, reckon with number of arguments 2016-04-11 21:31:15 +02:00
jos
15aca5e4d0 Changed casing of the values of config options number and matrix to match the actual name of the classes. 2016-03-04 19:41:54 +01:00
jos
e2a3878ba9 Moved functions format and print to section string 2016-03-03 20:17:41 +01:00
jos
41949b2253 Fixed IndexError not always providing a max property 2016-02-29 20:41:52 +01:00
jos
12eee9e856 Moved filter, forEach, map, partitionSelect, sort from utils to matrix section 2016-02-27 20:00:42 +01:00
jos
499830c307 Fixed #88: typo in the docs of eye 2016-02-27 19:47:23 +01:00
jos
e0c82f1b01 Removed a few redundant clone operations 2016-02-26 21:08:37 +01:00