Skip to content

feat: add C implementation for blas/ext/base/ndarray/dtriu - #16273

Open
AtharvaPatange wants to merge 4 commits into
stdlib-js:developfrom
AtharvaPatange:feat/blas-dtriu
Open

AtharvaPatange wants to merge 4 commits into
stdlib-js:developfrom
AtharvaPatange:feat/blas-dtriu

Conversation

@AtharvaPatange

@AtharvaPatange AtharvaPatange commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Resolves part of #14819.

Description

What is the purpose of this pull request?

This pull request:

  • Adds a native C implementation for blas/ext/base/ndarray/dtriu.
  • Retains the JavaScript fallback when the native addon is unavailable.
  • Adds native tests, C examples, and C benchmarks.
  • Uses a zero-dimensional int32 ndarray for the diagonal offset k.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

I’ve added allocation and ndarray metadata checks (NULL checks) in dtriu/benchmark.length.c, similar to the existing ztriu implementation. Should I keep these checks and the related changes, or would you prefer that I strictly follow the existing dtril benchmark implementation for consistency?

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

The int32 scalar approach follows the discussion in #14471 .

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

AI assistance was used to update tests and benchmarks, and prepare documentation.


@stdlib-js/reviewers

@AtharvaPatange
AtharvaPatange requested a review from a team October 20, 2026 18:32
@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 Oct 20, 2026
@stdlib-bot

stdlib-bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/ndarray/dtriu $\\color{green}226/226$
$\\color{green}+0.00\\%$
$\\color{green}7/7$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}226/226$
$\\color{green}+0.00\\%$

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

Comment thread lib/node_modules/@stdlib/blas/ext/base/ndarray/dtriu/README.md Outdated
Comment thread lib/node_modules/@stdlib/blas/ext/base/ndarray/dtriu/README.md Outdated
AtharvaPatange and others added 2 commits October 21, 2026 21:48
Co-authored-by: Ujjwal Verma <ujjwalverma010305@gmail.com>
Signed-off-by: Atharva Patange <164712914+AtharvaPatange@users.noreply.github.com>
Co-authored-by: Ujjwal Verma <ujjwalverma010305@gmail.com>
Signed-off-by: Atharva Patange <164712914+AtharvaPatange@users.noreply.github.com>

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

BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants