Skip to content

feat: add blas/base/ndarray/cgemv#13149

Open
MeKaustubh07 wants to merge 4 commits into
stdlib-js:developfrom
MeKaustubh07:cgemv-ndarray
Open

feat: add blas/base/ndarray/cgemv#13149
MeKaustubh07 wants to merge 4 commits into
stdlib-js:developfrom
MeKaustubh07:cgemv-ndarray

Conversation

@MeKaustubh07

Copy link
Copy Markdown
Member

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: 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 ---

Resolves #{{TODO: add issue number}}.

Description

What is the purpose of this pull request?

This pull request:

  • feat: add blas/base/ndarray/cgemv

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

---
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: 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
---
@MeKaustubh07 MeKaustubh07 requested a review from a team June 26, 2026 10:27
@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 26, 2026
@MeKaustubh07 MeKaustubh07 added GSoC Google Summer of Code. gsoc: 2026 Google Summer of Code (2026). labels Jun 26, 2026
@stdlib-bot

stdlib-bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

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

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

Abuf = uniform( len*len*2, -100.0, 100.0, {
'dtype': 'float32'
});
A = new ndarray( 'complex64', new Complex64Array( Abuf.buffer ), [ len, len ], [ len, 1 ], 0, '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.

@MeKaustubh07 You should be using ndarray/matrix/complex64 here.

Suggested change
A = new ndarray( 'complex64', new Complex64Array( Abuf.buffer ), [ len, len ], [ len, 1 ], 0, 'row-major' );
A = new Complex64Matrix( Abuf.buffer, 0, [ len, len ] );

Comment on lines +13 to +16
- first one-dimensional input ndarray.
- second one-dimensional input/output ndarray.
- first zero-dimensional ndarray containing a scalar constant.
- second zero-dimensional ndarray containing a scalar constant.

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.

Suggested change
- first one-dimensional input ndarray.
- second one-dimensional input/output ndarray.
- first zero-dimensional ndarray containing a scalar constant.
- second zero-dimensional ndarray containing a scalar constant.
- a one-dimensional input ndarray corresponding to `x`.
- a one-dimensional input/output ndarray corresponding to `y`.
- a zero-dimensional ndarray containing a scalar constant corresponding to `alpha`.
- a zero-dimensional ndarray containing a scalar constant corresponding to `beta`.

We need to be more descriptive here, as it is not clear in your current descriptions which arrays correspond to which variables in the equation.

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.

I'm guessing this comment is likely going to apply to many of your other PRs.

arrays: ArrayLikeObject<ndarray>
Array-like object containing the following ndarrays:

- a two-dimensional input ndarray.

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.

Suggested change
- a two-dimensional input ndarray.
- a two-dimensional input ndarray corresponding to `A`.

*
* - The function expects the following ndarrays:
*
* - a two-dimensional input ndarray.

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.

Same comment.

@MeKaustubh07

Copy link
Copy Markdown
Member Author

@kgryte the cgemv was already complete locally from my side so I had to push it😅.
its still not updated with latest Complex64Matrix.


{{alias}}( arrays )
Performs the matrix-vector operation `y = alpha*A*x + beta*y`, where
`alpha` and `beta` are scalars, `x` and `y` are ndarrays, and `A` is

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.

Suggested change
`alpha` and `beta` are scalars, `x` and `y` are ndarrays, and `A` is
`alpha` and `beta` are scalars, `x` and `y` are one-dimensional ndarrays, and `A` is

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.

You need to be more explicit here.

- second one-dimensional input/output ndarray.
- first zero-dimensional ndarray containing a scalar constant.
- second zero-dimensional ndarray containing a scalar constant.

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.

Also, where is the transpose argument? Why is that not included here?

@@ -0,0 +1,43 @@

{{alias}}( arrays )
Performs the matrix-vector operation `y = alpha*A*x + beta*y`, where

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 equation will need be updated to actually reflect the operation. See https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/cgemv.

var A = arrays[ 0 ];
var x = arrays[ 1 ];
var y = arrays[ 2 ];
strided( 'no-transpose', numelDimension( A, 0 ), numelDimension( A, 1 ), alpha, getData( A ), getStride( A, 0 ), getStride( A, 1 ), getOffset( A ), getData( x ), getStride( x, 0 ), getOffset( x ), beta, getData( y ), getStride( y, 0 ), getOffset( 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.

Why did you make this decision of hardcoding no-transpose?

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.

Since these are new Level 2 packages under blas/base/ndarray/*, I wasn’t sure how you’d prefer exposing parameters like trans , diag , uplo etc. as a separate argument, via an options object, or if it should be left out of scope for now. Happy to update it based on correct approach.

@kgryte kgryte left a comment

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.

There is quite a bit that will need to be cleaned up in this PR before it can move forward.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Jun 26, 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: 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
---
@MeKaustubh07

Copy link
Copy Markdown
Member Author

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Jun 27, 2026
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Jun 27, 2026
@MeKaustubh07

Copy link
Copy Markdown
Member Author

@kgryte I tracked down the lint_repl_help failure. It looks like repl-txt crashes when a {{alias:...}} reference isn’t registered, because pkg2alias() returns null and the doctest ends up calling null.split().

In this case, the missing aliases are:

  • @stdlib/ndarray/matrix/complex64 (new package)
  • @stdlib/blas/base/transpose-operation-str2enum

@MeKaustubh07 MeKaustubh07 requested a review from kgryte June 27, 2026 06:52
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jun 27, 2026
@MeKaustubh07 MeKaustubh07 added Needs Review A pull request which needs code review. and removed Needs Changes Pull request which needs changes before being merged. labels Jun 27, 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). GSoC Google Summer of Code. gsoc: 2026 Google Summer of Code (2026). Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants