Skip to content

Commit e463688

Browse files
committed
Explicitly require typed array constructors
1 parent 2e1512d commit e463688

File tree

9 files changed

+84
-0
lines changed

9 files changed

+84
-0
lines changed

lib/node_modules/@stdlib/math/base/blas/asum/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ var sum = asum( N, x, stride );
6161
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
6262

6363
```javascript
64+
var Float64Array = require( '@stdlib/types/array/float64' );
65+
6466
var floor = require( '@stdlib/math/base/special/floor' );
6567

6668
// Initial array...
@@ -96,6 +98,8 @@ The function accepts the following additional parameters:
9698
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to sum the last three elements,
9799

98100
```javascript
101+
var Float64Array = require( '@stdlib/types/array/float64' );
102+
99103
var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
100104

101105
var sum = asum.ndarray( 3, x, 1, x.length-3 );

lib/node_modules/@stdlib/math/base/blas/axpy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ axpy( N, alpha, x, 2, y, -1 );
5050
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
5151

5252
```javascript
53+
var Float64Array = require( '@stdlib/types/array/float64' );
5354
var floor = require( '@stdlib/math/base/special/floor' );
5455

5556
// Initial arrays...

lib/node_modules/@stdlib/math/base/blas/copy/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ copy( N, x, -2, y, 1 );
4747
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
4848

4949
```javascript
50+
var Float64Array = require( '@stdlib/types/array/float64' );
5051
var floor = require( '@stdlib/math/base/special/floor' );
5152

5253
// Initial arrays...
@@ -117,6 +118,8 @@ copy.ndarray( N, x, 2, 1, y, -1, y.length-1 );
117118
```javascript
118119
var randu = require( '@stdlib/math/base/random/randu' );
119120
var round = require( '@stdlib/math/base/special/round' );
121+
var Float64Array = require( '@stdlib/types/array/float64' );
122+
var Uint8ClampedArray = require( '@stdlib/types/array/uint8c' );
120123
var copy = require( '@stdlib/math/base/blas/copy' );
121124

122125
var x;

lib/node_modules/@stdlib/math/base/blas/dasum/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ var dasum = require( '@stdlib/math/base/blas/dasum' );
3232
Computes the sum of [absolute values][@stdlib/math/base/special/abs].
3333

3434
```javascript
35+
var Float64Array = require( '@stdlib/types/array/float64' );
36+
3537
var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
3638

3739
var sum = dasum( x.length, x, 1 );
@@ -47,6 +49,7 @@ The function accepts the following parameters:
4749
The `N` and `stride` parameters determine which elements in `x` are used to compute the sum. For example, to sum every other value,
4850

4951
```javascript
52+
var Float64Array = require( '@stdlib/types/array/float64' );
5053
var floor = require( '@stdlib/math/base/special/floor' );
5154

5255
var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
@@ -61,6 +64,7 @@ var sum = dasum( N, x, stride );
6164
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
6265

6366
```javascript
67+
var Float64Array = require( '@stdlib/types/array/float64' );
6468
var floor = require( '@stdlib/math/base/special/floor' );
6569

6670
// Initial array...
@@ -83,6 +87,8 @@ If either `N` or `stride` is less than or equal to `0`, the function returns `0`
8387
Computes the sum of [absolute values][@stdlib/math/base/special/abs], with alternative indexing semantics.
8488

8589
```javascript
90+
var Float64Array = require( '@stdlib/types/array/float64' );
91+
8692
var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
8793

8894
var sum = dasum.ndarray( x.length, x, 1, 0 );
@@ -96,6 +102,8 @@ The function accepts the following additional parameters:
96102
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to sum the last three elements,
97103

98104
```javascript
105+
var Float64Array = require( '@stdlib/types/array/float64' );
106+
99107
var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
100108

101109
var sum = dasum.ndarray( 3, x, 1, x.length-3 );
@@ -111,6 +119,8 @@ sum = dasum.ndarray( 3, x, -1, x.length-1 );
111119
Returns a memory managed function to compute the sum of [absolute values][@stdlib/math/base/special/abs].
112120

113121
```javascript
122+
var Float64Array = require( '@stdlib/types/array/float64' );
123+
114124
var wasm = dasum.wasm();
115125

116126
// Number of data elements:
@@ -136,6 +146,9 @@ wasm.free( bytes );
136146
For externally defined [typed arrays][mdn-typed-array], data must be copied to the heap.
137147

138148
```javascript
149+
var Uint8Array = require( '@stdlib/types/array/uint8' );
150+
var Float64Array = require( '@stdlib/types/array/float64' );
151+
139152
var wasm = dasum.wasm();
140153

141154
// Externally defined data array:
@@ -189,6 +202,8 @@ var bytes = wasm.malloc( 64 );
189202
Returns a value at a specific memory address (represented by a byte index). By default, the function returns a `double`. Possible types include: `'i8'`, `'i16'`, `'i32'`, `'i64'`, `'float'`, and `'double'`.
190203

191204
```javascript
205+
var Float64Array = require( '@stdlib/types/array/float64' );
206+
192207
var wasm = dasum.wasm();
193208

194209
var N = 3;
@@ -208,6 +223,8 @@ wasm.free( bytes );
208223
While this method may be convenient when interacting with the bytes view directly, using a [`typed array`][mdn-typed-array] view is likely to be more performant.
209224

210225
```javascript
226+
var Float64Array = require( '@stdlib/types/array/float64' );
227+
211228
var wasm = dasum.wasm();
212229

213230
var N = 3;
@@ -228,6 +245,8 @@ wasm.free( bytes );
228245
Sets a value at a specific memory address (represented by a byte index). By default, the function sets a `double`. Possible types include: `'i8'`, `'i16'`, `'i32'`, `'i64'`, `'float'`, and `'double'`.
229246

230247
```javascript
248+
var Float64Array = require( '@stdlib/types/array/float64' );
249+
231250
var wasm = dasum.wasm();
232251

233252
var N = 3;
@@ -252,6 +271,8 @@ wasm.free( bytes );
252271
While this method may be convenient when interacting with the bytes view directly, using a [`typed array`][mdn-typed-array] view is likely to be more performant.
253272

254273
```javascript
274+
var Float64Array = require( '@stdlib/types/array/float64' );
275+
255276
var wasm = dasum.wasm();
256277

257278
var N = 3;
@@ -308,6 +329,7 @@ wasm.free( bytes );
308329

309330
```javascript
310331
var randu = require( '@stdlib/math/base/random/randu' );
332+
var Float64Array = require( '@stdlib/types/array/float64' );
311333
var dasum = require( '@stdlib/math/base/blas/dasum' );
312334

313335
var rand;

lib/node_modules/@stdlib/math/base/blas/daxpy/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var daxpy = require( '@stdlib/math/base/blas/daxpy' );
1515
Multiplies `x` by a constant `alpha` and adds the result to `y`.
1616

1717
```javascript
18+
var Float64Array = require( '@stdlib/types/array/float64' );
19+
1820
var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
1921
var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
2022
var alpha = 5.0;
@@ -35,6 +37,7 @@ The function accepts the following parameters:
3537
The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to multiply every other value in `x` by `alpha` and add the result to the first `N` elements of `y` in reverse order,
3638

3739
```javascript
40+
var Float64Array = require( '@stdlib/types/array/float64' );
3841
var floor = require( '@stdlib/math/base/special/floor' );
3942

4043
var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
@@ -50,6 +53,7 @@ daxpy( N, alpha, x, 2, y, -1 );
5053
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
5154

5255
```javascript
56+
var Float64Array = require( '@stdlib/types/array/float64' );
5357
var floor = require( '@stdlib/math/base/special/floor' );
5458

5559
// Initial arrays...
@@ -71,6 +75,8 @@ daxpy( N, 5.0, x1, -2, y1, 1 );
7175
Multiplies `x` by a constant `alpha` and adds the result to `y`, with alternative indexing semantics.
7276

7377
```javascript
78+
var Float64Array = require( '@stdlib/types/array/float64' );
79+
7480
var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
7581
var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
7682
var alpha = 5.0;
@@ -87,6 +93,7 @@ The function accepts the following additional parameters:
8793
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to multiply every other value in `x` by a constant `alpha` starting from the second value and add to the last `N` elements in `y` where `x[i] -> y[n]`, `x[i+2] -> y[n-1]`,...,
8894

8995
```javascript
96+
var Float64Array = require( '@stdlib/types/array/float64' );
9097
var floor = require( '@stdlib/math/base/special/floor' );
9198

9299
var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
@@ -104,6 +111,8 @@ daxpy.ndarray( N, alpha, x, 2, 1, y, -1, y.length-1 );
104111
Returns a memory managed function to multiply `x` by a constant `alpha` and add the result to `y`.
105112

106113
```javascript
114+
var Float64Array = require( '@stdlib/types/array/float64' );
115+
107116
var wasm = daxpy.wasm();
108117

109118
// Number of data elements:
@@ -141,6 +150,9 @@ wasm.free( ybytes );
141150
For externally defined [typed arrays][mdn-typed-array], data must be copied to the heap.
142151

143152
```javascript
153+
var Uint8Array = require( '@stdlib/types/array/uint8' );
154+
var Float64Array = require( '@stdlib/types/array/float64' );
155+
144156
var wasm = daxpy.wasm();
145157

146158
// Externally defined data arrays:
@@ -206,6 +218,8 @@ var bytes = wasm.malloc( 64 );
206218
Returns a value at a specific memory address (represented by a byte index). By default, the function returns a `double`. Possible types include: `'i8'`, `'i16'`, `'i32'`, `'i64'`, `'float'`, and `'double'`.
207219

208220
```javascript
221+
var Float64Array = require( '@stdlib/types/array/float64' );
222+
209223
var wasm = daxpy.wasm();
210224

211225
var N = 3;
@@ -225,6 +239,8 @@ wasm.free( bytes );
225239
While this method may be convenient when interacting with the bytes view directly, using a [`typed array`][mdn-typed-array] view is likely to be more performant.
226240

227241
```javascript
242+
var Float64Array = require( '@stdlib/types/array/float64' );
243+
228244
var wasm = daxpy.wasm();
229245

230246
var N = 3;
@@ -245,6 +261,8 @@ wasm.free( bytes );
245261
Sets a value at a specific memory address (represented by a byte index). By default, the function sets a `double`. Possible types include: `'i8'`, `'i16'`, `'i32'`, `'i64'`, `'float'`, and `'double'`.
246262

247263
```javascript
264+
var Float64Array = require( '@stdlib/types/array/float64' );
265+
248266
var wasm = daxpy.wasm();
249267

250268
var N = 3;
@@ -269,6 +287,8 @@ wasm.free( bytes );
269287
While this method may be convenient when interacting with the bytes view directly, using a [`typed array`][mdn-typed-array] view is likely to be more performant.
270288

271289
```javascript
290+
var Float64Array = require( '@stdlib/types/array/float64' );
291+
272292
var wasm = daxpy.wasm();
273293

274294
var N = 3;
@@ -326,6 +346,7 @@ wasm.free( bytes );
326346
```javascript
327347
var randu = require( '@stdlib/math/base/random/randu' );
328348
var round = require( '@stdlib/math/base/special/round' );
349+
var Float64Array = require( '@stdlib/types/array/float64' );
329350
var daxpy = require( '@stdlib/math/base/blas/daxpy' ).ndarray;
330351

331352
var x;

lib/node_modules/@stdlib/math/base/blas/dcopy/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var dcopy = require( '@stdlib/math/base/blas/dcopy' );
1515
Copies values from `x` into `y`.
1616

1717
```javascript
18+
var Float64Array = require( '@stdlib/types/array/float64' );
19+
1820
var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
1921
var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );
2022

@@ -33,6 +35,7 @@ The function accepts the following parameters:
3335
The `N` and `stride` parameters determine how values from `x` are copied into `y`. For example, to copy in reverse order every other value in `x` into the first `N` elements of `y`,
3436

3537
```javascript
38+
var Float64Array = require( '@stdlib/types/array/float64' );
3639
var floor = require( '@stdlib/math/base/special/floor' );
3740

3841
var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
@@ -47,6 +50,7 @@ dcopy( N, x, -2, y, 1 );
4750
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
4851

4952
```javascript
53+
var Float64Array = require( '@stdlib/types/array/float64' );
5054
var floor = require( '@stdlib/math/base/special/floor' );
5155

5256
// Initial arrays...
@@ -69,6 +73,8 @@ dcopy( N, x1, -2, y1, 1 );
6973
Copies values from `x` into `y`, with alternative indexing semantics.
7074

7175
```javascript
76+
var Float64Array = require( '@stdlib/types/array/float64' );
77+
7278
var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
7379
var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );
7480

@@ -84,6 +90,7 @@ The function accepts the following additional parameters:
8490
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to copy every other value in `x` starting from the second value into the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,...,
8591

8692
```javascript
93+
var Float64Array = require( '@stdlib/types/array/float64' );
8794
var floor = require( '@stdlib/math/base/special/floor' );
8895

8996
var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
@@ -117,6 +124,7 @@ dcopy.ndarray( N, x, 2, 1, y, -1, y.length-1 );
117124
```javascript
118125
var randu = require( '@stdlib/math/base/random/randu' );
119126
var round = require( '@stdlib/math/base/special/round' );
127+
var Float64Array = require( '@stdlib/types/array/float64' );
120128
var dcopy = require( '@stdlib/math/base/blas/dcopy' );
121129

122130
var x;

lib/node_modules/@stdlib/math/base/blas/sasum/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ var sasum = require( '@stdlib/math/base/blas/sasum' );
3232
Computes the sum of [absolute values][@stdlib/math/base/special/abs].
3333

3434
```javascript
35+
var Float32Array = require( '@stdlib/types/array/float32' );
36+
3537
var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
3638

3739
var sum = sasum( x.length, x, 1 );
@@ -47,6 +49,7 @@ The function accepts the following parameters:
4749
The `N` and `stride` parameters determine which elements in `x` are used to compute the sum. For example, to sum every other value,
4850

4951
```javascript
52+
var Float32Array = require( '@stdlib/types/array/float32' );
5053
var floor = require( '@stdlib/math/base/special/floor' );
5154

5255
var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
@@ -61,6 +64,7 @@ var sum = sasum( N, x, stride );
6164
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
6265

6366
```javascript
67+
var Float32Array = require( '@stdlib/types/array/float32' );
6468
var floor = require( '@stdlib/math/base/special/floor' );
6569

6670
// Initial array...
@@ -83,6 +87,8 @@ If either `N` or `stride` is less than or equal to `0`, the function returns `0`
8387
Computes the sum of [absolute values][@stdlib/math/base/special/abs], with alternative indexing semantics.
8488

8589
```javascript
90+
var Float32Array = require( '@stdlib/types/array/float32' );
91+
8692
var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
8793

8894
var sum = sasum.ndarray( x.length, x, 1, 0 );
@@ -96,6 +102,8 @@ The function accepts the following additional parameters:
96102
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to sum the last three elements,
97103

98104
```javascript
105+
var Float32Array = require( '@stdlib/types/array/float32' );
106+
99107
var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
100108

101109
var sum = sasum.ndarray( 3, x, 1, x.length-3 );
@@ -127,6 +135,7 @@ sum = sasum.ndarray( 3, x, -1, x.length-1 );
127135

128136
```javascript
129137
var randu = require( '@stdlib/math/base/random/randu' );
138+
var Float32Array = require( '@stdlib/types/array/float32' );
130139
var sasum = require( '@stdlib/math/base/blas/sasum' );
131140

132141
var rand;

0 commit comments

Comments
 (0)