@@ -128,6 +128,7 @@ const r = await mean.evalAsync(inputArray);
128
128
### Table of Contents
129
129
130
130
* [ toString] ( #tostring )
131
+ * [ allocator] ( #allocator )
131
132
* [ expression] ( #expression )
132
133
* [ maxActive] ( #maxactive )
133
134
* [ maxParallel] ( #maxparallel )
@@ -146,7 +147,9 @@ const r = await mean.evalAsync(inputArray);
146
147
* [ reduce] ( #reduce )
147
148
* [ Parameters] ( #parameters-3 )
148
149
* [ Examples] ( #examples-3 )
150
+ * [ allocator] ( #allocator-1 )
149
151
* [ maxParallel] ( #maxparallel-1 )
152
+ * [ type] ( #type-1 )
150
153
* [ Expression] ( #expression-1 )
151
154
* [ Parameters] ( #parameters-4 )
152
155
* [ Examples] ( #examples-4 )
@@ -157,6 +160,12 @@ Get a string representation of this object
157
160
158
161
Returns ** string**   ;
159
162
163
+ ## allocator
164
+
165
+ Return the data type constructor
166
+
167
+ Type: TypedArrayConstructor
168
+
160
169
## expression
161
170
162
171
Return the expression as a string
@@ -239,8 +248,14 @@ const result = new Float32Array(P.length);
239
248
// sync
240
249
density .cwise ({phi, T , P , R , Md, Mv}, result);
241
250
251
+ // sync multithreaded
252
+ density .cwise (os .cpus ().length , {phi, T , P , R , Md, Mv}, result);
253
+
242
254
// async
243
255
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);
244
259
```
245
260
246
261
Returns ** TypedArray\< T>**   ;
@@ -313,9 +328,9 @@ const r2 = expr.map(array, 'x', {f: 0, c: 0});
313
328
expr .mapAsync (array, ' x' , 0 , 1000 , (e ,r ) => console .log (e, r));
314
329
expr .mapAsync (array, ' x' , {f: 0 , c: 0 }, (e ,r ) => console .log (e, r));
315
330
316
- // Using 4 multiple parallel threads (OpenMP-style parallelism)
331
+ // Using multiple (4) parallel threads (OpenMP-style parallelism)
317
332
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 });
319
334
```
320
335
321
336
Returns ** TypedArray\< T>**   ;
@@ -356,13 +371,25 @@ const sumSq = await sum.reduceAsync(array, 'x', {'a' : 0}, (e,r) => console.log(
356
371
357
372
Returns ** number**   ;
358
373
374
+ ## allocator
375
+
376
+ Return the data type constructor
377
+
378
+ Type: TypedArrayConstructor
379
+
359
380
## maxParallel
360
381
361
382
Get the number of threads available for evaluating expressions.
362
383
Set by the ` EXPRTKJS_THREADS ` environment variable.
363
384
364
385
Type: number
365
386
387
+ ## type
388
+
389
+ Return the type as a string
390
+
391
+ Type: string
392
+
366
393
## Expression
367
394
368
395
### Parameters
0 commit comments