Skip to content

Commit 0fd77bb

Browse files
committed
2.0.0
1 parent fe084aa commit 0fd77bb

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ const r = await mean.evalAsync(inputArray);
128128
### Table of Contents
129129

130130
* [toString](#tostring)
131+
* [allocator](#allocator)
131132
* [expression](#expression)
132133
* [maxActive](#maxactive)
133134
* [maxParallel](#maxparallel)
@@ -146,7 +147,9 @@ const r = await mean.evalAsync(inputArray);
146147
* [reduce](#reduce)
147148
* [Parameters](#parameters-3)
148149
* [Examples](#examples-3)
150+
* [allocator](#allocator-1)
149151
* [maxParallel](#maxparallel-1)
152+
* [type](#type-1)
150153
* [Expression](#expression-1)
151154
* [Parameters](#parameters-4)
152155
* [Examples](#examples-4)
@@ -157,6 +160,12 @@ Get a string representation of this object
157160

158161
Returns **string** 
159162

163+
## allocator
164+
165+
Return the data type constructor
166+
167+
Type: TypedArrayConstructor
168+
160169
## expression
161170

162171
Return the expression as a string
@@ -239,8 +248,14 @@ const result = new Float32Array(P.length);
239248
// sync
240249
density.cwise({phi, T, P, R, Md, Mv}, result);
241250

251+
// sync multithreaded
252+
density.cwise(os.cpus().length, {phi, T, P, R, Md, Mv}, result);
253+
242254
// async
243255
await density.cwiseAsync({phi, T, P, R, Md, Mv}, result);
256+
257+
// async multithreaded
258+
await density.cwiseAsync(os.cpus().length, {phi, T, P, R, Md, Mv}, result);
244259
```
245260

246261
Returns **TypedArray\<T>**&#x20;
@@ -313,9 +328,9 @@ const r2 = expr.map(array, 'x', {f: 0, c: 0});
313328
expr.mapAsync(array, 'x', 0, 1000, (e,r) => console.log(e, r));
314329
expr.mapAsync(array, 'x', {f: 0, c: 0}, (e,r) => console.log(e, r));
315330

316-
// Using 4 multiple parallel threads (OpenMP-style parallelism)
331+
// Using multiple (4) parallel threads (OpenMP-style parallelism)
317332
const r1 = expr.map(4, array, 'x', 0, 1000);
318-
const r2 = expr.map(4, array, 'x', {f: 0, c: 0});
333+
const r2 = await expr.mapAsync(4, array, 'x', {f: 0, c: 0});
319334
```
320335

321336
Returns **TypedArray\<T>**&#x20;
@@ -356,13 +371,25 @@ const sumSq = await sum.reduceAsync(array, 'x', {'a' : 0}, (e,r) => console.log(
356371

357372
Returns **number**&#x20;
358373

374+
## allocator
375+
376+
Return the data type constructor
377+
378+
Type: TypedArrayConstructor
379+
359380
## maxParallel
360381

361382
Get the number of threads available for evaluating expressions.
362383
Set by the `EXPRTKJS_THREADS` environment variable.
363384

364385
Type: number
365386

387+
## type
388+
389+
Return the type as a string
390+
391+
Type: string
392+
366393
## Expression
367394

368395
### Parameters

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"codecov": "cd coverage && curl -s https://codecov.io/bash | bash"
1919
},
2020
"name": "exprtk.js",
21-
"version": "2.0.0-alpha.0",
21+
"version": "2.0.0",
2222
"description": "JS Mathematical Expression Toolkit Library",
2323
"repository": {
2424
"type": "git",

0 commit comments

Comments
 (0)