feat: add `blas/ext/base/ndarray/dcusumors`
- Add JavaScript implementation for computing cumulative sum of a one-dimensional double-precision floating-point ndarray using ordinary recursive summation
- Add comprehensive test suite with edge cases
- Add benchmarks for performance testing
- Add usage examples
- Add TypeScript type definitions
- Add REPL documentation
Relates to #2039
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: passed
- task: lint_repl_help status: passed
- task: lint_javascript_src status: passed
- task: lint_javascript_cli status: na
- task: lint_javascript_examples status: passed
- task: lint_javascript_tests status: passed
- task: lint_javascript_benchmarks status: passed
- task: lint_python status: na
- task: lint_r status: na
- task: lint_c_src status: na
- 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: passed
- task: lint_typescript_tests status: passed
- task: lint_license_headers status: passed
Progresses #2039.
Description
What is the purpose of this pull request?
This pull request:
- Adds
@stdlib/blas/ext/base/ndarray/dcusumorspackage for computing the cumulative sum of a one-dimensional double-precision floating-point ndarray using ordinary recursive summation - Provides an ndarray wrapper for the existing
@stdlib/blas/ext/base/dcusumorsfunction - Follows the established pattern used by other ndarray implementations (e.g.,
dcusumkbn2,gsumkbn2)
Related Issues
Does this pull request have any related issues?
This pull request has the following related issues:
- #2039 (BLAS bindings and implementations tracking issue)
Questions
Any questions for reviewers of this pull request?
No.
Other
Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.
Package Structure:
- JavaScript implementation (lib/main.js, lib/index.js)
- Comprehensive test suite with edge cases, negative strides, and view offsets
- Benchmarks for performance testing across different array sizes
- Usage examples demonstrating the API
- TypeScript type definitions with full test coverage
- REPL documentation for interactive usage
Implementation Details:
- Wraps the existing strided array implementation from
@stdlib/blas/ext/base/dcusumors - Uses standard ndarray utilities (
numelDimension,getStride,getOffset,getData) - Handles scalar initial value conversion via
ndarraylike2scalar - Returns the output ndarray for method chaining
Checklist
Please ensure the following tasks are completed before submitting this pull request.
- [x] Read, understood, and followed the contributing guidelines.
AI Assistance
When authoring the changes proposed in this PR, did you use any kind of AI assistance?
- [x] Yes
- [ ] No
If you answered "yes" above, how did you use AI assistance?
- [x] Code generation (e.g., when writing an implementation or fixing a bug)
- [x] Test/benchmark generation
- [x] Documentation (including examples)
- [ ] Research and understanding
Disclosure
If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".
This PR was authored with assistance from GitHub Copilot (Claude). The implementation follows the established patterns from existing ndarray implementations (specifically dcusumkbn2). All code adheres to stdlib conventions and passes linting/static analysis checks.
@stdlib-js/reviewers
Coverage Report
| Package | Statements | Branches | Functions | Lines |
|---|---|---|---|---|
| blas/ext/base/ndarray/dcusumors | $\color{green}131/131$ $\color{green}+0.00%$ |
$\color{green}3/3$ $\color{green}+0.00%$ |
$\color{green}1/1$ $\color{green}+0.00%$ |
$\color{green}131/131$ $\color{green}+0.00%$ |
The above coverage report was generated for the changes in this PR.
Hi @kgryte Please review this PR when you get time.