Skip to content

feat: add blas/ext/index-of #7565

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

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

Conversation

headlessNode
Copy link
Member

Progresses #2656.

Description

What is the purpose of this pull request?

This pull request:

  • add blas/ext/index-of

Related Issues

Does this pull request have any related issues?

This pull request:

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

@stdlib-bot stdlib-bot added the BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). label Jul 5, 2025
@headlessNode headlessNode added Feature Issue or pull request for adding a new feature. GSoC Google Summer of Code. gsoc: 2025 Google Summer of Code (2025). and removed BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). labels Jul 5, 2025
@stdlib-bot stdlib-bot added the BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). label Jul 5, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Jul 5, 2025

Coverage Report

Package Statements Branches Functions Lines
blas/ext/index-of $\color{green}582/582$
$\color{green}+100.00\%$
$\color{green}61/61$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}582/582$
$\color{green}+100.00\%$

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
    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: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
@headlessNode headlessNode marked this pull request as ready for review July 7, 2025 04:41
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jul 7, 2025
@headlessNode headlessNode requested a review from kgryte July 7, 2025 04:42
Signed-off-by: Muhammad Haris <101793258+headlessNode@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: na
  - 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: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
} else {
throw new TypeError( format( 'invalid argument. Third argument must be either an ndarray or an integer. Value: `%s`.', fromIndex ) );
}

Copy link
Member

Choose a reason for hiding this comment

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

Missing out argument validation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Here also, notice the case assign( x, searchElement, out, options ) at L132, and also the case above assign( x, searchElement, out ). Since fromIndex is optional and can be at 3rd place, the issue is that fromIndex can also be ndarrayLike so consider the case assign( x, searchElement, fromIndex_ndarray ). How would we know if that ndarray is a fromIndex or out?

Based on that, I think, the check for out makes sense just before the call to base.

Also, as suggested by you, I tried to comeup with ndarrayLike checks at the top but that also is tricky because we need to first check if fromIndex is actually that or is it out & vice versa. So at the end, we will end up with same amount of ndarraylike checks as we have now.

Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
headlessNode and others added 2 commits July 9, 2025 09:49
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
@kgryte kgryte self-requested a review July 9, 2025 05:49
@kgryte kgryte added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Jul 9, 2025
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). Feature Issue or pull request for adding a new feature. GSoC Google Summer of Code. gsoc: 2025 Google Summer of Code (2025). Needs Review A pull request which needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants