mathjs 11.12.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/HISTORY.md +54 -2
  2. package/README.md +1 -1
  3. package/lib/browser/math.js +1 -1
  4. package/lib/browser/math.js.LICENSE.txt +2 -2
  5. package/lib/browser/math.js.map +1 -1
  6. package/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js +4 -0
  7. package/lib/cjs/entry/pureFunctionsAny.generated.js +2 -0
  8. package/lib/cjs/expression/embeddedDocs/function/arithmetic/round.js +2 -2
  9. package/lib/cjs/expression/embeddedDocs/function/matrix/eigs.js +2 -2
  10. package/lib/cjs/expression/node/AssignmentNode.js +1 -1
  11. package/lib/cjs/expression/node/FunctionAssignmentNode.js +1 -1
  12. package/lib/cjs/function/algebra/derivative.js +8 -31
  13. package/lib/cjs/function/arithmetic/gcd.js +4 -5
  14. package/lib/cjs/function/arithmetic/mod.js +2 -9
  15. package/lib/cjs/function/arithmetic/round.js +59 -16
  16. package/lib/cjs/function/matrix/eigs/complexEigs.js +73 -68
  17. package/lib/cjs/function/matrix/eigs/{realSymetric.js → realSymmetric.js} +57 -51
  18. package/lib/cjs/function/matrix/eigs.js +118 -45
  19. package/lib/cjs/function/probability/pickRandom.js +2 -2
  20. package/lib/cjs/header.js +2 -2
  21. package/lib/cjs/type/number.js +2 -2
  22. package/lib/cjs/utils/number.js +1 -1
  23. package/lib/cjs/utils/snapshot.js +6 -6
  24. package/lib/cjs/version.js +1 -1
  25. package/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js +4 -0
  26. package/lib/esm/entry/pureFunctionsAny.generated.js +2 -0
  27. package/lib/esm/expression/embeddedDocs/function/arithmetic/round.js +2 -2
  28. package/lib/esm/expression/embeddedDocs/function/matrix/eigs.js +2 -2
  29. package/lib/esm/expression/node/AssignmentNode.js +1 -1
  30. package/lib/esm/expression/node/FunctionAssignmentNode.js +1 -1
  31. package/lib/esm/function/algebra/derivative.js +8 -31
  32. package/lib/esm/function/arithmetic/mod.js +2 -9
  33. package/lib/esm/function/arithmetic/round.js +40 -17
  34. package/lib/esm/function/matrix/eigs/complexEigs.js +73 -68
  35. package/lib/esm/function/matrix/eigs/{realSymetric.js → realSymmetric.js} +55 -51
  36. package/lib/esm/function/matrix/eigs.js +119 -47
  37. package/lib/esm/function/probability/pickRandom.js +2 -2
  38. package/lib/esm/type/number.js +2 -2
  39. package/lib/esm/utils/number.js +1 -1
  40. package/lib/esm/version.js +1 -1
  41. package/package.json +14 -14
  42. package/types/EXPLANATION.md +54 -0
  43. package/types/index.d.ts +6825 -6483
package/HISTORY.md CHANGED
@@ -1,9 +1,61 @@
1
1
  # History
2
2
 
3
- # 2023-10-25, 11.12.0
3
+
4
+ # 2023-11-17, 12.1.0
5
+
6
+ - Feat: Extend function `round` with support for units (#2761, #3095).
7
+ - Feat: Extend function `mod` with support for negative divisors in when
8
+ using `BigNumber` or `Fraction` (#3087).
9
+ - Fix: #3092 a typo in an error message when converting a string into a number.
10
+ - Fix: #3094 function `derivative` mutates the input expression when it fails.
11
+
12
+
13
+ # 2023-10-26, 12.0.0
14
+
15
+ Breaking changes:
16
+
17
+ - Fix #2879, #2927, #3014: change the confusing interface of `eigs` (#3037),
18
+ thanks @gwhitney.
19
+ Before, functions `eigs` returned an object:
20
+ ```
21
+ { values: MathCollection; vectors: MathCollection }
22
+ ```
23
+ where `vectors` was a 2d matrix of which the columns contained the vectors.
24
+ This is changed to `eigs` returning an object:
25
+ ```
26
+ {
27
+ values: MathCollection
28
+ eigenvectors: Array<{
29
+ value: number | BigNumber
30
+ vector: MathCollection
31
+ }>
32
+ }
33
+ ```
34
+ Where `eigenvectors` is an array containing an object with the corresponding
35
+ eigenvalue and vector.
36
+ - Refactored the TypeScript type definitions to make them work with a `NodeNext`
37
+ module resolution (#3079, #2919).
38
+ - Type `MathJsStatic` is renamed to `MathJsInstance`.
39
+ - Type `FactoryDependencies` is deprecated, use `MathJsFactory` instead, and
40
+ import dependency maps directly from the library.
41
+ - Change the assignment operator of `.toTex()` output from `:=` to `=` (see
42
+ #2980, #2987).
43
+ - Drop official support for Node.js 14 and 16.
44
+
45
+ Features:
46
+
47
+ - Function `eigs` now has an option to turn off calculation of eigenvectors
48
+ (#3057, #2180). Thanks @gwhitney.
49
+
50
+ Fixes:
51
+
52
+ - Find eigenvectors of defective matrices (#3037). Thanks @gwhitney.
53
+
54
+
55
+ # 2023-10-26, 11.12.0
4
56
 
5
57
  - Implemented function `subtractScalar` (#3081, #2643), thanks @vrushaket.
6
- - Fix #3073: function format not escaping control characters and double
58
+ - Fix #3073: function format not escaping control characters and double
7
59
  quotes (#3082).
8
60
  - Fix: function `clone` not throwing an error when passing an unsupported
9
61
  type like a function.
package/README.md CHANGED
@@ -135,7 +135,7 @@ A common case is to implement a new function. This involves the following steps:
135
135
  - Write documentation on the function in the source code comment of `myNewFunction.js`. This documentation is used to auto generate documentation on the website.
136
136
  - Write embedded documentation for the new function in `./src/expression/embeddedDocs/function/arithmetic/myNewFunction.js`. Add the new documentation to the index file `./src/expression/embeddedDocs/embeddedDocs.js`.
137
137
  - Write unit tests for the function in `./test/unit-tests/function/arithmetic/myNewFunction.test.js`.
138
- - Write a TypeScript definition for the new function in `./types/index.d.ts`, and write tests for it in `./types/index.ts`. Normally, two definitions need to be added: one for the static function `math.myNewFunction(...)` and one for the chained API `math.chain(...).myNewFunction(...)`.
138
+ - Write the necessary TypeScript definitions for the new function in `./types/index.d.ts`, and write tests for it in `./test/typescript-tests/testTypes.ts`. This is described in [./types/EXPLANATION.md](./types/EXPLANATION.md).
139
139
  - Ensure the code style is ok by running `npm run lint` (run `npm run format` to fix the code style automatically).
140
140
 
141
141