Skip to content

Commit c77a2fd

Browse files
Merge branch 'stdlib-js:develop' into develop
2 parents a368448 + 0616f00 commit c77a2fd

File tree

121 files changed

+2875
-385
lines changed

Some content is hidden

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

121 files changed

+2875
-385
lines changed

lib/node_modules/@stdlib/blas/base/ddot/src/ddot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @param strideX X stride length
3232
* @param Y second array
3333
* @param strideY Y stride length
34-
* @returns the dot product
34+
* @return the dot product
3535
*/
3636
double c_ddot( const int N, const double *X, const int strideX, const double *Y, const int strideY ) {
3737
double dot;

lib/node_modules/@stdlib/blas/base/ddot/src/ddot_cblas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @param strideX X stride length
2828
* @param Y second array
2929
* @param strideY Y stride length
30-
* @returns the dot product
30+
* @return the dot product
3131
*/
3232
double c_ddot( const int N, const double *X, const int strideX, const double *Y, const int strideY ) {
3333
return cblas_ddot( N, X, strideX, Y, strideY );

lib/node_modules/@stdlib/blas/base/ddot/src/ddot_f.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @param strideX X stride length
3333
* @param Y second array
3434
* @param strideY Y stride length
35-
* @returns the dot product
35+
* @return the dot product
3636
*/
3737
double c_ddot( const int N, const double *X, const int strideX, const double *Y, const int strideY ) {
3838
double dot;

lib/node_modules/@stdlib/blas/base/dsdot/src/dsdot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @param strideX X stride length
3232
* @param Y second array
3333
* @param strideY Y stride length
34-
* @returns the dot product
34+
* @return the dot product
3535
*/
3636
double c_dsdot( const int N, const float *X, const int strideX, const float *Y, const int strideY ) {
3737
double dot;

lib/node_modules/@stdlib/blas/base/dsdot/src/dsdot_cblas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @param strideX X stride length
2828
* @param Y second array
2929
* @param strideY Y stride length
30-
* @returns the dot product
30+
* @return the dot product
3131
*/
3232
double c_dsdot( const int N, const float *X, const int strideX, const float *Y, const int strideY ) {
3333
return cblas_dsdot( N, X, strideX, Y, strideY );

lib/node_modules/@stdlib/blas/base/dsdot/src/dsdot_f.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @param strideX X stride length
3333
* @param Y second array
3434
* @param strideY Y stride length
35-
* @returns the dot product
35+
* @return the dot product
3636
*/
3737
double c_dsdot( const int N, const float *X, const int strideX, const float *Y, const int strideY ) {
3838
double dot;

lib/node_modules/@stdlib/blas/base/sdot/src/sdot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @param strideX X stride length
3232
* @param Y second array
3333
* @param strideY Y stride length
34-
* @returns the dot product
34+
* @return the dot product
3535
*/
3636
float c_sdot( const int N, const float *X, const int strideX, const float *Y, const int strideY ) {
3737
float dot;

lib/node_modules/@stdlib/blas/base/sdot/src/sdot_cblas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @param strideX X stride length
2828
* @param Y second array
2929
* @param strideY Y stride length
30-
* @returns the dot product
30+
* @return the dot product
3131
*/
3232
float c_sdot( const int N, const float *X, const int strideX, const float *Y, const int strideY ) {
3333
return cblas_sdot( N, X, strideX, Y, strideY );

lib/node_modules/@stdlib/blas/base/sdot/src/sdot_f.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @param strideX X stride length
3535
* @param Y second array
3636
* @param strideY Y stride length
37-
* @returns the dot product
37+
* @return the dot product
3838
*/
3939
float c_sdot( const int N, const float *X, const int strideX, const float *Y, const int strideY ) {
4040
float dot;

lib/node_modules/@stdlib/blas/base/sdsdot/src/sdsdot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @param strideX X stride length
3333
* @param Y second array
3434
* @param strideY Y stride length
35-
* @returns dot product
35+
* @return dot product
3636
*/
3737
float c_sdsdot( const int N, const float scalar, const float *X, const int strideX, const float *Y, const int strideY ) {
3838
double dot;

lib/node_modules/@stdlib/blas/base/sdsdot/src/sdsdot_cblas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* @param strideX X stride length
2929
* @param Y second array
3030
* @param strideY Y stride length
31-
* @returns dot product
31+
* @return dot product
3232
*/
3333
float c_sdsdot( const int N, const float scalar, const float *X, const int strideX, const float *Y, const int strideY ) {
3434
return cblas_sdsdot( N, scalar, X, strideX, Y, strideY );

lib/node_modules/@stdlib/blas/base/sdsdot/src/sdsdot_f.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* @param strideX X stride length
3636
* @param Y second array
3737
* @param strideY Y stride length
38-
* @returns dot product
38+
* @return dot product
3939
*/
4040
float c_sdsdot( const int N, const float scalar, const float *X, const int strideX, const float *Y, const int strideY ) {
4141
float dot;

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

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,14 @@ The function has the following parameters:
5656
- **x**: input [`Float64Array`][@stdlib/array/float64].
5757
- **stride**: index increment for `x`.
5858

59-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`,
59+
The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array,
6060

6161
```javascript
6262
var Float64Array = require( '@stdlib/array/float64' );
63-
var floor = require( '@stdlib/math/base/special/floor' );
6463

6564
var x = new Float64Array( [ 1.0, 2.0, NaN, -7.0, NaN, 3.0, 4.0, 2.0 ] );
66-
var N = floor( x.length / 2 );
6765

68-
var v = dnansum( N, x, 2 );
66+
var v = dnansum( 4, x, 2 );
6967
// returns 5.0
7068
```
7169

@@ -75,14 +73,11 @@ Note that indexing is relative to the first index. To introduce an offset, use [
7573

7674
```javascript
7775
var Float64Array = require( '@stdlib/array/float64' );
78-
var floor = require( '@stdlib/math/base/special/floor' );
7976

8077
var x0 = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
8178
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
8279

83-
var N = floor( x0.length / 2 );
84-
85-
var v = dnansum( N, x1, 2 );
80+
var v = dnansum( 4, x1, 2 );
8681
// returns 5.0
8782
```
8883

@@ -94,26 +89,23 @@ Computes the sum of double-precision floating-point strided array elements, igno
9489
var Float64Array = require( '@stdlib/array/float64' );
9590

9691
var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );
97-
var N = x.length;
9892

99-
var v = dnansum.ndarray( N, x, 1, 0 );
93+
var v = dnansum.ndarray( 4, x, 1, 0 );
10094
// returns 1.0
10195
```
10296

10397
The function has the following additional parameters:
10498

10599
- **offset**: starting index for `x`.
106100

107-
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 calculate the sum of every other value in `x` starting from the second value
101+
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 calculate the sum of every other value in the strided array starting from the second value
108102

109103
```javascript
110104
var Float64Array = require( '@stdlib/array/float64' );
111-
var floor = require( '@stdlib/math/base/special/floor' );
112105

113106
var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
114-
var N = floor( x.length / 2 );
115107

116-
var v = dnansum.ndarray( N, x, 2, 1 );
108+
var v = dnansum.ndarray( 4, x, 2, 1 );
117109
// returns 5.0
118110
```
119111

@@ -138,22 +130,20 @@ var v = dnansum.ndarray( N, x, 2, 1 );
138130
<!-- eslint no-undef: "error" -->
139131

140132
```javascript
141-
var randu = require( '@stdlib/random/base/randu' );
142-
var round = require( '@stdlib/math/base/special/round' );
133+
var bernoulli = require( '@stdlib/random/base/bernoulli' );
134+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
135+
var filledarrayBy = require( '@stdlib/array/filled-by' );
143136
var Float64Array = require( '@stdlib/array/float64' );
144137
var dnansum = require( '@stdlib/blas/ext/base/dnansum' );
145138

146-
var x;
147-
var i;
148-
149-
x = new Float64Array( 10 );
150-
for ( i = 0; i < x.length; i++ ) {
151-
if ( randu() < 0.2 ) {
152-
x[ i ] = NaN;
153-
} else {
154-
x[ i ] = round( randu()*100.0 );
139+
function clbk() {
140+
if ( bernoulli( 0.7 ) > 0 ) {
141+
return discreteUniform( 0, 100 );
155142
}
143+
return NaN;
156144
}
145+
146+
var x = filledarrayBy( 10, 'float64', clbk );
157147
console.log( x );
158148

159149
var v = dnansum( x.length, x, 1 );

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
24+
var bernoulli = require( '@stdlib/random/base/bernoulli' );
25+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
26+
var filledarrayBy = require( '@stdlib/array/filled-by' );
2527
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2628
var pow = require( '@stdlib/math/base/special/pow' );
27-
var Float64Array = require( '@stdlib/array/float64' );
2829
var pkg = require( './../package.json' ).name;
2930
var dnansum = require( './../lib/dnansum.js' );
3031

@@ -39,18 +40,15 @@ var dnansum = require( './../lib/dnansum.js' );
3940
* @returns {Function} benchmark function
4041
*/
4142
function createBenchmark( len ) {
42-
var x;
43-
var i;
43+
var x = filledarrayBy( len, 'float64', clbk );
44+
return benchmark;
4445

45-
x = new Float64Array( len );
46-
for ( i = 0; i < x.length; i++ ) {
47-
if ( randu() < 0.2 ) {
48-
x[ i ] = NaN;
49-
} else {
50-
x[ i ] = ( randu()*10.0 ) - 20.0;
46+
function clbk() {
47+
if ( bernoulli( 0.7 ) > 0 ) {
48+
return discreteUniform( -10, 10 );
5149
}
50+
return NaN;
5251
}
53-
return benchmark;
5452

5553
function benchmark( b ) {
5654
var v;

lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/benchmark.native.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var randu = require( '@stdlib/random/base/randu' );
25+
var bernoulli = require( '@stdlib/random/base/bernoulli' );
26+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
27+
var filledarrayBy = require( '@stdlib/array/filled-by' );
2628
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2729
var pow = require( '@stdlib/math/base/special/pow' );
28-
var Float64Array = require( '@stdlib/array/float64' );
2930
var tryRequire = require( '@stdlib/utils/try-require' );
3031
var pkg = require( './../package.json' ).name;
3132

@@ -48,18 +49,15 @@ var opts = {
4849
* @returns {Function} benchmark function
4950
*/
5051
function createBenchmark( len ) {
51-
var x;
52-
var i;
52+
var x = filledarrayBy( len, 'float64', clbk );
53+
return benchmark;
5354

54-
x = new Float64Array( len );
55-
for ( i = 0; i < x.length; i++ ) {
56-
if ( randu() < 0.2 ) {
57-
x[ i ] = NaN;
58-
} else {
59-
x[ i ] = ( randu()*10.0 ) - 20.0;
55+
function clbk() {
56+
if ( bernoulli( 0.7 ) > 0 ) {
57+
return discreteUniform( -10, 10 );
6058
}
59+
return NaN;
6160
}
62-
return benchmark;
6361

6462
function benchmark( b ) {
6563
var v;

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
24+
var bernoulli = require( '@stdlib/random/base/bernoulli' );
25+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
26+
var filledarrayBy = require( '@stdlib/array/filled-by' );
2527
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2628
var pow = require( '@stdlib/math/base/special/pow' );
27-
var Float64Array = require( '@stdlib/array/float64' );
2829
var pkg = require( './../package.json' ).name;
2930
var dnansum = require( './../lib/ndarray.js' );
3031

@@ -39,18 +40,15 @@ var dnansum = require( './../lib/ndarray.js' );
3940
* @returns {Function} benchmark function
4041
*/
4142
function createBenchmark( len ) {
42-
var x;
43-
var i;
43+
var x = filledarrayBy( len, 'float64', clbk );
44+
return benchmark;
4445

45-
x = new Float64Array( len );
46-
for ( i = 0; i < x.length; i++ ) {
47-
if ( randu() < 0.2 ) {
48-
x[ i ] = NaN;
49-
} else {
50-
x[ i ] = ( randu()*10.0 ) - 20.0;
46+
function clbk() {
47+
if ( bernoulli( 0.7 ) > 0 ) {
48+
return discreteUniform( -10, 10 );
5149
}
50+
return NaN;
5251
}
53-
return benchmark;
5452

5553
function benchmark( b ) {
5654
var v;

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var randu = require( '@stdlib/random/base/randu' );
25+
var bernoulli = require( '@stdlib/random/base/bernoulli' );
26+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
27+
var filledarrayBy = require( '@stdlib/array/filled-by' );
2628
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2729
var pow = require( '@stdlib/math/base/special/pow' );
28-
var Float64Array = require( '@stdlib/array/float64' );
2930
var tryRequire = require( '@stdlib/utils/try-require' );
3031
var pkg = require( './../package.json' ).name;
3132

@@ -48,18 +49,15 @@ var opts = {
4849
* @returns {Function} benchmark function
4950
*/
5051
function createBenchmark( len ) {
51-
var x;
52-
var i;
52+
var x = filledarrayBy( len, 'float64', clbk );
53+
return benchmark;
5354

54-
x = new Float64Array( len );
55-
for ( i = 0; i < x.length; i++ ) {
56-
if ( randu() < 0.2 ) {
57-
x[ i ] = NaN;
58-
} else {
59-
x[ i ] = ( randu()*10.0 ) - 20.0;
55+
function clbk() {
56+
if ( bernoulli( 0.7 ) > 0 ) {
57+
return discreteUniform( -10, 10 );
6058
}
59+
return NaN;
6160
}
62-
return benchmark;
6361

6462
function benchmark( b ) {
6563
var v;

0 commit comments

Comments
 (0)