171 Commits

Author SHA1 Message Date
jos
ab1b83a2f6 Remove generated files from repo, make tests independent from generated files 2019-05-12 15:14:13 +02:00
jos
427c39c33b Created ES5 and ES6 entry points 2019-04-28 20:56:08 +02:00
jos
f4d4180cea Move all entry files under ./src/entry 2019-04-24 10:48:01 +02:00
jos
6081360d6a Merged develop into modular_architecture 2019-04-13 16:51:51 +02:00
jos
e6c5df5af5 Fix merge conflicts in row+column PR 2019-03-21 21:51:05 +01:00
SzechuanSage
8090297271 Flatten mocha tests for row and column functions 2019-03-21 21:56:49 +10:00
bnlcas
128ed3cd9f Create apply utility request 1359 (#1411)
* add placeholder for apply function

* added apply function

* add test coverage for apply utility

* stylsitic name change in apply source code

* stylistic format change to test

* improved description of function parameters

* moved the apply function to the public matrix functions

* update location and reference of unit test

* fixed function reference paths in apply for location in function

* changed path to apply in apply.test

* make apply a typed function, update unit test

* added typing error test to coverage

* remove apply.test.js from the utils test function

* added transform function for apply

* add unit test for apply.transform.js
2019-03-17 20:15:38 +01:00
Jos de Jong
f9201affba
Merge branch 'develop' into develop 2019-03-10 16:33:12 +01:00
Eric Mansfield
30b45d8633 Fuzzy range endpoint (#1434)
* Fixed unit base recognition and formatting for user-defined units

* Began writing tests for range

* Use fuzzy comparisons for detecting range endpoint
2019-03-10 13:39:13 +01:00
SzechuanSage
4823dcdce1 Fix row and column function tests to use row and column functions 2019-03-08 22:56:18 +10:00
SzechuanSage
6e1caa67dd Add tests for matrix functions row and column 2019-03-08 22:26:56 +10:00
jos
99da53da0e Flatten everything in a mathjs instance to make it consistent with the ES6 exports. Create deprecation warnings for the old classes and functions 2019-02-07 21:24:51 +01:00
jos
869d4960f9 Create and use factory.js to import all dependencies in main instance. Deprecate all old nested index.js files. 2019-01-30 14:38:47 +01:00
jos
5dd0a9ba9c Get bundle working (with lazy loading) 2019-01-02 10:03:05 +01:00
jos
f6b524a966 Use object destructuring in factory function callback. Rename typeof to typeOf. Only pass dependencies in scope to factory function. 2018-11-06 09:17:21 +01:00
jos
a2ae756fd1 Remove semicolons 2018-10-31 21:18:51 +01:00
jos
247aeabffa Refactor all unit tests to ES6 import/export 2018-10-31 21:17:23 +01:00
greenkeeper[bot]
c5971b371a Update standard to the latest version 🚀 (#1226)
* chore(package): update standard to version 12.0.0

* update to new lint version with --fix

I believe this mainly adds whitespace to `{}`'s.

* Replace assert.equal with assert.strictEqual

This breaks a lot of tests which I will endevour to fix in the next
commits.

* Fix most errors due to assert.strictEquals

Some instances of `strictEquals` are replaced by `deepEquals`.
`toString` has been used to make some string comparisions explicit.
Tests will still fail untill #1236 and #1237 are fixed.

* Fix assertion erros due to -0

With node 10, assert.strictEqual no longer considers `0 === -0`.
I missed these first time round as I was using node 8.

* Put toString correct side of bracket

I was converting the constructor to a string rather
than the result of the computation. Oops.

* Fixed #1236: quantileSeq has inconsistant return

* Update package-lock

* Fixed #1237: norm sometimes returning a complex number instead of number

* Fix cli tests

* More changes for standardjs, and fixes in unit tests
2018-09-08 16:33:58 +02:00
jos
6085021d0c Fix more unit tests broken on Nodejs 6 and 8 (no proper NaN assertions) 2018-08-21 21:32:22 +02:00
jos
b6ab40cf88 Fixed #1214: median and other functions not neatly handling NaN 2018-08-21 21:16:15 +02:00
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