Skip to content

Commit ad1736f

Browse files
committed
fix: address review comments
1 parent 3aac599 commit ad1736f

File tree

10 files changed

+40
-40
lines changed

10 files changed

+40
-40
lines changed

lib/node_modules/@stdlib/stats/strided/snanmeankbn/README.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# snanmeankbn
2222

23-
> Calculate the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
23+
> Calculate the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
2424
2525
<section class="intro">
2626

@@ -53,7 +53,7 @@ var snanmeankbn = require( '@stdlib/stats/strided/snanmeankbn' );
5353

5454
#### snanmeankbn( N, x, strideX )
5555

56-
Calculate the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
56+
Calculate the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
5757

5858
```javascript
5959
var Float32Array = require( '@stdlib/array/float32' );
@@ -97,7 +97,7 @@ var v = snanmeankbn( 5, x1, 2 );
9797

9898
#### snanmeankbn.ndarray( N, x, strideX, offsetX )
9999

100-
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm with alternative indexing semantics.
100+
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm and alternative indexing semantics.
101101

102102
```javascript
103103
var Float32Array = require( '@stdlib/array/float32' );
@@ -198,7 +198,7 @@ console.log( v );
198198

199199
#### stdlib_strided_snanmeankbn( N, \*X, strideX )
200200

201-
Calculate the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
201+
Calculate the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
202202

203203
```c
204204
const float x[] = { 1.0f, 2.0f, 3.0f, 0.0f/0.0f };
@@ -219,7 +219,7 @@ float stdlib_strided_snanmeankbn( const CBLAS_INT N, const float *X, const CBLAS
219219

220220
#### stdlib_strided_snanmeankbn_ndarray( N, \*X, strideX, offsetX )
221221

222-
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm with alternative indexing semantics.
222+
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm and alternative indexing semantics.
223223

224224
```c
225225
const float x[] = { 1.0f, 2.0f, 3.0f, 0.0f/0.0f };
@@ -291,14 +291,6 @@ int main( void ) {
291291
292292
<section class="related">
293293
294-
* * *
295-
296-
## See Also
297-
298-
- <span class="package-name">[`@stdlib/stats/strided/dmeankbn`][@stdlib/stats/strided/dmeankbn]</span><span class="delimiter">: </span><span class="description">calculate the arithmetic mean of a double-precision floating-point strided array using an improved Kahan–Babuška algorithm.</span>
299-
- <span class="package-name">[`@stdlib/stats/strided/smeankbn`][@stdlib/stats/strided/smeankbn]</span><span class="delimiter">: </span><span class="description">calculate the arithmetic mean of a single-precision floating-point strided array using an improved Kahan–Babuška algorithm.</span>
300-
- <span class="package-name">[`@stdlib/stats/strided/meankbn`][@stdlib/stats/strided/meankbn]</span><span class="delimiter">: </span><span class="description">calculate the arithmetic mean of a strided array using an improved Kahan–Babuška algorithm.</span>
301-
302294
</section>
303295
304296
<!-- /.related -->
@@ -315,12 +307,6 @@ int main( void ) {
315307
316308
<!-- <related-links> -->
317309
318-
[@stdlib/stats/strided/dmeankbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/dmeankbn
319-
320-
[@stdlib/stats/strided/smeankbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/smeankbn
321-
322-
[@stdlib/stats/strided/meankbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/meankbn
323-
324310
<!-- </related-links> -->
325311
326312
</section>

lib/node_modules/@stdlib/stats/strided/snanmeankbn/docs/repl.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
{{alias}}( N, x, strideX )
3-
Computes the arithmetic mean of a single-precision floating-point strided array
4-
ignoring NaN values and using an improved Kahan-Babuska algorithm.
3+
Computes the arithmetic mean of a single-precision floating-point strided
4+
array, ignoring `NaN` values and using an improved Kahan-Babuska
5+
algorithm.
56

67
The `N` and stride parameters determine which elements in the strided array
78
are accessed at runtime.
@@ -50,7 +51,8 @@
5051

5152
{{alias}}.ndarray( N, x, strideX, offsetX )
5253
Computes the arithmetic mean of a single-precision floating-point strided
53-
array, ignoring `NaN` values and using alternative indexing semantics.
54+
array, ignoring `NaN` values and using an improved Kahan-Babuska
55+
algorithm and alternative indexing semantics.
5456

5557
While typed array views mandate a view offset based on the underlying
5658
buffer, the `offset` parameter supports indexing semantics based on a

lib/node_modules/@stdlib/stats/strided/snanmeankbn/docs/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
// TypeScript Version: 4.1
2020

2121
/**
22-
* Interface describing snanmeankbn`.
22+
* Interface describing `snanmeankbn`.
2323
*/
2424
interface Routine {
2525
/**
26-
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
26+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
2727
*
2828
* @param N - number of indexed elements
2929
* @param x - input array
@@ -41,7 +41,7 @@ interface Routine {
4141
( N: number, x: Float32Array, strideX: number ): number;
4242

4343
/**
44-
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm with alternative indexing semantics.
44+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm and alternative indexing semantics.
4545
*
4646
* @param N - number of indexed elements
4747
* @param x - input array
@@ -61,7 +61,7 @@ interface Routine {
6161
}
6262

6363
/**
64-
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
64+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
6565
*
6666
* @param N - number of indexed elements
6767
* @param x - input array

lib/node_modules/@stdlib/stats/strided/snanmeankbn/include/stdlib/stats/strided/snanmeankbn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ extern "C" {
2929
#endif
3030

3131
/**
32-
* Computes the arithmetic mean of a single-precision floating-point strided array, ignoring `NaN` values.
32+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
3333
*/
3434
float API_SUFFIX(stdlib_strided_snanmeankbn)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX );
3535

3636
/**
37-
* Computes the arithmetic mean of a single-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics.
37+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm and alternative indexing semantics.
3838
*/
3939
float API_SUFFIX(stdlib_strided_snanmeankbn_ndarray)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
4040

lib/node_modules/@stdlib/stats/strided/snanmeankbn/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* Compute the arithmetic mean of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
22+
* Compute the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
2323
*
2424
* @module @stdlib/stats/strided/snanmeankbn
2525
*

lib/node_modules/@stdlib/stats/strided/snanmeankbn/lib/ndarray.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ var snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' ).ndarray;
2727
// MAIN //
2828

2929
/**
30-
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
30+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
31+
*
32+
* ## Method
33+
*
34+
* - This implementation uses an "improved Kahan–Babuška algorithm", as described by Neumaier (1974).
35+
*
36+
* ## References
37+
*
38+
* - Neumaier, Arnold. 1974. "Rounding Error Analysis of Some Methods for Summing Finite Sums." _Zeitschrift Für Angewandte Mathematik Und Mechanik_ 54 (1): 39–51. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).
3139
*
3240
* @param {PositiveInteger} N - number of indexed elements
3341
* @param {Float32Array} x - input array
@@ -54,7 +62,6 @@ function snanmeankbn( N, x, strideX, offsetX ) {
5462
if ( N <= 0 ) {
5563
return NaN;
5664
}
57-
5865
ix = offsetX;
5966
for ( i = 0; i < N; i++ ) {
6067
v = x[ ix ];
@@ -63,13 +70,10 @@ function snanmeankbn( N, x, strideX, offsetX ) {
6370
}
6471
ix += strideX;
6572
}
66-
6773
if ( count === 0 ) {
6874
return NaN;
6975
}
70-
7176
sum = snansumkbn( N, x, strideX, offsetX );
72-
7377
return float64ToFloat32( sum / count );
7478
}
7579

lib/node_modules/@stdlib/stats/strided/snanmeankbn/lib/ndarray.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var addon = require( './../src/addon.node' );
2626
// MAIN //
2727

2828
/**
29-
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
29+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
3030
*
3131
* @param {PositiveInteger} N - number of indexed elements
3232
* @param {Float32Array} x - input array

lib/node_modules/@stdlib/stats/strided/snanmeankbn/lib/snanmeankbn.js

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

2323
var stride2offset = require( '@stdlib/strided/base/stride2offset' );
24-
var ndarray = require( '@stdlib/stats/strided/snanmeankbn/lib/ndarray.js' );
24+
var ndarray = require( './ndarray.js' );
2525

2626

2727
// MAIN //
2828

2929
/**
30-
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
30+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
31+
*
32+
* ## Method
33+
*
34+
* - This implementation uses an "improved Kahan–Babuška algorithm", as described by Neumaier (1974).
35+
*
36+
* ## References
37+
*
38+
* - Neumaier, Arnold. 1974. "Rounding Error Analysis of Some Methods for Summing Finite Sums." _Zeitschrift Für Angewandte Mathematik Und Mechanik_ 54 (1): 39–51. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).
3139
*
3240
* @param {PositiveInteger} N - number of indexed elements
3341
* @param {Float32Array} x - input array

lib/node_modules/@stdlib/stats/strided/snanmeankbn/lib/snanmeankbn.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var addon = require( './../src/addon.node' );
2626
// MAIN //
2727

2828
/**
29-
* Computes the arithmetic mean of a single-precision floating-point strided array using an improved Kahan–Babuška algorithm.
29+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
3030
*
3131
* @param {PositiveInteger} N - number of indexed elements
3232
* @param {Float32Array} x - input array

lib/node_modules/@stdlib/stats/strided/snanmeankbn/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "stdlib/strided/base/stride2offset.h"
2323

2424
/**
25-
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
25+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm.
2626
*
2727
* @param N number of indexed elements
2828
* @param X input array
@@ -35,7 +35,7 @@ float API_SUFFIX(stdlib_strided_snanmeankbn)( const CBLAS_INT N, const float *X,
3535
}
3636

3737
/**
38-
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring NaN values and using an improved Kahan-Babuska algorithm.
38+
* Computes the arithmetic mean of a single-precision floating-point strided array ignoring `NaN` values and using an improved Kahan-Babuska algorithm and alternative indexing semantics.
3939
*
4040
* @param N number of indexed elements
4141
* @param X input array

0 commit comments

Comments
 (0)