Skip to content

Commit

Permalink
2.0.0-alpha.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Jan 23, 2022
1 parent 6d05897 commit a64b347
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ const r = await mean.evalAsync(inputArray);
* [Parameters](#parameters-2)
* [Examples](#examples-2)
* [reduce](#reduce)
* [Parameters](#parameters-4)
* [Examples](#examples-4)
* [Parameters](#parameters-3)
* [Examples](#examples-3)
* [maxParallel](#maxparallel-1)
* [Expression](#expression-1)
* [Parameters](#parameters-5)
* [Examples](#examples-5)
* [Parameters](#parameters-4)
* [Examples](#examples-4)

## toString

Expand Down Expand Up @@ -284,7 +284,8 @@ Otherwise it will return a new array.

### Parameters

* `target` **TypedArray\<T>?** array in which the data is to be written
* `threads` **TypedArray\<T>?** number of threads to use, 1 if not specified
* `target` **TypedArray\<T>?** array in which the data is to be written, will allocate a new array if none is specified
* `array` **TypedArray\<T>** for the expression to be iterated over
* `iterator` **string** variable name
* `arguments` **...(Array<(number | TypedArray\<T>)> | Record\<string, (number | TypedArray\<T>)>)** of the function, iterator removed
Expand All @@ -311,25 +312,10 @@ const r2 = expr.map(array, 'x', {f: 0, c: 0});

expr.mapAsync(array, 'x', 0, 1000, (e,r) => console.log(e, r));
expr.mapAsync(array, 'x', {f: 0, c: 0}, (e,r) => console.log(e, r));
```

Returns **TypedArray\<T>**&#x20;

### Parameters

* `target` **TypedArray\<T>?** array in which the data is to be written
* `array` **TypedArray\<T>** for the expression to be iterated over
* `threads` **number** number, must not exceed Expression.maxParallel
* `iterator` **string** variable name
* `arguments` **...(Array<(number | TypedArray\<T>)> | Record\<string, (number | TypedArray\<T>)>)** of the function, iterator removed

### Examples

```javascript
// Clamp values in an array to [0..1000]
const expr = new Expression('clamp(f, x, c)', ['f', 'x', 'c']);

await expr.mapMPAsync(array, expr.maxParallel, 'x', 0, 1000);
// Using 4 multiple parallel threads (OpenMP-style parallelism)
const r1 = expr.map(4, array, 'x', 0, 1000);
const r2 = expr.map(4, array, 'x', {f: 0, c: 0});
```

Returns **TypedArray\<T>**&#x20;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"codecov": "cd coverage && curl -s https://codecov.io/bash | bash"
},
"name": "exprtk.js",
"version": "1.0.0",
"version": "2.0.0-alpha.0",
"description": "JS Mathematical Expression Toolkit Library",
"repository": {
"type": "git",
Expand Down

0 comments on commit a64b347

Please sign in to comment.