Skip to content

Commit 944300d

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into ndarray-smeanli
2 parents df34b03 + c217016 commit 944300d

File tree

678 files changed

+28048
-5320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

678 files changed

+28048
-5320
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ indent_style = tab
8686
[*.{f,f.txt}]
8787
indent_style = space
8888
indent_size = 2
89-
insert_final_newline = false
9089

9190
# Set properties for shell files:
9291
[*.{sh,sh.txt}]

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ Vaibhav Patel <[email protected]> ProCoderVP
219219
220220
Varad Gupta <[email protected]> vr-varad
221221

222+
223+
222224
223225
Vivek Maurya <[email protected]> vivekmaurya001
224226

lib/node_modules/@stdlib/blas/ext/base/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ var ns = extblas;
124124
- <span class="signature">[`sapx( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapx]</span><span class="delimiter">: </span><span class="description">add a constant to each element in a single-precision floating-point strided array.</span>
125125
- <span class="signature">[`sapxsum( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapxsum]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum.</span>
126126
- <span class="signature">[`sapxsumkbn( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapxsumkbn]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum using an improved Kahan–Babuška algorithm.</span>
127-
- <span class="signature">[`sapxsumkbn2( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapxsumkbn2]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum using a second-order iterative Kahan–Babuška algorithm.</span>
127+
- <span class="signature">[`sapxsumkbn2( N, alpha, x, strideX )`][@stdlib/blas/ext/base/sapxsumkbn2]</span><span class="delimiter">: </span><span class="description">add a scalar constant to each single-precision floating-point strided array element and compute the sum using a second-order iterative Kahan–Babuška algorithm.</span>
128128
- <span class="signature">[`sapxsumors( N, alpha, x, strideX )`][@stdlib/blas/ext/base/sapxsumors]</span><span class="delimiter">: </span><span class="description">add a scalar constant to each single-precision floating-point strided array element and compute the sum using ordinary recursive summation.</span>
129-
- <span class="signature">[`sapxsumpw( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapxsumpw]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum using pairwise summation.</span>
130-
- <span class="signature">[`sasumpw( N, x, stride )`][@stdlib/blas/ext/base/sasumpw]</span><span class="delimiter">: </span><span class="description">calculate the sum of absolute values (_L1_ norm) of single-precision floating-point strided array elements using pairwise summation.</span>
129+
- <span class="signature">[`sapxsumpw( N, alpha, x, strideX )`][@stdlib/blas/ext/base/sapxsumpw]</span><span class="delimiter">: </span><span class="description">add a scalar constant to each single-precision floating-point strided array element and compute the sum using pairwise summation.</span>
130+
- <span class="signature">[`sasumpw( N, x, strideX )`][@stdlib/blas/ext/base/sasumpw]</span><span class="delimiter">: </span><span class="description">calculate the sum of absolute values (_L1_ norm) of single-precision floating-point strided array elements using pairwise summation.</span>
131131
- <span class="signature">[`scusum( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/scusum]</span><span class="delimiter">: </span><span class="description">calculate the cumulative sum of single-precision floating-point strided array elements.</span>
132132
- <span class="signature">[`scusumkbn( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/scusumkbn]</span><span class="delimiter">: </span><span class="description">calculate the cumulative sum of single-precision floating-point strided array elements using an improved Kahan–Babuška algorithm.</span>
133133
- <span class="signature">[`scusumkbn2( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/scusumkbn2]</span><span class="delimiter">: </span><span class="description">calculate the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm.</span>

lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,12 +2334,12 @@ interface Namespace {
23342334
sapxsumkbn: typeof sapxsumkbn;
23352335

23362336
/**
2337-
* Adds a constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
2337+
* Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
23382338
*
23392339
* @param N - number of indexed elements
2340-
* @param alpha - constant
2340+
* @param alpha - scalar constant
23412341
* @param x - input array
2342-
* @param stride - stride length
2342+
* @param strideX - stride length
23432343
* @returns sum
23442344
*
23452345
* @example
@@ -2388,12 +2388,12 @@ interface Namespace {
23882388
sapxsumors: typeof sapxsumors;
23892389

23902390
/**
2391-
* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation.
2391+
* Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using pairwise summation.
23922392
*
23932393
* @param N - number of indexed elements
2394-
* @param alpha - constant
2394+
* @param alpha - scalar constant
23952395
* @param x - input array
2396-
* @param stride - stride length
2396+
* @param strideX - stride length
23972397
* @returns sum
23982398
*
23992399
* @example
@@ -2419,7 +2419,7 @@ interface Namespace {
24192419
*
24202420
* @param N - number of indexed elements
24212421
* @param x - input array
2422-
* @param stride - stride length
2422+
* @param strideX - stride length
24232423
* @returns sum
24242424
*
24252425
* @example
@@ -2477,9 +2477,9 @@ interface Namespace {
24772477
* @param N - number of indexed elements
24782478
* @param sum - initial sum
24792479
* @param x - input array
2480-
* @param strideX - `x` stride length
2480+
* @param strideX - stride length for `x`
24812481
* @param y - output array
2482-
* @param strideY - `y` stride length
2482+
* @param strideY - stride length for `y`
24832483
* @returns output array
24842484
*
24852485
* @example
@@ -2508,9 +2508,9 @@ interface Namespace {
25082508
* @param N - number of indexed elements
25092509
* @param sum - initial sum
25102510
* @param x - input array
2511-
* @param strideX - `x` stride length
2511+
* @param strideX - stride length for `x`
25122512
* @param y - output array
2513-
* @param strideY - `y` stride length
2513+
* @param strideY - stride length for `y`
25142514
* @returns output array
25152515
*
25162516
* @example

lib/node_modules/@stdlib/blas/ext/base/gcusumors/benchmark/benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ var uniform = require( '@stdlib/random/array/uniform' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var pow = require( '@stdlib/math/base/special/pow' );
2727
var gfill = require( '@stdlib/blas/ext/base/gfill' );
28-
var Float64Array = require( '@stdlib/array/float64' );
28+
var zeros = require( '@stdlib/array/zeros' );
2929
var pkg = require( './../package.json' ).name;
3030
var gcusumors = require( './../lib/main.js' );
3131

3232

3333
// VARIABLES //
3434

3535
var options = {
36-
'dtype': 'float64'
36+
'dtype': 'generic'
3737
};
3838

3939

@@ -48,7 +48,7 @@ var options = {
4848
*/
4949
function createBenchmark( len ) {
5050
var x = uniform( len, -100, 100, options );
51-
var y = new Float64Array( len );
51+
var y = zeros( len, options.dtype );
5252
return benchmark;
5353

5454
function benchmark( b ) {

lib/node_modules/@stdlib/blas/ext/base/gcusumors/benchmark/benchmark.ndarray.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ var uniform = require( '@stdlib/random/array/uniform' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var pow = require( '@stdlib/math/base/special/pow' );
2727
var gfill = require( '@stdlib/blas/ext/base/gfill' );
28-
var Float64Array = require( '@stdlib/array/float64' );
28+
var zeros = require( '@stdlib/array/zeros' );
2929
var pkg = require( './../package.json' ).name;
3030
var gcusumors = require( './../lib/ndarray.js' );
3131

3232

3333
// VARIABLES //
3434

3535
var options = {
36-
'dtype': 'float64'
36+
'dtype': 'generic'
3737
};
3838

3939

@@ -48,7 +48,7 @@ var options = {
4848
*/
4949
function createBenchmark( len ) {
5050
var x = uniform( len, -100, 100, options );
51-
var y = new Float64Array( len );
51+
var y = zeros( len, options.dtype );
5252
return benchmark;
5353

5454
function benchmark( b ) {

lib/node_modules/@stdlib/blas/ext/base/gfill-by/README.md

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ limitations under the License.
3030
var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' );
3131
```
3232

33-
#### gfillBy( N, x, stride, clbk\[, thisArg] )
33+
#### gfillBy( N, x, strideX, clbk\[, thisArg] )
3434

35-
Fills a strided array `x` according to a provided callback function.
35+
Fills a strided array according to a provided callback function.
3636

3737
```javascript
3838
function fill( v, i ) {
@@ -48,17 +48,17 @@ gfillBy( x.length, x, 1, fill );
4848
The function has the following parameters:
4949

5050
- **N**: number of indexed elements.
51-
- **x**: input array.
52-
- **stride**: index increment.
51+
- **x**: input array.
52+
- **strideX**: stride length.
5353
- **clbk**: callback function.
5454
- **thisArg**: execution context (_optional_).
5555

56-
The invoked callback is provided four arguments:
56+
The callback function is provided the following arguments:
5757

58-
- **value**: array element.
58+
- **value**: current array element.
5959
- **aidx**: array index.
6060
- **sidx**: strided index (`offset + aidx*stride`).
61-
- **array**: input array/collection.
61+
- **array**: the input array.
6262

6363
To set the callback execution context, provide a `thisArg`.
6464

@@ -81,27 +81,23 @@ var cnt = context.count;
8181
// returns 8
8282
```
8383

84-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to fill every other element
84+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to fill every other element:
8585

8686
```javascript
87-
var floor = require( '@stdlib/math/base/special/floor' );
88-
8987
function fill( v, i ) {
9088
return v * i;
9189
}
9290

9391
var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];
94-
var N = floor( x.length / 2 );
9592

96-
gfillBy( N, x, 2, fill );
93+
gfillBy( 4, x, 2, fill );
9794
// x => [ 0.0, 1.0, 3.0, -5.0, 8.0, 0.0, -3.0, -3.0 ]
9895
```
9996

10097
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
10198

10299
```javascript
103100
var Float64Array = require( '@stdlib/array/float64' );
104-
var floor = require( '@stdlib/math/base/special/floor' );
105101

106102
function fill( v, i ) {
107103
return v * i;
@@ -112,16 +108,15 @@ var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
112108

113109
// Create an offset view...
114110
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
115-
var N = floor( x0.length/2 );
116111

117112
// Fill every other element...
118-
gfillBy( N, x1, 2, fill );
113+
gfillBy( 3, x1, 2, fill );
119114
// x0 => <Float64Array>[ 1.0, 0.0, 3.0, -4.0, 5.0, -12.0 ]
120115
```
121116

122-
#### gfillBy.ndarray( N, x, stride, offset, clbk\[, thisArg] )
117+
#### gfillBy.ndarray( N, x, strideX, offsetX, clbk\[, thisArg] )
123118

124-
Fills a strided array `x` according to a provided callback function and using alternative indexing semantics.
119+
Fills a strided array according to a provided callback function and using alternative indexing semantics.
125120

126121
```javascript
127122
function fill( v, i ) {
@@ -136,9 +131,9 @@ gfillBy.ndarray( x.length, x, 1, 0, fill );
136131

137132
The function has the following additional parameters:
138133

139-
- **offset**: starting index.
134+
- **offsetX**: starting index.
140135

141-
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 access only the last three elements of `x`
136+
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 access only the last three elements:
142137

143138
```javascript
144139
function fill( v, i ) {
@@ -174,26 +169,14 @@ gfillBy.ndarray( 3, x, 1, x.length-3, fill );
174169
<!-- eslint no-undef: "error" -->
175170

176171
```javascript
177-
var round = require( '@stdlib/math/base/special/round' );
178-
var randu = require( '@stdlib/random/base/randu' );
172+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
179173
var Float64Array = require( '@stdlib/array/float64' );
180174
var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' );
181175

182-
function fill() {
183-
var rand = round( randu()*100.0 );
184-
var sign = randu();
185-
if ( sign < 0.5 ) {
186-
sign = -1.0;
187-
} else {
188-
sign = 1.0;
189-
}
190-
return sign * rand;
191-
}
192-
193176
var x = new Float64Array( 10 );
194177
console.log( x );
195178

196-
gfillBy( x.length, x, 1, fill );
179+
gfillBy( x.length, x, 1, discreteUniform( -100, 100 ) );
197180
console.log( x );
198181
```
199182

lib/node_modules/@stdlib/blas/ext/base/gfill-by/docs/repl.txt

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

2-
{{alias}}( N, x, stride, clbk[, thisArg] )
2+
{{alias}}( N, x, strideX, clbk[, thisArg] )
33
Fills a strided array according to a provided callback function.
44

5-
The `N` and `stride` parameters determine which elements in `x` are accessed
6-
at runtime.
5+
The `N` and stride parameters determine which elements in the strided array
6+
are accessed at runtime.
77

88
Indexing is relative to the first index. To introduce an offset, use typed
99
array views.
@@ -12,7 +12,7 @@
1212

1313
The callback function is provided four arguments:
1414

15-
- value: array element.
15+
- value: current array element.
1616
- aidx: array index.
1717
- sidx: strided index (offset + aidx*stride).
1818
- array: the input array.
@@ -28,8 +28,8 @@
2828
x: ArrayLikeObject
2929
Input array.
3030

31-
stride: integer
32-
Index increment for `x`.
31+
strideX: integer
32+
Stride length.
3333

3434
clbk: Function
3535
Callback function.
@@ -40,7 +40,7 @@
4040
Returns
4141
-------
4242
x: ArrayLikeObject
43-
Input array `x`.
43+
Input array.
4444

4545
Examples
4646
--------
@@ -50,28 +50,26 @@
5050
> {{alias}}( x.length, x, 1, fill )
5151
[ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]
5252

53-
// Using `N` and `stride` parameters:
53+
// Using `N` and stride parameters:
5454
> x = [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ];
55-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
56-
> {{alias}}( N, x, 2, fill )
55+
> {{alias}}( 3, x, 2, fill )
5756
[ 5.0, 1.0, 5.0, -5.0, 5.0, -1.0, -3.0 ]
5857

5958
// Using view offsets:
6059
> var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
6160
> var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
62-
> N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
63-
> {{alias}}( N, x1, 2, fill )
61+
> {{alias}}( 3, x1, 2, fill )
6462
<Float64Array>[ 5.0, 3.0, 5.0, 5.0, 5.0 ]
6563
> x0
6664
<Float64Array>[ 1.0, 5.0, 3.0, 5.0, 5.0, 5.0 ]
6765

6866

69-
{{alias}}.ndarray( N, x, stride, offset, clbk[, thisArg] )
67+
{{alias}}.ndarray( N, x, strideX, offsetX, clbk[, thisArg] )
7068
Fills a strided array according to a provided callback function and using
7169
alternative indexing semantics.
7270

7371
While typed array views mandate a view offset based on the underlying
74-
buffer, the `offset` parameter supports indexing semantics based on a
72+
buffer, the offset parameter supports indexing semantics based on a
7573
starting index.
7674

7775
Parameters
@@ -82,11 +80,11 @@
8280
x: ArrayLikeObject
8381
Input array.
8482

85-
stride: integer
86-
Index increment for `x`.
83+
strideX: integer
84+
Stride length.
8785

88-
offset: integer
89-
Starting index of `x`.
86+
offsetX: integer
87+
Starting index.
9088

9189
clbk: Function
9290
Callback function.
@@ -97,7 +95,7 @@
9795
Returns
9896
-------
9997
x: ArrayLikeObject
100-
Input array `x`.
98+
Input array.
10199

102100
Examples
103101
--------
@@ -109,8 +107,7 @@
109107

110108
// Using an index offset:
111109
> x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];
112-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
113-
> {{alias}}.ndarray( N, x, 2, 1, fill )
110+
> {{alias}}.ndarray( 3, x, 2, 1, fill )
114111
[ 1.0, 5.0, 3.0, 5.0, 5.0, 5.0 ]
115112

116113
See Also

0 commit comments

Comments
 (0)