Repository navigation
Conversation
Implement symmetric band diagonal scaling in JavaScript and C with a compiled Node-API binding, complete output semantics, documentation and independently executed frozen-package checks. Assisted-by: OpenAI Codex
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves a part of #2464.
Description
Add
@stdlib/lapack/base/dpbequto compute diagonal scaling factors for a real symmetric positive-definite band matrix. The coherent package includes JavaScript, C, a compiled Node-API binding, declarations, documentation, examples, benchmarks and regression tests.The proposed interfaces are
dpbequ(order, uplo, N, KD, AB, LDAB, S, SCOND, AMAX) -> INFOanddpbequ.ndarray(uplo, N, KD, AB, strideAB1, strideAB2, offsetAB, S, strideS, offsetS, SCOND, offsetSCOND, AMAX, offsetAMAX) -> INFO. The matrix remains read-only. Success writes inverse-square-root diagonal scales, the square-root minimum/maximum ratio and the maximum diagonal value. A nonpositive diagonal returns its first one-based position after copying all original diagonals to S and writing the complete AMAX; SCOND remains exactly unchanged. Safe-empty calls write only SCOND=1 and AMAX=+0 after applicable metadata validation.Active diagonals must be finite before output mutation; unused band entries may contain nonfinite values. Full band and output geometry, intrinsic Float64 views, current ordinary backing and conservative pairwise disjointness are validated before writes. Shared backing is excluded. Raw C capacity/lifetime and hidden aliases through separate foreign backing remain caller responsibilities. Native ineligibility selects fallback before dispatch; detected backend or physical-alias errors propagate without a second mutating execution.
The pinned Reference-LAPACK provenance and full BSD notice are retained. An explicit proposed difference retains the first tied AMAX extremum: mixed-zero failure reductions can have a different AMAX zero sign from the sampled GNU reference. This is documented and tested; universal signed-zero or nonfinite reference parity is not claimed.
Related Issues
Questions
The main9/ndarray14 interfaces, finite-active-diagonal domain, strict-first AMAX reduction and ordinary-backing restrictions are proposed for maintainer review, not previously adopted APIs.
Other
Actual validation ran on Node 24.19.0/Linux x64:
The declared Node floor is >=16.0.0 with NAPI 8; only Node 24/Linux was actually tested. Other Node versions/platforms, arbitrary native ABIs, universal stability and engine OOM transactionality are not certified. Benchmarks establish execution, not a performance improvement. Historical failed author/reviewer harness attempts remain preserved in the campaign evidence.
Checklist
AI Assistance
Yes
No
Code generation
Test/benchmark generation
Documentation (including examples)
Research and understanding
Disclosure
This PR was primarily authored and tested by OpenAI Codex agents. AI assistance covered implementation, reference/API research, tests, benchmarks and documentation. A separate Codex agent actually executed an independent review of the exact frozen package. This does not claim that the account holder manually authored, personally reviewed or personally understood the generated code.
@stdlib-js/reviewers