Skip to content

Commit

Permalink
fix: updated function to support ndarray
Browse files Browse the repository at this point in the history
---
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: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - 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: na
  - 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: na
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: passed
---
  • Loading branch information
0PrashantYadav0 committed Jan 12, 2025
1 parent 7b3cfe8 commit b281eb7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var addon = require( './../src/addon.node' );
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] );
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
*
* var v = dvariancepn( 4, 1, x, 2, 1 );
* // returns 6.25
Expand Down
8 changes: 2 additions & 6 deletions lib/node_modules/@stdlib/stats/base/dvariancepn/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,9 @@ double API_SUFFIX(stdlib_strided_dvariancepn_ndarray)( const CBLAS_INT N, const
return 0.0;
}
// Compute an estimate for the mean:
mu = stdlib_strided_dsumpw( N, X, strideX ) / dN;
mu = API_SUFFIX(stdlib_strided_dsumpw_ndarray)( N, X, strideX, offsetX ) / dN;

if ( strideX < 0 ) {
ix = (1-N) * strideX;
} else {
ix = 0;
}
ix = offsetX;
// Compute the variance...
M2 = 0.0;
M = 0.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ tape( 'the function supports an `offset` parameter', opts, function test( t ) {

x = new Float64Array([
1.0,
2.0, // 0
1.0, // 0
2.0,
-7.0, // 1
-2.0, // 1
-2.0,
3.0, // 2
4.0,
2.0 // 3
2.0, // 2
3.0,
4.0 // 3
]);

v = dvariancepn( 4, 1, x, 2, 1 );
Expand Down

0 comments on commit b281eb7

Please sign in to comment.