Skip to content

Commit 8ec5c91

Browse files
chore: updated according to code review
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: passed - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: passed - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 01b1482 commit 8ec5c91

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,17 @@ console.log( v );
175175
### Usage
176176

177177
```c
178-
#include "stdlib/stats/base/dnanmeanwd.h"
178+
#include "stdlib/stats/base/snanmeanwd.h"
179179
```
180180

181-
#### stdlib_strided_dnanmeanwd( N, \*X, strideX )
181+
#### stdlib_strided_snanmeanwd( N, \*X, strideX )
182182

183183
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values and using Welford's algorithm.
184184

185185
```c
186-
const double x[] = { 1.0, -2.0, 0.0/0.0, 2.0 };
186+
const double x[] = { 1.0, -2.0, 0.0f/0.0f, 2.0 };
187187

188-
double v = stdlib_strided_dnanmeanwd( 4, x, 1 );
188+
double v = stdlib_strided_snanmeanwd( 4, x, 1 );
189189
// returns ~0.33333
190190
```
191191
@@ -196,17 +196,17 @@ The function accepts the following arguments:
196196
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
197197
198198
```c
199-
float stdlib_strided_dnanmeanwd( const CBLAS_INT N, const float *X, const CBLAS_INT strideX );
199+
float stdlib_strided_snanmeanwd( const CBLAS_INT N, const float *X, const CBLAS_INT strideX );
200200
```
201201

202-
#### stdlib_strided_dnanmeanwd_ndarray( N, \*X, strideX, offsetX )
202+
#### stdlib_strided_snanmeanwd_ndarray( N, \*X, strideX, offsetX )
203203

204204
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics.
205205

206206
```c
207-
const double x[] = { 1.0, -2.0, 0.0/0.0, 2.0 };
207+
const double x[] = { 1.0, -2.0, 0.0f/0.0f, 2.0 };
208208

209-
double v = stdlib_strided_dnanmeanwd_ndarray( 4, x, 1, 0 );
209+
double v = stdlib_strided_snanmeanwd_ndarray( 4, x, 1, 0 );
210210
// returns ~0.33333
211211
```
212212
@@ -218,7 +218,7 @@ The function accepts the following arguments:
218218
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
219219
220220
```c
221-
float stdlib_strided_dnanmeanwd_ndarray( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
221+
float stdlib_strided_snanmeanwd_ndarray( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
222222
```
223223

224224
</section>
@@ -245,7 +245,7 @@ float stdlib_strided_dnanmeanwd_ndarray( const CBLAS_INT N, const float *X, cons
245245

246246
int main( void ) {
247247
// Create a strided array:
248-
const float x[] = { 1.0, 2.0, 0.0/0.0, 3.0, 0.0/0.0, 4.0, 5.0, 6.0, 0.0/0.0, 7.0, 8.0, 0.0/0.0 };
248+
const float x[] = { 1.0f, 2.0f, 0.0f/0.0f, 3.0f, 0.0f/0.0f, 4.0f, 5.0f, 6.0f, 0.0f/0.0f, 7.0f, 8.0f, 0.0f/0.0f };
249249

250250
// Specify the number of elements:
251251
const int N = 6;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ static double benchmark1( int iterations, int len ) {
102102
int i;
103103

104104
for ( i = 0; i < len; i++ ) {
105-
if ( rand_float() < 0.2 ) {
106-
x[ i ] = 0.0 / 0.0; // NaN
105+
if ( rand_float() < 0.2f ) {
106+
x[ i ] = 0.0f / 0.0f; // NaN
107107
} else {
108-
x[ i ] = ( rand_float() * 20000.0 ) - 10000.0;
108+
x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f;
109109
}
110110
}
111111
v = 0.0f;
@@ -140,10 +140,10 @@ static double benchmark2( int iterations, int len ) {
140140
int i;
141141

142142
for ( i = 0; i < len; i++ ) {
143-
if ( rand_float() < 0.2 ) {
144-
x[ i ] = 0.0 / 0.0; // NaN
143+
if ( rand_float() < 0.2f ) {
144+
x[ i ] = 0.0f / 0.0f; // NaN
145145
} else {
146-
x[ i ] = ( rand_float() * 20000.0 ) - 10000.0;
146+
x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f;
147147
}
148148
}
149149
v = 0.0f;

lib/node_modules/@stdlib/stats/base/snanmeanwd/examples/c/example.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
int main( void ) {
2323
// Create a strided array:
24-
const float x[] = { 1.0, 2.0, 0.0/0.0, 3.0, 0.0/0.0, 4.0, 5.0, 6.0, 0.0/0.0, 7.0, 8.0, 0.0/0.0 };
25-
24+
const float x[] = { 1.0f, 2.0f, 0.0f/0.0f, 3.0f, 0.0f/0.0f, 4.0f, 5.0f, 6.0f, 0.0f/0.0f, 7.0f, 8.0f, 0.0f/0.0f };
2625
// Specify the number of elements:
2726
const int N = 6;
2827

lib/node_modules/@stdlib/stats/base/snanmeanwd/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
var uniform = require( '@stdlib/random/base/uniform' );
2222
var filledarrayBy = require( '@stdlib/array/filled-by' );
2323
var bernoulli = require( '@stdlib/random/base/bernoulli' );
24-
var snanmeanwd = require( '@stdlib/stats/base/snanmeanwd' );
24+
var snanmeanwd = require( './../lib' );
2525

2626
function rand() {
2727
if ( bernoulli( 0.8 ) < 1 ) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
*
4444
* @param N number of indexed elements
4545
* @param X input array
46-
* @param stride stride length
46+
* @param strideX stride length
4747
* @return output value
4848
*/
4949
float API_SUFFIX(stdlib_strided_snanmeanwd)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX ) {

0 commit comments

Comments
 (0)