Skip to content

feat: add blas/base/ndarray/caxpy#11459

Open
MeKaustubh07 wants to merge 6 commits intostdlib-js:developfrom
MeKaustubh07:blas/base/ndarray/caxpy
Open

feat: add blas/base/ndarray/caxpy#11459
MeKaustubh07 wants to merge 6 commits intostdlib-js:developfrom
MeKaustubh07:blas/base/ndarray/caxpy

Conversation

@MeKaustubh07
Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • feat: add blas/base/ndarray/caxpy

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • #{{TODO: add related issue number}}

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.".

{{TODO: add disclosure if applicable}}


@stdlib-js/reviewers

@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 Apr 14, 2026
@MeKaustubh07 MeKaustubh07 marked this pull request as draft April 14, 2026 18:13
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Apr 14, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Apr 16, 2026

Coverage Report

Package Statements Branches Functions Lines
blas/base/ndarray/caxpy $\color{green}125/125$
$\color{green}+0.00%$
$\color{green}3/3$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}125/125$
$\color{green}+0.00%$

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

'use strict';

/**
* BLAS level 1 routine to multiply a one-dimensional single-precision complex floating-point ndarray `x` by a constant `alpha` and add the result to a one-dimensional single-precision complex floating-point ndarray `y`.
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.

Hmm...I am not actually seeing why the linter is failing here. The values look the same. This is possibly a bug in our doctest runner.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think this wasn’t about lint/style issue in index.js, it seems failing job was the JavaScript example runner, and the error was a runtime RangeError from Complex64Array length validation.

* var ybuf = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
* var y = new ndarray( 'complex64', ybuf, [ 4 ], [ 1 ], 0, 'row-major' );
*
* var alpha = scalar2ndarray( new Complex64( 0.4, -0.7 ), 'complex64', 'row-major' );
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.

As a workaround, you can make your life easier by using integer values here.

Suggested change
* var alpha = scalar2ndarray( new Complex64( 0.4, -0.7 ), 'complex64', 'row-major' );
* var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), 'complex64', 'row-major' );

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.

This way you don't return approximate values but nice round numbers. Applies throughout this PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, makes sense now. it was originally a base/caxpy interpretation. Thanks for the suggestion!

@kgryte kgryte added Feature Issue or pull request for adding a new feature. difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Needs Changes Pull request which needs changes before being merged. review: 4 labels Apr 17, 2026
@MeKaustubh07 MeKaustubh07 marked this pull request as ready for review April 17, 2026 11:24
@MeKaustubh07 MeKaustubh07 requested a review from a team April 17, 2026 11:24
@MeKaustubh07
Copy link
Copy Markdown
Member Author

/stdlib merge

@stdlib-bot stdlib-bot added bot: In Progress Pull request is currently awaiting automation. Needs Review A pull request which needs code review. labels Apr 17, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

/stdlib merge

@MeKaustubh07, the slash command failed to complete. Please check the workflow logs for details.

View workflow run

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Apr 17, 2026
@MeKaustubh07 MeKaustubh07 requested a review from kgryte April 17, 2026 14:43
@kgryte kgryte removed the Needs Changes Pull request which needs changes before being merged. label Apr 17, 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). difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Feature Issue or pull request for adding a new feature. Needs Review A pull request which needs code review. review: 4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants