Skip to content

refactor!: update lapack/base/dlassq to use separate output arrays - #15668

Open
ujjwalv01 wants to merge 2 commits into
stdlib-js:developfrom
ujjwalv01:refactor-lapack-base-dlassq
Open

ujjwalv01 wants to merge 2 commits into
stdlib-js:developfrom
ujjwalv01:refactor-lapack-base-dlassq

Conversation

@ujjwalv01

Copy link
Copy Markdown
Member

Resolves none.

Description

What is the purpose of this pull request?

This pull request:

  • refactors lapack/base/dlassq to write its scalar outputs to separate single-element arrays rather than a packed two-element out array, following the convention used by lapack/base/dladiv and lapack/base/dlaln2 (feat: add lapack/base/dlaln2 #15222).
  • changes the signature to dlassq( N, X, strideX, scale, sumsq ) and dlassq.ndarray( N, X, strideX, offsetX, scale, offsetScale, sumsq, offsetSumsq ), where scale and sumsq are Float64Arrays containing a single element. Each array provides the input value and is overwritten with the updated value, mirroring the INOUT semantics of the reference Fortran routine.
  • removes the return value (the function now returns void), as the routine has no matrix output.
  • updates the tests, benchmarks, examples, README, REPL text, TypeScript declarations, and the lapack/base namespace declarations accordingly.

The underlying algorithm is unchanged. All previously expected values are retained in the tests, and the refactored implementation was verified to be bit-for-bit identical to the previous implementation across 200,000 randomly generated inputs spanning the small, medium, and large scaling regimes, NaN, ±Infinity, and N <= 0.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

No.

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.

This is a breaking change to the public API. Nothing merged on develop currently calls dlassq; the open PRs which do are listed in a follow-up comment below and will be updated once this lands.

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

BREAKING CHANGE: use single-element arrays for `scale` and `sumsq`

To migrate, users should provide `scale` and `sumsq` as single-element `Float64Array`s containing the input values. The routine overwrites them with the updated scaling factor and sum of squares and no longer returns an output array. For the `ndarray` method, replace `scale, sumsq, out, strideOut, offsetOut` with `scale, offsetScale, sumsq, offsetSumsq`.
@stdlib-bot stdlib-bot added the LAPACK Issue or pull request related to the Linear Algebra Package (LAPACK). label Sep 29, 2026
@stdlib-bot

stdlib-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
lapack/base $\\color{red}10747/13609$
$\\color{green}+0.00\\%$
$\\color{red}143/170$
$\\color{green}+0.00\\%$
$\\color{red}0/108$
$\\color{green}+0.00\\%$
$\\color{red}10747/13609$
$\\color{green}+0.00\\%$
lapack/base/dlassq $\\color{red}417/419$
$\\color{green}+0.00\\%$
$\\color{red}41/42$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{red}417/419$
$\\color{green}+0.00\\%$

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

@ujjwalv01

Copy link
Copy Markdown
Member Author

Note

Follow-up once this PR is merged (self-reminder) - the following open PRs call dlassq with the previous packed-out signature and need to be updated to the new ( scale, offsetScale, sumsq, offsetSumsq ) form:

Nothing merged on develop calls dlassq, so no shipped code is affected.

@ujjwalv01
ujjwalv01 marked this pull request as ready for review September 29, 2026 20:11
@ujjwalv01
ujjwalv01 requested a review from a team September 29, 2026 20:11
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LAPACK Issue or pull request related to the Linear Algebra Package (LAPACK). Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants