Skip to content

feat: add lapack/base/dlarft#12972

Open
prajjwalbajpai wants to merge 5 commits into
stdlib-js:developfrom
prajjwalbajpai:dlarft
Open

feat: add lapack/base/dlarft#12972
prajjwalbajpai wants to merge 5 commits into
stdlib-js:developfrom
prajjwalbajpai:dlarft

Conversation

@prajjwalbajpai

Copy link
Copy Markdown
Contributor

Description

What is the purpose of this pull request?

This pull request:

  • adds lapack/base/dlarft

Related Issues

Does this pull request have any 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.

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

I consulted ChatGPT for testcases to get 100% code coverage.


@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
---
@stdlib-bot stdlib-bot added the LAPACK Issue or pull request related to the Linear Algebra Package (LAPACK). label Jun 19, 2026
@prajjwalbajpai

Copy link
Copy Markdown
Contributor Author

/stdlib update-copyright-years

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Jun 19, 2026
@prajjwalbajpai prajjwalbajpai added GSoC Google Summer of Code. gsoc: 2026 Google Summer of Code (2026). labels Jun 19, 2026
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Jun 19, 2026
@stdlib-bot

stdlib-bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
lapack/base/dlarft $\\color{red}1244/1292$
$\\color{green}+0.35\\%$
$\\color{red}108/114$
$\\color{red}-0.10\\%$
$\\color{red}4/5$
$\\color{red}-6.67\\%$
$\\color{red}1244/1292$
$\\color{green}+0.35\\%$

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

---
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: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - 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: na
  - task: lint_license_headers
    status: passed
---
---
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: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - 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: na
  - task: lint_license_headers
    status: passed
---
// Compute T_{2,1} = V_{2,2}
for ( j = 0; j < K - l; j++ ) {
for ( i = 0; i < l; i++ ) {
T[ offsetT + ( strideT1 * ( K - l + i ) ) + ( strideT2 * j ) ] = V[ offsetV + ( strideV1 * ( N - K + j ) ) + ( strideV2 * ( K - l + i ) ) ];

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 have a number of repeated arithmetic operations here. I suggest finding a way to simplify and consolidate.

// The last case is RQ. Due to how we structured this, if the above 3 are false, then RQ must be true, so we never store this RQ happens when we have backward direction in row storage `RQ = ( !dirf ) & ( !colv )`
if ( qr ) {
/*
Break V apart into 6 components

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.

For these extended comments, I suggest moving to a ## Method section in the JSDoc comment above. We do this in other packages (see, e.g., https://github.com/stdlib-js/stdlib/blob/71f4c292794a8e998319756da25e5c041f2b8e64/lib/node_modules/%40stdlib/stats/strided/dpcorrwd/lib/ndarray.js).

You can then use TeX for equation and matrix markup for each of the qr, lq, etc explainers.

function wrapper( v ) {
return addon( v );
function isDirection( direct ) {
return contains( [ 'forward', 'backward' ] )( direct );

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 doesn't make sense. You are creating a new function every time you invoke this.

Comment on lines 31 to 37
* @private
* @param {boolean} v - input value
* @returns {boolean} input value
*
* @example
* var v = wrapper( true );
* // returns true
* @param {string} direct - direction
* @returns {boolean} boolean indicating if the string is a valid direction
*/
function wrapper( v ) {
return addon( v );
function isDirection( direct ) {
return contains( [ 'forward', 'backward' ] )( direct );
}

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
* @private
* @param {boolean} v - input value
* @returns {boolean} input value
*
* @example
* var v = wrapper( true );
* // returns true
* @param {string} direct - direction
* @returns {boolean} boolean indicating if the string is a valid direction
*/
function wrapper( v ) {
return addon( v );
function isDirection( direct ) {
return contains( [ 'forward', 'backward' ] )( direct );
}
* @private
* @name isDirection
* @type {Function}
* @param {string} direct - direction
* @returns {boolean} boolean indicating if the string is a valid direction
*/
var isDirection= contains( [ 'forward', 'backward' ] );


var main = require( './main.js' );
function isStorage( store ) {
return contains( [ 'columnwise', 'rowwise' ] )( store );

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.

"LDV": 3,
"V_mat": [
[
1,

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.

Don't split matrix rows over multiple lines like this. The entire point of the *_mat entries is to provide a visual means of seeing the "shape"/contents of an equivalent matrix in linear memory. By splitting over multiple lines, you are making the reader do a lot more work.

Comment on lines +44 to +50
[
1,
0.2,
0.3,
-0.4,
0.5
],

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
[
1,
0.2,
0.3,
-0.4,
0.5
],
[ 1, 0.2, 0.3, -0.4, 0.5 ],

"strideTAU": 2,
"offsetTAU": 0,
"T": [
0,

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 thing here. Arrange the elements in matrix format (rows/columns). e.g.

[ 0, 9999, 0, 9999,
  0, 9999, 0, 9999,
  ...
]

See how much easier it is to visually inspect what the matrix is?

"offsetTAU": 0,
"T": [
0,
9999,

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.

These comments apply to all of your fixtures.

---
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: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - 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: na
  - task: lint_license_headers
    status: passed
---
@prajjwalbajpai prajjwalbajpai marked this pull request as ready for review June 25, 2026 18:23
@prajjwalbajpai prajjwalbajpai requested a review from a team June 25, 2026 18:23
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jun 25, 2026
@prajjwalbajpai

Copy link
Copy Markdown
Contributor Author

Made the changes as per the review.

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

Labels

GSoC Google Summer of Code. gsoc: 2026 Google Summer of Code (2026). 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.

3 participants