Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add lapack/base/dlacn2 #2790

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

Pranavchiku
Copy link
Member

@Pranavchiku Pranavchiku commented Aug 14, 2024

Towards #2464.

Description

What is the purpose of this pull request?

This pull request adds JS implementation for lapack/base/dlacn2.

Related Issues

Does this pull request have any related issues?

NA

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.


@stdlib-js/reviewers

@Pranavchiku Pranavchiku added Feature Issue or pull request for adding a new feature. Base Issue or pull requests related to "low-level" functionality oriented toward library consumers. JavaScript Issue involves or relates to JavaScript. LAPACK Issue or pull request related to the Linear Algebra Package (LAPACK). labels Aug 14, 2024
Copy link
Member Author

@Pranavchiku Pranavchiku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments related to lint error.

@Pranavchiku
Copy link
Member Author

Pranavchiku commented Aug 14, 2024

@kgryte can you please remove #2464 to be closed from completion of this PR, github is not allowing me to do that.

Edit: done automatically by changing resolves to towards, sorry for unnecessary ping.

Comment on lines +54 to +60
- **N**: order of matrix `A`.
- **V** [`Float64Array`][mdn-float64array], on final return `V=A*W`, where `W` is not returned.
- **X** input [`Float64Array`][mdn-float64array].
- **ISGN** [`Int32Array`][mdn-int32array] of signs.
- **EST** [`Float64Array`][mdn-float64array] containing estimate of lower bound of 1-norm of `A`.
- **KASE** [`Int32Array`][mdn-int32array] containing value KASE to control overwritting of `X`.
- **ISAVE** [`Int32Array`][mdn-int32array] for internal storage.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about these descriptions.

@Pranavchiku
Copy link
Member Author

I'll add more tests once decision over #2792 is made. Now, working to support negative strides for idamax.

@Pranavchiku Pranavchiku marked this pull request as ready for review August 16, 2024 14:29

# dlacn2

> Estimate the 1-norm of a square, real matrix `A`, reverse communication is used for evaluating matrix-vector products.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description is hard to read, as "reverse communication..." is a separate clause. This should be improved.

}
EST[ offsetEST ] = dasum( N, X, strideX, offsetX );
for ( i = 0; i < N; i++ ) {
if ( X[ offsetX + ( i * strideX ) ] >= 0.0 ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as in other PRs. Use a tmp variable: ix = offsetX and then ix += strideX. Your implementations consistently have unnecessary flops.

@kgryte kgryte added the Needs Changes Pull request which needs changes before being merged. label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Base Issue or pull requests related to "low-level" functionality oriented toward library consumers. Feature Issue or pull request for adding a new feature. JavaScript Issue involves or relates to JavaScript. 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.

2 participants