Skip to content

Commit 89898b6

Browse files
committed
Auto-generated commit
1 parent 16b724f commit 89898b6

30 files changed

+260
-335
lines changed

.gitattributes

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,23 @@
4040
*.mov binary
4141

4242
# Override what is considered "vendored" by GitHub's linguist:
43-
/deps/** linguist-vendored=false
44-
/lib/node_modules/** linguist-vendored=false linguist-generated=false
45-
test/fixtures/** linguist-vendored=false
46-
tools/** linguist-vendored=false
43+
/lib/node_modules/** -linguist-vendored -linguist-generated
4744

48-
# Override what is considered "documentation" by GitHub's linguist:
49-
examples/** linguist-documentation=false
45+
# Configure directories which should *not* be included in GitHub language statistics:
46+
/deps/** linguist-vendored
47+
/workshops/** linguist-vendored
48+
49+
benchmark/** linguist-vendored
50+
docs/* linguist-documentation
51+
etc/** linguist-vendored
52+
examples/** linguist-documentation
53+
scripts/** linguist-vendored
54+
test/** linguist-vendored
55+
tools/** linguist-vendored
56+
57+
# Configure files which should *not* be included in GitHub language statistics:
58+
Makefile linguist-vendored
59+
*.mk linguist-vendored
60+
61+
# Configure files which should be included in GitHub language statistics:
62+
docs/types/*.d.ts -linguist-documentation

.github/workflows/productionize.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ jobs:
344344
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
345345
with:
346346
status: ${{ job.status }}
347-
steps: ${{ toJson(steps) }}
348347
channel: '#npm-ci'
349348
if: failure()
350349

@@ -518,7 +517,6 @@ jobs:
518517
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
519518
with:
520519
status: ${{ job.status }}
521-
steps: ${{ toJson(steps) }}
522520
channel: '#npm-ci'
523521
if: failure()
524522

@@ -698,7 +696,6 @@ jobs:
698696
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
699697
with:
700698
status: ${{ job.status }}
701-
steps: ${{ toJson(steps) }}
702699
channel: '#npm-ci'
703700
if: failure()
704701

.github/workflows/publish.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ jobs:
218218
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
219219
with:
220220
status: ${{ job.status }}
221-
steps: ${{ toJson(steps) }}
222221
channel: '#npm-ci'
223222
if: failure()
224223

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,5 @@ jobs:
9595
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
9696
with:
9797
status: ${{ job.status }}
98-
steps: ${{ toJson(steps) }}
9998
channel: '#npm-ci'
10099
if: failure()

.github/workflows/test_bundles.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ jobs:
9494
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
9595
with:
9696
status: ${{ job.status }}
97-
steps: ${{ toJson(steps) }}
9897
channel: '#npm-ci'
9998
if: failure()
10099

@@ -139,7 +138,6 @@ jobs:
139138
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
140139
with:
141140
status: ${{ job.status }}
142-
steps: ${{ toJson(steps) }}
143141
channel: '#npm-ci'
144142
if: failure()
145143

@@ -184,6 +182,5 @@ jobs:
184182
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
185183
with:
186184
status: ${{ job.status }}
187-
steps: ${{ toJson(steps) }}
188185
channel: '#npm-ci'
189186
if: failure()

.github/workflows/test_coverage.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ jobs:
119119
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
120120
with:
121121
status: ${{ job.status }}
122-
steps: ${{ toJson(steps) }}
123122
channel: '#npm-ci'
124123
if: failure()
125124

.github/workflows/test_install.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,5 @@ jobs:
8181
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
8282
with:
8383
status: ${{ job.status }}
84-
steps: ${{ toJson(steps) }}
8584
channel: '#npm-ci'
8685
if: failure()

CONTRIBUTORS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Adarsh Palaskar <[email protected]>
66
Aditya Sapra <[email protected]>
77
AgPriyanshu18 <[email protected]>
8+
Aleksandr <[email protected]>
89
Ali Salesi <[email protected]>
910
Aman Bhansali <[email protected]>
1011
Amit Jimiwal <[email protected]>
@@ -69,8 +70,10 @@ Seyyed Parsa Neshaei <[email protected]>
6970
Shashank Shekhar Singh <[email protected]>
7071
7172
Shraddheya Shendre <[email protected]>
73+
Shubh Mehta <[email protected]>
7274
Shubham Mishra <[email protected]>
7375
Snehil Shah <[email protected]>
76+
Soumajit Chatterjee <[email protected]>
7477
Spandan Barve <[email protected]>
7578
Stephannie Jiménez Gacha <[email protected]>
7679
Suraj kumar <[email protected]>
@@ -83,4 +86,5 @@ Yernar Yergaziyev <[email protected]>
8386
8487
nishant-s7 <[email protected]>
8588
orimiles5 <[email protected]>
89+
8690

README.md

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

107-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of absolute values ([_L1_ norm][l1norm]) every other element in `x`,
107+
The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of absolute values ([_L1_ norm][l1norm]) every other element in the strided array,
108108

109109
```javascript
110110
var Float64Array = require( '@stdlib/array-float64' );
111-
var floor = require( '@stdlib/math-base-special-floor' );
112111

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

116-
var v = dnanasum( N, x, 2 );
114+
var v = dnanasum( 4, x, 2 );
117115
// returns 5.0
118116
```
119117

@@ -123,14 +121,11 @@ Note that indexing is relative to the first index. To introduce an offset, use [
123121

124122
```javascript
125123
var Float64Array = require( '@stdlib/array-float64' );
126-
var floor = require( '@stdlib/math-base-special-floor' );
127124

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

131-
var N = floor( x0.length / 2 );
132-
133-
var v = dnanasum( N, x1, 2 );
128+
var v = dnanasum( 4, x1, 2 );
134129
// returns 9.0
135130
```
136131

@@ -142,26 +137,23 @@ Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision fl
142137
var Float64Array = require( '@stdlib/array-float64' );
143138

144139
var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );
145-
var N = x.length;
146140

147-
var v = dnanasum.ndarray( N, x, 1, 0 );
141+
var v = dnanasum.ndarray( 4, x, 1, 0 );
148142
// returns 5.0
149143
```
150144

151145
The function has the following additional parameters:
152146

153147
- **offset**: starting index for `x`.
154148

155-
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 absolute values ([_L1_ norm][l1norm]) every other value in `x` starting from the second value
149+
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 absolute values ([_L1_ norm][l1norm]) every other value in the strided array starting from the second value
156150

157151
```javascript
158152
var Float64Array = require( '@stdlib/array-float64' );
159-
var floor = require( '@stdlib/math-base-special-floor' );
160153

161154
var x = new Float64Array( [ 2.0, 1.0, NaN, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
162-
var N = floor( x.length / 2 );
163155

164-
var v = dnanasum.ndarray( N, x, 2, 1 );
156+
var v = dnanasum.ndarray( 4, x, 2, 1 );
165157
// returns 9.0
166158
```
167159

@@ -186,22 +178,20 @@ var v = dnanasum.ndarray( N, x, 2, 1 );
186178
<!-- eslint no-undef: "error" -->
187179

188180
```javascript
189-
var randu = require( '@stdlib/random-base-randu' );
190-
var round = require( '@stdlib/math-base-special-round' );
181+
var bernoulli = require( '@stdlib/random-base-bernoulli' );
182+
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
183+
var filledarrayBy = require( '@stdlib/array-filled-by' );
191184
var Float64Array = require( '@stdlib/array-float64' );
192185
var dnanasum = require( '@stdlib/blas-ext-base-dnanasum' );
193186

194-
var x;
195-
var i;
196-
197-
x = new Float64Array( 10 );
198-
for ( i = 0; i < x.length; i++ ) {
199-
if ( randu() < 0.2 ) {
200-
x[ i ] = NaN;
201-
} else {
202-
x[ i ] = round( randu()*100.0 );
187+
function rand() {
188+
if ( bernoulli( 0.8 ) > 0 ) {
189+
return discreteUniform( 0, 100 );
203190
}
191+
return NaN;
204192
}
193+
194+
var x = filledarrayBy( 10, 'float64', rand );
205195
console.log( x );
206196

207197
var v = dnanasum( x.length, x, 1 );

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-harness' );
24-
var randu = require( '@stdlib/random-base-randu' );
24+
var bernoulli = require( '@stdlib/random-base-bernoulli' );
25+
var uniform = require( '@stdlib/random-base-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 dnanasum = require( './../lib/dnanasum.js' );
3031

@@ -39,18 +40,15 @@ var dnanasum = require( './../lib/dnanasum.js' );
3940
* @returns {Function} benchmark function
4041
*/
4142
function createBenchmark( len ) {
42-
var x;
43-
var i;
43+
var x = filledarrayBy( len, 'float64', rand );
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()*20.0 ) - 10.0;
46+
function rand() {
47+
if ( bernoulli( 0.8 ) > 0 ) {
48+
return uniform( -10.0, 10.0 );
5149
}
50+
return NaN;
5251
}
53-
return benchmark;
5452

5553
function benchmark( b ) {
5654
var v;

0 commit comments

Comments
 (0)