1743 Commits

Author SHA1 Message Date
Jos de Jong
7833e237a2
Fix #1808: toNumber() not working on a unitless unit (#1811) 2020-04-08 16:12:42 +02:00
Veeloxfire
f6a8a23e8b
Prefix the cli test with 'node' so it works on windows (#1807)
* Prefix the cli test with 'node' so it works on windows

Shouldnt provide any issues for other systems I hope

* Revert "Prefix the cli test with 'node' so it works on windows"

This reverts commit 4cd270493aeba0a9fad1661258c7ccc286934f53.

* Revert "Revert "Prefix the cli test with 'node' so it works on windows""

This reverts commit 268b5949a817fd416dbada72f1334ccaac0e3dfa.

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-04-08 13:58:12 +02:00
Veeloxfire
fae65276ba
Should be able to take NAMED_DELIMITER as object keys (#1798)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-04-04 17:14:39 +02:00
jos
5624e6938f Fix #1789: Function eigs not calculating with BigNumber precision when input contains BigNumbers 2020-03-29 16:17:19 +02:00
David Bramwell
88733f70af
Let simplify handle a/(b/c) (#1734)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-02-04 20:34:37 +01:00
jos
1d5ad22296 Remove redundant code causing a vague error, see #1724 2020-02-04 20:30:35 +01:00
jos
0c863f4e07 Fixed #1727: validate matrix size when creating a DenseMatrix using fromJSON 2020-02-01 17:37:34 +01:00
jos
b9246d9a45 Replace Array.fill with a helper function, replace var with let/const, return .values as Matrix too when input is a Matrix. See #1705 2020-01-20 20:08:34 +01:00
Arkajit Mandal
0b188e385c Adding eigs function (#1705)
* eigs test file initialize

* file for function for diagonalization of a real symmetrix matrix

* eigs typed function written according to mathjs requirements

* some linting issues addressed

* more linting issues in eigs

* linting passed for eigs (blank template function)

* making eigs fail

* eigs added to factory any

* initial check of input in eigs

* linting issues fix in eigs

* added rotation and theta matrix

* diagonalization loop added

* diagonalization result return

* diagonalization returns eigenvalue and eigenvectors

* function for updating Sij

* function for updating matrix

* a small bug fix

* some linting fixed in eigs

* lint and bug fix at eigs

* linting passed in eigs

* tests for input in eigs

* tests for trivial eigenvalue problem (sanity check)

* 2x2 check for non-diagonal matrix

* sorting added to eigs

* sorting function lint fix in eigs

* example for eigs updated

* 3x3 diagonalization by eigs passed

* bug in eigenvector

* eigenvalues seem to work

* cloning array so that original matrix do not get transformed in eigs

* eigenvector check

* eigenvector deep check and eigs description modified

* embedding dos for eigs

* doc for eigs fix

* slight change in example

* adding checkInput type

* type error for bad matrix elements

* type error for every element

* name change for typecheck function

* check matrix type of array input

* type error message update in eigs

* type error message grammer in eigs

* eigs bug fix

* eigs bug fix in check function

* eigs typecheck test

* some lint fix in eigs and corresponding tests

* before adding bingNumber implementation in eigs

* support for fractions

* obtain angle for bigNumber type

* theta for bignumbers

* update overlap for bigNumber

* jacobi rotation of input matrix for BigNumbers

* largest element for bigNumbers

* diagonalization for bigNumbers

* adding dependedncies

* diagonization for bigNumber

* diag for bigNumber is tested

* linting fix for eig and eigs test

* problem for bigNumber fix

* error message modification for eigs

* more coverage for eigs function

* eigs test bug fix

* simplify test

* is Symmetric function

* use matrix instead in eigs

* slight cleanup

* is symmetric bug fix

* no need to return in isSymmetrix

* small bug fix for fractions

* using scalar function when possible

* small lint correction

* return object in eigs

* bug fix in array eigs

* test object implementation

* description update

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-01-20 19:50:07 +01:00
Eric Mansfield
97ff95b32c Added baseName option to createUnit (#1708)
* Fixed unit base recognition and formatting for user-defined units

* Added baseName option to createUnit

* Trailing spaces

* Fixed line in docs
2020-01-08 10:23:23 +01:00
Veeloxfire
10449b2326 Extend distance with support for n-dimensions 2020-01-04 21:03:53 +01:00
Bartosz Leoniak
1f10538588 Improve performance of factorial for BigNumbers (#1691) 2019-12-31 11:31:35 +01:00
jos
e447c0df03 Update Safari version in BrowserStack testing 2019-12-15 22:05:22 +01:00
jos
af74db9c33 Update android version in BrowserStack testing 2019-12-15 21:57:54 +01:00
jos
d20be9b67f Update firefox and chrome versions in BrowserStack testing 2019-12-15 21:50:38 +01:00
jos
fd6d627b66 Revert updating browser versions for BrowserStack 2019-12-15 21:42:05 +01:00
jos
e798a72d05 Update versions of BrowserStack browsers 2019-12-15 10:04:00 +01:00
jos
aa2681552c Fix mismatch in console label and actual calculation 2019-12-15 09:40:13 +01:00
jos
08de8781b4 Fix linting issues (see PR #1690) 2019-12-15 09:36:19 +01:00
kmdrGroch
b52541d5f4 feat: factorial benchmark 2019-12-11 00:22:52 +00:00
jos
b9175a1a29 Fixed IndexNode using a hardcoded, one-based implementation of index. See #782 2019-11-20 12:23:06 +01:00
Harry Sarson
462f46947f fix qr and sign edge cases (#1670)
* fix qr and sign edge cases

qr() was throwing an error if the pivots of a matrix were zero.
This commit fixes that and ensures that the results are consistant
with wolfram alpha.

Whilst doing this I found a bug in complex.js, I have added a work
around but we should flag this upstream.

I also addressed the long standing concerns about assert statements
within the body of the qr function.

Fixes #1669
Fixes #942

* further improvements to qr and sign

mainly fixing things I got wrong in previous commit

* add array test

* fix: remove only from tests and disallow

Uses mochas `--forbid-only` flag as advised by
https://github.com/standard/standard/issues/988
2019-11-18 20:03:09 +01:00
jos
3526f651bf Add small benchmark for primes (see #1641) 2019-10-06 10:41:37 +02:00
Clinton Curry
69dd165afb Allow taking means of quantities with units. (#1644)
* Allow taking means of quantities with units.

* Fix silly error in test.

The test as written did not test anything about units.

* Fix same error again...
2019-10-03 20:28:25 +02:00
jos
7b1cd7753e Fixed #1628: Cannot call methods on empty strings or numbers with value 0 2019-09-23 20:23:39 +02:00
Rian McGuire
a8d94cbbeb Copy IndexNode dotNotation property in map and clone methods (#1623)
* Copy dotNotation in IndexNode.prototype.map

* Copy dotNotation in IndexNode.prototype.clone
2019-09-20 20:11:18 +02:00
jos
e37cc81735 Fixed #1606: function format not working for expressions 2019-08-29 10:17:57 +02:00
Waseem Yusuf
c0e87c4b71 Make combinationsWithRep.js more efficient (#1602)
* Implemented the `multicombinations` function

* Write unit tests for `multicombinations` function

* Integrate the `multicombinations` function throughout codebase

1. Include multicombinations factory function in factoriesAny.js and factoriesNumber.js
2. Write embedded docs for multicombinations
3. Added latex support
4. Refer to multicombinations in the "see also"-section of related functions

* Change name from `multichoose` to `combinationsWithRep`

* Update combinationsWithRep.js

Instead of always cancelling `n-1 factorial` from the denominator and ignoring `k factorial`, added a conditional to cancel the the larger of the two, therefore further reducing redundant calculations.

* Revert "Update combinationsWithRep.js"

This reverts commit efef6d3bd4c381aa12f00869a7624a622268805c.

* Update combinationsWithRep.js

Instead of always cancelling `n-1 factorial` from the denominator and ignoring `k factorial`, added a conditional to cancel the the larger of the two, therefore further reducing redundant calculations.

* Add one more test for the case: k > n-1

* Refactor single for-loop into two separate ones
2019-08-28 15:10:24 +02:00
Harry Sarson
e0adfb3e37 Ignore use of template literals in normal strings for latex
Mathjs latex uses same syntax as template literals, thus we need to
ignore some otherwise helpful rules that look for template literal
syntax in normal strings.
2019-08-21 10:09:10 +01:00
Harry Sarson
b6a42c032d run standard --fix 2019-08-21 10:09:10 +01:00
Waseem Yusuf
4cee37232f Added a combinationsWithRep function to calculate combinations with repitition (#1588)
* Implemented the `multicombinations` function

* Write unit tests for `multicombinations` function

* Integrate the `multicombinations` function throughout codebase

1. Include multicombinations factory function in factoriesAny.js and factoriesNumber.js
2. Write embedded docs for multicombinations
3. Added latex support
4. Refer to multicombinations in the "see also"-section of related functions

* Change name from `multichoose` to `combinationsWithRep`
2019-08-15 11:35:51 +02:00
jos
202cecc39a Fix generated files not compiled into ./es folder 2019-08-05 22:08:57 +02:00
jos
9991449ce0 Generate ESModules transpiled to ES5 2019-08-05 21:19:00 +02:00
jos
021485922a Fix broken unit test 2019-07-20 14:14:33 +02:00
jos
d8a4f3a00a Update to standard@13.0.2 2019-07-20 13:46:31 +02:00
jos
deb7c05b53 Fix #1550: nested user defined function not receiving variables of an outer user defined function 2019-07-07 10:56:01 +02:00
jos
c147d54435 Fix not being able to set configuration after disabling function import 2019-06-11 20:40:07 +02:00
jos
bce068e601 Update browser versions tested against with BrowserStack 2019-06-05 11:50:32 +02:00
jos
db4910bed4 Move all test related stuff in folder test 2019-06-05 11:45:02 +02:00
jos
35fc780d2a Refactor import to first flatten the functions and then import them, allowing to import dependency collections 2019-06-05 10:57:48 +02:00
jos
41efed79d3 Fix #1473: remove 'use strict' in every file 2019-05-26 20:21:18 +02:00
jos
f54599a701 Fix #1530: apply rounding first and lowerExp and upperExp second when formatting a number 2019-05-25 15:51:33 +02:00
jos
45344e8d9e Fix another round-off error in unit tests of in units on IE/Edge 2019-05-25 15:29:52 +02:00
jos
9a6c79afe8 Fix round-off error in constant reducedPlanck on IE and Edge 2019-05-25 15:12:16 +02:00
Eric Mansfield
c08188b8ed Updated physical constants to 2019 recommended values (#1529) 2019-05-25 14:48:37 +02:00
jos
859cac81a1 Merged function core and create into one function create 2019-05-22 21:20:56 +02:00
Vlad Levitskiy
538823386a deleted decibel unit (#1524) 2019-05-22 17:06:19 +02:00
jos
e5048a8001 Allow math.import(all). Dropped support for renaming factory functions 2019-05-22 13:49:56 +02:00
Vlad Levitskiy
3516731ff6 Fixed tonne and candela units, added bel and dB (#1518)
* fixed tonne and candel units, added bel and dB

* fixed code style
2019-05-20 20:41:10 +02:00
jos
28e33bb89b Merge remote-tracking branch 'origin/v5' into develop
# Conflicts:
#	package-lock.json
#	package.json
2019-05-17 19:44:25 +02:00