Skip to content

feat: add blas/ext/base/caxpby#12639

Open
anandkaranubc wants to merge 1 commit into
stdlib-js:developfrom
anandkaranubc:feat/caxpby
Open

feat: add blas/ext/base/caxpby#12639
anandkaranubc wants to merge 1 commit into
stdlib-js:developfrom
anandkaranubc:feat/caxpby

Conversation

@anandkaranubc
Copy link
Copy Markdown
Contributor

Resolves stdlib-js/metr-issue-tracker#707

Description

What is the purpose of this pull request?

This pull request:

  • adds blas/ext/base/caxpby

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? This may include screenshots, references, and/or implementation notes.

No.

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 you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • 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.".

Used Cursor+VS Code code-generation tools to help assist with the feature.


@stdlib-js/reviewers

---
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: 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: passed
  - task: lint_c_examples
    status: passed
  - task: lint_c_benchmarks
    status: passed
  - 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
---
@anandkaranubc anandkaranubc requested a review from a team June 6, 2026 08:48
@stdlib-bot stdlib-bot added BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). Needs Review A pull request which needs code review. labels Jun 6, 2026
for ( i = 0; i < m; i++ ) {
yr = yview[ iy ];
yi = yview[ iy+1 ];
muladd( are, aim, xview[ ix ], xview[ ix+1 ], f32( f32( bre*yr ) - f32( bim*yi ) ), f32( f32( bre*yi ) + f32( bim*yr ) ), yview, 1, iy );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using (a+bi)(c+di) = (ac - bd) + (ad + bc)i

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than reinvent the wheel, why not do

Meaning, update y in-place first. Then do the muladd.

I doubt that perf will be much affected.

Comment thread lib/node_modules/@stdlib/blas/ext/base/caxpby/test/test.ndarray.js
@anandkaranubc anandkaranubc added Feature Issue or pull request for adding a new feature. JavaScript Issue involves or relates to JavaScript. C Issue involves or relates to C. METR Pull request associated with the METR project. labels Jun 6, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/caxpby $\color{green}503/503$
$\color{green}+100.00\%$
$\color{green}32/32$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}503/503$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte removed the Needs Review A pull request which needs code review. label Jun 6, 2026
Copy link
Copy Markdown
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the suggestion for the JavaScript implementation, this is looking good.

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). C Issue involves or relates to C. Feature Issue or pull request for adding a new feature. JavaScript Issue involves or relates to JavaScript. METR Pull request associated with the METR project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC]: add blas/ext/base/caxpby

3 participants