151 Commits

Author SHA1 Message Date
jos
b0ec2d4739 Fixed undefined variables/globals 2018-06-13 18:09:19 +02:00
jos
0513898a4b Fix using new for side effects 2018-06-13 16:31:18 +02:00
jos
f1ce473457 Consistend camel case naming of variables and functions 2018-06-13 16:09:51 +02:00
jos
1f0a37a0cb Split initialized 'const' declarations into multiple statements 2018-06-13 15:31:37 +02:00
jos
b6b36bfd9b Use strict equality checks everywhere (=== and !==) 2018-06-13 15:02:21 +02:00
jos
17f07ec098 Fixed incompatibility with v4 (index.js file) 2018-06-13 14:02:50 +02:00
jos
b3b96749bf Refactored var into const/let, and removed a lot of semicolons 2018-06-13 12:21:14 +02:00
jos
934ea83df7 Fixed linting issues "Expected consistent spacing" 2018-06-12 21:38:11 +02:00
jos
024b2a9e26 Fix most lint errors using npx standard --fix 2018-06-10 20:28:27 +02:00
jos
635cd0b574 Revert using /lib/ in tests, use /src/ again. Fixed coverage testing. WIP 2018-06-06 22:11:52 +02:00
jos
79071b5e4f Fixed npm run test:browser not working (WIP) 2018-06-06 21:30:41 +02:00
jos
0c084b8e20 npm test working now 2018-06-06 15:36:36 +02:00
jos
f87ec1c6db Setup Babel compilation (WIP) 2018-06-06 14:31:33 +02:00
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 de Jong
7332993df7
Merge pull request #976 from ericman314/expm
Matrix exponential
2018-05-05 21:13:12 +02: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
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
99ab11b234 Dropped constant uninitialized 2018-02-04 13:09:09 +01:00
jos
326c9fb0de Fixed #680: compare strings by their numerical value instead of alphabetical order 2018-01-23 15:34:49 +01: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
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
033735c5e2 Implemented support for all types in compareNatural 2017-06-23 13:40:38 +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
ericman314
9ada8c9a9c Added tests for function/matrix/reshape.test.js 2017-02-27 20:40:47 -07:00
Pat Grasso
fbb023e7e1 Small fix of names in reshape.test.js
Change some straggling instances of `resize` (reshape tests borrowed
heavily from resize).
2017-02-24 10:19:58 -05:00
Pat Grasso
8e01076ec9 Merge branch 'matrix.reshape' into develop 2017-02-24 10:12:20 -05:00
Pat Grasso
df83968ec7 Add spec for reshape() in test/function/matrix
This spec tests `reshape()` with more cases than the one in
test/utils/array.test.js, including various types.

Also, in `_reshape()`, throw a brand new `DimensionError` instead of
modifying the caught one (the error message does not change when other
attributes are modified, as it is computed when the error is created).
2017-02-24 10:05:42 -05: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
b250ad0313 Change spec for output vector's shape for cross()
Depending on the input vectors' dimensions, either a 1-d vector or a 2-d
matrix should be returned.
2016-10-12 01:17:22 -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
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
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
2adf01e548 Getting/setting object properties working (still needs a refactoring step) 2016-01-02 15:16:12 +01:00
jos
931736658d Added support for getting/setting object properties to Index and math.subset 2015-12-04 09:53:35 +01:00
jos
91b56e117a Added support for strings in function concat 2015-06-17 20:26:44 +02:00
Rogelio J. Baucells
f2a179aa31 Merge branch 'josdejong/v2' into v2-Index
Conflicts:
	lib/core/typed.js
	lib/type/index/prototype/Index.js
2015-05-21 00:38:58 -04:00
Rogelio J. Baucells
7579412f7d Index dimension with immutable matrix 2015-05-20 17:41:03 -04:00
jos
d81fe279cc String input is now converted to numbers by default for all functions. Adding two strings will no longer concatenate them, but will convert the
strings to numbers and add them.
2015-05-19 22:18:40 +02:00
rjbaucells
c24235ec3b tests - final
missing file
2015-05-13 20:30:49 -04:00