Skip to content

Commit ec22b4d

Browse files
committed
fix: cleanups
--- 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: na - 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: passed - 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: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - 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 4f2726d commit ec22b4d

File tree

7 files changed

+10
-20
lines changed

7 files changed

+10
-20
lines changed

lib/node_modules/@stdlib/stats/base/svarianceyc/benchmark/benchmark.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ var options = {
4545
* @returns {Function} benchmark function
4646
*/
4747
function createBenchmark( len ) {
48-
var x;
49-
50-
x = uniform( len, -10, 10, options );
48+
var x = uniform( len, -10, 10, options );
5149
return benchmark;
5250

5351
function benchmark( b ) {

lib/node_modules/@stdlib/stats/base/svarianceyc/benchmark/benchmark.native.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ var options = {
5050
* @returns {Function} benchmark function
5151
*/
5252
function createBenchmark( len ) {
53-
var x;
54-
55-
x = uniform( len, -10, 10, options );
53+
var x = uniform( len, -10, 10, options );
5654
return benchmark;
5755

5856
function benchmark( b ) {

lib/node_modules/@stdlib/stats/base/svarianceyc/benchmark/benchmark.ndarray.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ var options = {
4545
* @returns {Function} benchmark function
4646
*/
4747
function createBenchmark( len ) {
48-
var x;
49-
50-
x = uniform( len, -10, 10, options );
48+
var x = uniform( len, -10, 10, options );
5149
return benchmark;
5250

5351
function benchmark( b ) {

lib/node_modules/@stdlib/stats/base/svarianceyc/benchmark/benchmark.ndarray.native.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ var options = {
5050
* @returns {Function} benchmark function
5151
*/
5252
function createBenchmark( len ) {
53-
var x;
54-
55-
x = uniform( len, -10, 10, options );
53+
var x = uniform( len, -10, 10, options );
5654
return benchmark;
5755

5856
function benchmark( b ) {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
2222
var svarianceyc = require( './../lib' );
2323

24-
var x;
25-
26-
x = discreteUniform( 10, -50, 50, {
24+
var x = discreteUniform( 10, -50, 50, {
2725
'dtype': 'float32'
2826
});
2927
console.log( x );

lib/node_modules/@stdlib/stats/base/svarianceyc/include/stdlib/stats/base/svarianceyc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern "C" {
3434
float API_SUFFIX(stdlib_strided_svarianceyc)( const CBLAS_INT N, const float correction, const float *X, const CBLAS_INT strideX );
3535

3636
/**
37-
* Computes the variance of a single-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer, using alternative indexing semantics.
37+
* Computes the variance of a single-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics.
3838
*/
3939
float API_SUFFIX(stdlib_strided_svarianceyc_ndarray)( const CBLAS_INT N, const float correction, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
4040

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ float API_SUFFIX(stdlib_strided_svarianceyc)( const CBLAS_INT N, const float cor
4444

4545

4646
/**
47-
* Computes the variance of a single-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer, using alternative indexing semantics.
47+
* Computes the variance of a single-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer and alternative indexing semantics.
4848
*
4949
* @param N number of indexed elements
5050
* @param correction degrees of freedom adjustment
@@ -65,7 +65,7 @@ float API_SUFFIX(stdlib_strided_svarianceyc_ndarray)( const CBLAS_INT N, const f
6565

6666
n = (double)N - (double)correction;
6767
if ( N <= 0 || n <= 0.0f ) {
68-
return 0.0f / 0.0f; // Nan
68+
return 0.0f / 0.0f; // NaN
6969
}
7070
if ( N ==1 || strideX == 0 ) {
7171
return 0.0f;
@@ -78,8 +78,8 @@ float API_SUFFIX(stdlib_strided_svarianceyc_ndarray)( const CBLAS_INT N, const f
7878
di = (double)i;
7979
v = X[ ix ];
8080
sum += v;
81-
d = (float)(di*(double)v) - sum;
82-
S += (float)(1.0/(di*(di-1.0))) * d * d;
81+
d = (float)( di * (double)v ) - sum;
82+
S += (float)( 1.0 / ( di * ( di-1.0 ) ) ) * d * d;
8383
ix += strideX;
8484
}
8585
return (double)S / n;

0 commit comments

Comments
 (0)