Skip to content

feat: add C implementation for blas/ext/base/ndarray/dcusum - #14846

Open
Nehant14 wants to merge 1 commit into
stdlib-js:developfrom
Nehant14:feat/dcusum-ndarray-c
Open

feat: add C implementation for blas/ext/base/ndarray/dcusum#14846
Nehant14 wants to merge 1 commit into
stdlib-js:developfrom
Nehant14:feat/dcusum-ndarray-c

Conversation

@Nehant14

Copy link
Copy Markdown

Resolves part of #14819.

Description

What is the purpose of this pull request?

This pull request:

  • adds a native C implementation for blas/ext/base/ndarray/dcusum, computing the cumulative sum of a one-dimensional double-precision floating-point ndarray
  • adds src/main.c, src/addon.c, include/stdlib/blas/ext/base/ndarray/dcusum.h, binding.gyp, include.gypi, manifest.json, src/Makefile, examples/c/Makefile, and examples/c/example.c
  • updates lib/index.js to prefer the native addon, falling back to the existing pure JavaScript implementation when the addon is unavailable, and adds lib/native.js to load it
  • adds tests for the native binding (test/test.native.js), mirroring the existing JavaScript test suite
  • verifies that both the native addon and the JavaScript fallback independently pass the full test suite (25/25), that test.native.js correctly skips rather than fails when the addon is unavailable, and that the C example's output matches a manually computed cumulative sum

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request?

lint_c_src and lint_c_examples show missing_dependencies in the static analysis report because cppcheck is not installed in my local dev environment; CI should run this check properly.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If yes:

  • Code generation
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

I used Claude to help debug local build/tooling issues (a missing src/Makefile and examples/c/Makefile required for the native-addon build pipeline, and a stale build cache that silently prevented the compiled addon from being copied to src/addon.node), and to independently verify the C example's cumulative-sum output against manual calculation. The implementation itself was authored by me; AI tools were used for debugging and verification only.

@Nehant14
Nehant14 requested a review from a team August 31, 2026 11:41
@stdlib-bot stdlib-bot added BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels Aug 31, 2026
---
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_pkg_readmes
    status: passed
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: passed
  - 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: missing_dependencies
  - task: lint_c_examples
    status: missing_dependencies
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@Nehant14
Nehant14 force-pushed the feat/dcusum-ndarray-c branch from de690ff to bfa978e Compare August 31, 2026 11:57
@MeKaustubh07 MeKaustubh07 changed the title feat: add C implementation for blas/ext/base/ndarray/dcusum feat: add C implementation for blas/ext/base/ndarray/dcusum Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants