2045 Commits

Author SHA1 Message Date
Jos de Jong
aa6f41be99 fix: Index.dimension(dim) accepting non-numeric input 2024-11-04 10:54:58 +01:00
Jos de Jong
dd0eac640e chore: fix linting issues 2024-10-23 10:30:07 +02:00
gauravchawhan
f76c751f34
chore: hyperexecute Integrations (#2874) 2024-10-23 10:26:58 +02:00
Jmar L. Pineda
7f810d1b7e
feat: speed up the map() and forEach() functions in DenseMatrix.js (#3251)
* Optimize the map and forEach functions in DenseMatrix.js

* Changed index back to Array from Uint32Array and clone it using index.slice(0) instead of [...index]

* Fixed merge conflicts with the fast callback optimization

* Fixed the documentation for _forEach()

* Fixed _forEach comment and made it return an immutable index array

* Resolved DenseMatrix unit test suggestions

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-09-27 14:36:45 +02:00
Jos de Jong
fb76ac419d fix: #3267 implicit multiplication with a negative number and unit in 2024-09-18 11:08:29 +02:00
David Contreras
367c0d3d1e
chore: improve performance of functions map, filter and forEach (#3256)
* Implement reduceCallback

* Add jsdocs

* implement simplifyCallback in other functions

* Moved recurse to array.js

* Format

* Separate transform callback

* forEach transform

* Renamed applyCallback to simplifyCallback

* Simplified index transform

* renamed to reducedCallback and simplifiedCallback to simpleCallback

* chore: fix linting issue

* Added forEach benchmark

* renamed simplifyCallback to optimizeCallback

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-09-11 11:32:17 +02:00
Jos de Jong
0f87a7b6c3 chore: fix linting issue 2024-09-04 16:17:09 +02:00
Jos de Jong
76e23d1954 chore: extend the map.js benchmark 2024-09-04 16:11:34 +02:00
Jos de Jong
d1ecf44e2f fix: #3253 cannot use identifiers containing special characters in function derivative 2024-09-04 12:19:46 +02:00
Jos de Jong
4c64018a79 fix: #3246 add type definitions for function leafCount 2024-09-04 11:35:39 +02:00
Jos de Jong
4d91f10095 fix: #3259 function symbolicEqual missing in the TypeScript definitions 2024-09-04 11:06:21 +02:00
Jos de Jong
6b743d07b8 chore: fix broken benchmark 2024-09-04 10:01:43 +02:00
Jos de Jong
ed2cce4d17
fix: various security vulnerabilities (#3255)
* fix: disable parser functions in the CLI (security issue)

* fix: ensure `ObjectWrappingMap` doesn't allow deleting unsafe properties (security issue)

* fix: enable using methods and (safe) properties on plain arrays

* docs: update the "Less vulnerable expression parser" section in the docs

* chore: fix typos and linting issues

* chore: keep functions like `simplify` enabled in the CLI

* docs: update the security page

* fix: ensure `ObjectWrappingMap.keys` cannot list unsafe properties

* fix: when overwriting a rawArgs function with a non-rawArgs function it was still called with raw arguments

* docs: fix a typo
2024-08-27 16:42:46 +02:00
David Contreras
bcf0da46f0
feat: support multiple inputs in function map (#3228) 2024-08-22 13:35:21 +02:00
Jos de Jong
88a4b35e9d chore: add a benchmark testing DenseMatrix.map(...) and DenseMatrix.forEach(...) (see #3251) 2024-08-21 14:59:09 +02:00
David Contreras
459ae13725
docs: spelling fixes in the embedded docs (#3252)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-08-21 14:30:40 +02:00
David Contreras
c8e4bbd573
fix: function map not always working with matrices (#3242)
* Removed maxArgumentCount in favor of applyCallback

* Making a pure _recurse function

* Added cbrt tests, removed unnecesary changes in functions.

* Fixed main bottleneck

* Restored back function before unintended change

* Fix format

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-08-01 15:54:20 +02:00
Jos de Jong
a1eec936fc
feat: export util functions for maps and improve documentation of scope (#3243)
* feat: export util functions `isMap`, `isPartitionedMap`, and `isObjectWrappingMap` and improve the documentation of `scope` (see #3150)

* chore: fix broken unit tests

* docs: refine the explanation about scopes
2024-08-01 10:57:23 +02:00
David Contreras
cf24943d4c
feat: add matrix datatypes in more cases (#3235) 2024-07-30 19:48:19 +02:00
Orel Ben Neriah
f5a5463b0d
fix: types static methods and members for Unit class (#3230)
* fix: types static method for Unit class

Changes unit interface to declare class to enable the adding of static methods.

* refactor: change to not using declare class

* fix: adds more unit static methods and updates tests

* chore: moves test from wrong location

* fix: adds additional static methods and updates jsDocs

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-07-11 13:26:50 +02:00
Vistinum
975d1ba800
fix: use exact values for US liquid volume units (#3229)
1 US gallon is defined as 231 cubic inches, which is exactly 3.785411784 L (since 1 inch is defined as 25.4 mm). Other units are defined against the gallon.

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-07-11 13:16:46 +02:00
Jos de Jong
c118eaec90 fix: #3232 fix type definitions of function format to support notations hex, bin, and oct 2024-07-11 13:12:27 +02:00
Adam Jones
1db2ba6d3b
Further improve quantileSeq typings (#3223)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-06-28 12:15:09 +02:00
Orel Ben Neriah
3f6567a231
fix: #2348 update type definitions of the Parser methods (#3226)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-06-28 11:49:53 +02:00
David Contreras
5785cb95f1
Broadcast refactor (#3220) 2024-06-19 18:51:37 +02:00
Lucas Eng
eb35274447
chore: add unit tests for deepMap, isCollection, and reduce 2024-06-03 20:12:36 +02:00
Jos de Jong
fe4667cd8f Merge branch 'refs/heads/develop' into v13
# Conflicts:
#	AUTHORS
#	package-lock.json
2024-05-31 14:09:56 +02:00
Jos de Jong
ab3461d484
feat: implement support for bigint (#3207, #2737) 2024-05-31 12:43:09 +02:00
Lucas Eng
e8b1e0d293
chore: added test cases to deepForEach (#3211) 2024-05-30 17:04:49 +02:00
Jos de Jong
1f05a35d68
chore: convert CJS files to ESM (#3204) 2024-05-22 08:46:14 +02:00
Jos de Jong
f5755e71dc Merge branch 'refs/heads/develop' into v13 2024-05-21 16:09:28 +02:00
Adam Jones
ffa3a2e20a
Improve quantileSeq typings (#3198)
* Improve quantileSeq typings

* Add tests, revert comment changes

* Fix type tests
2024-05-16 08:47:13 +02:00
Jos de Jong
31b68ced13 chore: adjust isPositive, isNegative, and isZero to the new relTol and absTol 2024-05-15 11:12:19 +02:00
Jos de Jong
95a8c9477c chore: move sinon to devDependencies and fix two typos 2024-05-15 11:06:26 +02:00
David Contreras
eded7e1dc3
feat: nearly equal with relative and absolute tolerance (#3152)
* nearlyEqual with absolute and relative tolerances

* Format

* nearlyEqual for bigNumber

* Added skip for NaN

* Reduce diff a bit

* Issue with examples in jsdcos

* Updated all calls for nearlyEqual

* Fixed failing tests

* Changed epsilon to relTol, absTol

* Changed references to epsilon in docs and tests

* Added warning for config.epsilon

* Fix warning in zeta.test

* Added config test

* Added sinon to test console.warn

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-05-15 10:56:11 +02:00
Jos de Jong
5ee9f6f8d6 Merge branch 'refs/heads/develop' into v13 2024-05-15 10:51:15 +02:00
Jos de Jong
da0c70ebe3 fix: serialization of Units without a value, see #1240 2024-04-29 10:40:57 +02:00
Jos de Jong
d97f338fcc chore: replace util functions values and contains and usages of indexOf with using native JS functions values and contains (see #3194) 2024-04-25 08:35:49 +02:00
Laurent Gérin
81d2e71445
fix #3192: function isNaN returns false for NaN units in a matrix or array
* Use referToSelf() to recursively check if various types are NaN in an array or matrix

* fix array test description from isNegative to isNaN

* Add test for units in a matrix

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-04-24 09:31:06 +02:00
Jos de Jong
2e427ec3a9 fix: #3180 fix type definitions of function add and multiply to allow
more than two arguments
2024-04-03 09:27:12 +02:00
Jos de Jong
becae3775f fix: #3175 cannot delete units using math.Unit.deleteUnit 2024-03-13 16:35:52 +01:00
Jos de Jong
a41def8360 fix: #3172 simplify "true and true" 2024-03-13 14:25:56 +01:00
Jos de Jong
50b15a751d fix #3163: toTex wrongly returning Infinity for large BigNumbers 2024-02-23 11:20:17 +01:00
Jos de Jong
f37d4154ad Merge branch 'develop' into v13 2024-02-22 17:19:48 +01:00
Jos de Jong
f504ffe1d3 chore: update devDependencies (most notably eslint) 2024-02-22 16:27:24 +01:00
Brian Fugate
85b65da6cb
Fix: #3100 function round not handling round-off errors (#3136)
* Fixing rounding bug from issue 3100

* Corrected syntax and converted if...else to logic using ternary operator

* Removing nearlyEqual comparison because a false
return value was mathematically impossible by
user input.

Adding dynamic epsilon logic to cover cases when
a user requests to round a number to a higher
precision than epsilon in the config file.

Also adding tests to cover dynamic epsilon cases.

* Removing dynamic epsilon and adding test for changing config.epsilon during runtime

* Reintroducing nearly equal verification for
round function.

Adding test case for changing epsilon at runtime.

Both tests for changing epsilon at runtime also
verify the false nearlyEqual scenario.

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-02-22 16:17:05 +01:00
Rich Martinez
b78ac811a4
fix: mode signature return types (#3153)
* fix: mode type signatures

* Add ts tests for mode

* Add assertions mode type tests

* Update author Rich in AUTHORS file

---------

Co-authored-by: Rich Martinez <richmartinez@Edinas-MacBook-Pro.local>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-02-21 12:36:40 +01:00
Jos de Jong
663bbea40d fix: linting issue 2024-02-21 12:23:05 +01:00
Jos de Jong
a7f84abe51 fix: PartitionedMap and ObjectWrappingMap missing a property
`Symbol.iterator`
2024-02-21 12:17:30 +01:00
David Contreras
065b3ae4e8
feat: trailing commas in matrices (#3154) 2024-02-15 13:35:19 +01:00