Skip to content

docs: use dedicated zero-dimensional tensor constructor in blas/ext/base/ndarray/zwxsa - #16686

Merged
kgryte merged 1 commit into
stdlib-js:developfrom
Deepanshu-Mehta:contrib/zwxsa-tensor0d
Nov 18, 2026
Merged

kgryte merged 1 commit into
stdlib-js:developfrom
Deepanshu-Mehta:contrib/zwxsa-tensor0d

Conversation

@Deepanshu-Mehta

Copy link
Copy Markdown
Contributor

Resolves a part of #16654.

Description

What is the purpose of this pull request?

This pull request:

  • updates @stdlib/blas/ext/base/ndarray/zwxsa to use the dedicated Complex128Tensor0D constructor (@stdlib/ndarray/tensor0d/complex128) instead of @stdlib/ndarray/from-scalar when creating the zero-dimensional alpha ndarray. The change covers the README examples, REPL text, TypeScript declaration example and type tests (docs/types/test.ts), JSDoc examples (lib/index.js, lib/main.js, lib/native.js), examples/index.js, the benchmarks, and the unit tests.

Runtime code and TypeScript signatures are unchanged. The only edits under lib/ are @example comments.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Reference Packages

Did the content of this pull request follow one or more existing packages? Answering is optional.

This pull request followed these packages:

What carried over from the reference(s)?

  • Replaced from-scalar plus the { 'dtype': ... } options object with the typed tensor0d constructor.

What differed, or what did you have to work out yourself?

  • complex128 takes the real and imaginary parts directly (new Complex128Tensor0D( 5.0, 0.0 )), so the intermediate Complex128 instance and its require were removed.
  • Unlike cxsa, the examples in this package also create an output vector w, so the blank line that was removed sits between w and alpha.
  • The blank line was left in the second README example and in examples/index.js, because other statements sit between the declarations there.
  • Some unit tests create alpha with a zero value (new Complex128( 0.0, 0.0 )); these became new Complex128Tensor0D( 0.0, 0.0 ).

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.

Run locally for this package:

  • examples/index.js
  • unit tests: test/test.js (4/4 pass), test/test.main.js (21/21 pass)
  • benchmark: benchmark/benchmark.js (18/18 pass)
  • make lint-javascript-files on the changed JavaScript files (no issues)
  • make lint-markdown-files on the README (no issues)
  • make lint-typescript-declarations-files on docs/types/index.d.ts and docs/types/test.ts (no issues)
  • REPL help linter (@stdlib/_tools/lint/repl-txt) on the package's docs/repl.txt (no errors or warnings)

test/test.native.js and benchmark/benchmark.native.js were updated in the same way but not executed, because building this package's native addon requires gfortran, which is not available in my environment.

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

N/A. No AI assistance was used.


@stdlib-js/reviewers

@Deepanshu-Mehta
Deepanshu-Mehta requested a review from a team November 18, 2026 05:30
@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 Nov 18, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/ndarray/zwxsa $\\color{green}207/207$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}207/207$
$\\color{green}+100.00\\%$

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

@kgryte kgryte added Documentation Improvements, additions, or changes to documentation. difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. review: 5 and removed Needs Review A pull request which needs code review. labels Nov 18, 2026

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

LGTM

@kgryte
kgryte merged commit 90996fd into stdlib-js:develop Nov 18, 2026
99 checks passed
@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Nov 18, 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: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Documentation Improvements, additions, or changes to documentation. Good First PR A pull request resolving a Good First Issue. review: 5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants