Skip to content

Commit b46d7e7

Browse files
chore: applying changes from code review
1 parent f796ca3 commit b46d7e7

File tree

6 files changed

+23
-31
lines changed

6 files changed

+23
-31
lines changed

lib/node_modules/@stdlib/stats/base/dsmeanpw/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ console.log( v );
180180

181181
#### stdlib_strided_dsmeanpw( N, \*X, strideX )
182182

183-
Calculate the mean value of a single-precision floating-point strided array, ignoring `NaN` values.
183+
Computes the arithmetic mean of a single-precision floating-point strided array `x` using pairwise summation with extended accumulation and returning an extended precision result.
184184

185185
```c
186186
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
187187

188-
float v = stdlib_strided_dsmeanpw( 4, x, 2 );
188+
double v = stdlib_strided_dsmeanpw( 4, x, 2 );
189189
// returns 1.25
190190
```
191191
@@ -201,12 +201,12 @@ double stdlib_strided_dsmeanpw( const CBLAS_INT N, const float *X, const CBLAS_I
201201

202202
#### stdlib_strided_dsmeanpw_ndarray( N, \*X, strideX, offsetX )
203203

204-
Computes the mean value of a single-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics.
204+
Computes the arithmetic mean of a single-precision floating-point strided array using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result.
205205

206206
```c
207207
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
208208

209-
float v = stdlib_strided_dsmeanpw_ndarray( 4, x, 2, 0 );
209+
double v = stdlib_strided_dsmeanpw_ndarray( 4, x, 2, 0 );
210210
// returns 1.25
211211
```
212212

lib/node_modules/@stdlib/stats/base/dsmeanpw/benchmark/c/benchmark.length.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ static float rand_float( void ) {
9797
static double benchmark1( int iterations, int len ) {
9898
double elapsed;
9999
float x[ len ];
100-
float v;
100+
double v;
101101
double t;
102102
int i;
103103

104104
for ( i = 0; i < len; i++ ) {
105105
x[ i ] = ( rand_float()*20000.0f ) - 10000.0f;
106106
}
107-
v = 0.0f;
107+
v = 0.0;
108108
t = tic();
109109
for ( i = 0; i < iterations; i++ ) {
110110
// cppcheck-suppress uninitvar
@@ -131,14 +131,14 @@ static double benchmark1( int iterations, int len ) {
131131
static double benchmark2( int iterations, int len ) {
132132
double elapsed;
133133
float x[ len ];
134-
float v;
134+
double v;
135135
double t;
136136
int i;
137137

138138
for ( i = 0; i < len; i++ ) {
139139
x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f;
140140
}
141-
v = 0.0f;
141+
v = 0.0;
142142
t = tic();
143143
for ( i = 0; i < iterations; i++ ) {
144144
// cppcheck-suppress uninitvar

lib/node_modules/@stdlib/stats/base/dsmeanpw/docs/repl.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
array using pairwise summation with extended accumulation and returning an
55
extended precision result.
66

7-
The `N` and stride parameters determine which elements in `x` are accessed
8-
at runtime.
7+
The `N` and stride parameters determine which elements in the strided array
8+
are accessed at runtime.
99

1010
Indexing is relative to the first index. To introduce an offset, use a typed
1111
array view.
@@ -21,7 +21,7 @@
2121
Input array.
2222

2323
strideX: integer
24-
Stride Length.
24+
Stride length.
2525

2626
Returns
2727
-------
@@ -35,16 +35,16 @@
3535
> {{alias}}( x.length, x, 1 )
3636
~0.3333
3737

38-
// Using `N` and `stride` parameters:
38+
// Using `N` and stride parameters:
3939
> x = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] );
40-
> {{alias}}( 4, x, 2 )
41-
NaN
40+
> {{alias}}( 3, x, 2 )
41+
~0.3333
4242

4343
// Using view offsets:
4444
> var x0 = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
4545
> var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
46-
> {{alias}}( 4, x1, 2 )
47-
NaN
46+
> {{alias}}( 3, x1, 2 )
47+
~-0.3333
4848

4949

5050
{{alias}}.ndarray( N, x, strideX, offsetX )
@@ -65,7 +65,7 @@
6565
Input array.
6666

6767
strideX: integer
68-
Stride Length.
68+
Stride length.
6969

7070
offsetX: integer
7171
Starting index.
@@ -84,8 +84,8 @@
8484

8585
// Using offset parameter:
8686
> var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
87-
> {{alias}}.ndarray( 4, x, 2, 1 )
88-
NaN
87+
> {{alias}}.ndarray( 3, x, 2, 1 )
88+
~-0.3333
8989

9090
See Also
9191
--------

lib/node_modules/@stdlib/stats/base/dsmeanpw/include/stdlib/stats/base/dsmeanpw.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 using pairwise summation with extended accumulation and returning an extended precision result.
32+
* Computes the arithmetic mean of a single-precision floating-point strided array `x` using pairwise summation with extended accumulation and returning an extended precision result.
3333
*/
3434
double API_SUFFIX(stdlib_strided_dsmeanpw)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX );
3535

3636
/**
37-
* Computes the mean absolute value 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 using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result.
3838
*/
3939
double API_SUFFIX(stdlib_strided_dsmeanpw_ndarray)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
4040

lib/node_modules/@stdlib/stats/base/dsmeanpw/manifest.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
"dependencies": [
4141
"@stdlib/blas/base/shared",
4242
"@stdlib/strided/base/stride2offset",
43-
"@stdlib/math/base/assert/is-positive-zero",
44-
"@stdlib/math/base/assert/is-nan",
4543
"@stdlib/blas/ext/base/dssum",
4644
"@stdlib/napi/export",
4745
"@stdlib/napi/argv",
@@ -64,8 +62,6 @@
6462
"dependencies": [
6563
"@stdlib/blas/base/shared",
6664
"@stdlib/strided/base/stride2offset",
67-
"@stdlib/math/base/assert/is-nan",
68-
"@stdlib/math/base/assert/is-positive-zero",
6965
"@stdlib/blas/ext/base/dssum"
7066
]
7167
},
@@ -83,8 +79,6 @@
8379
"dependencies": [
8480
"@stdlib/blas/base/shared",
8581
"@stdlib/strided/base/stride2offset",
86-
"@stdlib/math/base/assert/is-nan",
87-
"@stdlib/math/base/assert/is-positive-zero",
8882
"@stdlib/blas/ext/base/dssum"
8983
]
9084
},
@@ -102,8 +96,6 @@
10296
"dependencies": [
10397
"@stdlib/blas/base/shared",
10498
"@stdlib/strided/base/stride2offset",
105-
"@stdlib/math/base/assert/is-nan",
106-
"@stdlib/math/base/assert/is-positive-zero",
10799
"@stdlib/blas/ext/base/dssum"
108100
]
109101
}

lib/node_modules/@stdlib/stats/base/dsmeanpw/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <stdint.h>
2424

2525
/**
26-
* Computes the arithmetic mean of a single-precision floating-point strided array using pairwise summation with extended accumulation and returning an extended precision result.
26+
* Computes the arithmetic mean of a single-precision floating-point strided array `x` using pairwise summation with extended accumulation and returning an extended precision result.
2727
*
2828
* @param N number of indexed elements
2929
* @param X input array
@@ -36,7 +36,7 @@ double API_SUFFIX(stdlib_strided_dsmeanpw)( const CBLAS_INT N, const float *X, c
3636
}
3737

3838
/**
39-
* Computes the arithmetic mean of a single-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics.
39+
* Computes the arithmetic mean of a single-precision floating-point strided array using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result.
4040
*
4141
* @param N number of indexed elements
4242
* @param X input array

0 commit comments

Comments
 (0)