Skip to content

feat: add lapack/base/dlartgp - #9608

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

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

Conversation

@prajjwalbajpai

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • adds lapack/base/dlartgp

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.

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

NA


@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
    status: passed
  - 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 LAPACK Issue or pull request related to the Linear Algebra Package (LAPACK). Needs Review A pull request which needs code review. labels Jan 7, 2026
@stdlib-bot

stdlib-bot commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
lapack/base/dlartgp $\\color{red}336/340$
$\\color{green}+0.00\\%$
$\\color{red}26/27$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{red}336/340$
$\\color{green}+0.00\\%$

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

@prajjwalbajpai

Copy link
Copy Markdown
Member Author

@kgryte the test coverage is not 100% due to this part in /lib/base.js

	if ( r < 0.0 ) {
		cs *= -1;
		sn *= -1;
		r *= -1;
	}

This was a precautionary check used in the Fortran code but I believe it is not necessary with JavaScript.

Updated the comment to clarify the purpose of the LAPACK routine.

Signed-off-by: Prajjwal Bajpai <142303989+prajjwalbajpai@users.noreply.github.com>
prajjwalbajpai and others added 2 commits January 13, 2026 23:32
Signed-off-by: Prajjwal Bajpai <142303989+prajjwalbajpai@users.noreply.github.com>
---
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
    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: passed
  - 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
---
// MAIN //

/**
* Generates a plane rotation so that the diagonal is nonnegative.

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
* Generates a plane rotation so that the diagonal is nonnegative.
* Generates a plane rotation so that the diagonal is nonnegative.
*

/**
* Generates a plane rotation so that the diagonal is nonnegative.
* @private
* @param {number} F - the first component of vector to be rotated.

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
* @param {number} F - the first component of vector to be rotated.
* @param {number} F - the first component of vector to be rotated

No periods at the end of JSDoc descriptions. Applies here and throughout this PR.

* dlartgp( 1.0, 2.0, out, 1, 0 );
* // out => <Float64Array>[ ~0.447, ~0.894, ~2.236 ]
*/
var dlartgp = base;

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
var dlartgp = base;
function dlartgp( F, G, out, strideOut, offsetOut ) {
return base( F, G, out, strideOut, offsetOut );
}

One line wrapper to match conventions elsewhere.

Comment on lines +31 to +32
* @name dlartgp
* @type {Function}

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
* @name dlartgp
* @type {Function}

*
* @name dlartgp
* @type {Function}
* @param {number} F - the first component of vector to be rotated.

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
* @param {number} F - the first component of vector to be rotated.
* @param {number} F - the first component of vector to be rotated

Description punctuation.

Parameters
----------
F: number
The first component of vector to be rotated.

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
The first component of vector to be rotated.
The first component of the vector to be rotated.

The first component of vector to be rotated.

G: number
The second component of vector to be rotated.

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
The second component of vector to be rotated.
The second component of the vector to be rotated.

Applies here and throughout this PR.


out: Float64Array
Output array containing the cosine and sine of the rotation and the
non zero component of the rotated vector, respectively.

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
non zero component of the rotated vector, respectively.
nonzero component of the rotated vector, respectively.

Applies here and throughout this PR.



{{alias}}.ndarray( F, G, out, strideOut, offsetOut )
Generates a plane rotation so that the diagonal is nonnegative.

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
Generates a plane rotation so that the diagonal is nonnegative.
Generates a plane rotation so that the diagonal is nonnegative using alternative indexing semantics.

You'll need to rewrap the line.

Generates a plane rotation so that the diagonal is nonnegative.

While typed array views mandate a view offset based on the underlying
buffer, the offset parameters support indexing semantics based on starting

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
buffer, the offset parameters support indexing semantics based on starting
buffer, the offset parameter supports indexing semantics based on a starting


While typed array views mandate a view offset based on the underlying
buffer, the offset parameters support indexing semantics based on starting
indices.

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
indices.
index.


// MAIN //

bench( pkg+':ndarray', function benchmark( b ) {

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.

@prajjwalbajpai Mind updating this to use format? Cheers!

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

Left a round of comments.

@kgryte kgryte added Feature Issue or pull request for adding a new feature. Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Aug 10, 2026
@kgryte
kgryte requested a review from a team August 10, 2026 01:14
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 10, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Aug 10, 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

Feature Issue or pull request for adding a new feature. LAPACK Issue or pull request related to the Linear Algebra Package (LAPACK). Needs Changes Pull request which needs changes before being merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants