Skip to content

Commit 97fab3a

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: passed - 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: na - task: lint_c_benchmarks status: na - 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: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - 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 0bacbc2 commit 97fab3a

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Computes the [variance][variance] of a double-precision floating-point strided a
150150
```javascript
151151
var Float64Array = require( '@stdlib/array/float64' );
152152

153-
var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
153+
var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );
154154

155155
var v = dnanvarianceyc.ndarray( x.length, 1, x, 1, 0 );
156156
// returns ~4.33333
@@ -206,6 +206,7 @@ function rand() {
206206
}
207207

208208
var x = filledarrayBy( 10, 'float64', rand );
209+
console.log( x );
209210

210211
var v = dnanvarianceyc( x.length, 1, x, 1 );
211212
console.log( v );

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function rand() {
3131
}
3232

3333
var x = filledarrayBy( 10, 'float64', rand );
34+
console.log( x );
3435

3536
var v = dnanvarianceyc( x.length, 1, x, 1 );
3637
console.log( v );

lib/node_modules/@stdlib/stats/base/dnanvarianceyc/lib/dnanvarianceyc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ var ndarray = require( './ndarray.js' );
4747
* var Float64Array = require( '@stdlib/array/float64' );
4848
*
4949
* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );
50-
* var N = x.length;
5150
*
52-
* var v = dnanvarianceyc( N, 1, x, 1 );
51+
* var v = dnanvarianceyc( x.length, 1, x, 1 );
5352
* // returns ~4.3333
5453
*/
5554
function dnanvarianceyc( N, correction, x, strideX ) {

lib/node_modules/@stdlib/stats/base/dnanvarianceyc/src/addon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2024 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
3838
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
3939
STDLIB_NAPI_ARGV_DOUBLE( env, correction, argv, 1 );
4040
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
41-
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 2 )
41+
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 2 );
4242
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_dnanvarianceyc)( N, correction, X, strideX ), v );
4343
return v;
4444
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
* @param N number of indexed elements
3535
* @param correction degrees of freedom adjustment
3636
* @param X input array
37-
* @param stride stride length
38-
* @return variance
37+
* @param strideX stride length
38+
* @return output value
3939
*/
4040
double API_SUFFIX(stdlib_strided_dnanvarianceyc)( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX ) {
4141
const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
@@ -53,9 +53,9 @@ double API_SUFFIX(stdlib_strided_dnanvarianceyc)( const CBLAS_INT N, const doubl
5353
* @return variance
5454
*/
5555
double API_SUFFIX(stdlib_strided_dnanvarianceyc_ndarray)( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {
56-
double sum;
5756
CBLAS_INT ix;
5857
CBLAS_INT i;
58+
double sum;
5959
double nc;
6060
double n;
6161
double v;

0 commit comments

Comments
 (0)