Skip to content

Commit 0147969

Browse files
chore: applying changes from code review
1 parent 49d83dd commit 0147969

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ console.log( v );
195195

196196
#### stdlib_strided_dsmeanpn( N, \*X, strideX )
197197

198-
Computes the arithmetic mean value of a single-precision floating-point strided array.
198+
Computes the arithmetic mean of a single-precision floating-point strided array using a two-pass error correction algorithm with extended accumulation and returning an extended precision result.
199199

200200
```c
201201
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
@@ -216,7 +216,7 @@ double stdlib_strided_dsmeanpn( const CBLAS_INT N, const float *X, const CBLAS_I
216216

217217
#### stdlib_strided_dsmeanpn_ndarray( N, \*X, strideX, offsetX )
218218

219-
Computes the arithmetic value value of a single-precision floating-point strided array using alternative indexing semantics.
219+
Computes the arithmetic mean of a single-precision floating-point strided array using a two-pass error correction algorithm with extended accumulation and alternative indexing semantics and returning an extended precision result.
220220

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

lib/node_modules/@stdlib/stats/base/dsmeanpn/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/dsmeanpn/docs/repl.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
array using a two-pass error correction algorithm with extended accumulation
55
and returning an 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
-------
@@ -37,14 +37,14 @@
3737

3838
// 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.333
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.333
4848

4949

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

6868
strideX: integer
69-
Index increment.
69+
Stride length.
7070

7171
offsetX: integer
7272
Starting index.
@@ -85,8 +85,8 @@
8585

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

9191
See Also
9292
--------

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

3636
/**
37-
* Computes the maximum value of a single-precision floating-point strided array using alternative indexing semantics.
37+
* Computes the arithmetic mean of a single-precision floating-point strided array using a two-pass error correction algorithm with extended accumulation and alternative indexing semantics and returning an extended precision result.
3838
*/
3939
double API_SUFFIX(stdlib_strided_dsmeanpn_ndarray)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
4040

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

Lines changed: 0 additions & 2 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-zerof",
44-
"@stdlib/math/base/assert/is-nanf",
4543
"@stdlib/napi/export",
4644
"@stdlib/napi/argv",
4745
"@stdlib/napi/argv-int64",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ double API_SUFFIX(stdlib_strided_dsmeanpn)( const CBLAS_INT N, const float *X, c
4545
}
4646

4747
/**
48-
* Computes the maximum value of a single-precision floating-point strided array using alternative indexing semantics.
48+
* Computes the arithmetic mean of a single-precision floating-point strided array using a two-pass error correction algorithm with extended accumulation and alternative indexing semantics and returning an extended precision result.
4949
*
5050
* @param N number of indexed elements
5151
* @param X input array

0 commit comments

Comments
 (0)