feat: add blas/ext/base/dcartesian-square#10797
feat: add blas/ext/base/dcartesian-square#10797headlessNode wants to merge 5 commits intostdlib-js:developfrom
blas/ext/base/dcartesian-square#10797Conversation
---
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: missing_dependencies
- task: lint_c_examples
status: missing_dependencies
- task: lint_c_benchmarks
status: missing_dependencies
- 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
---
Coverage Report
The above coverage report was generated for the changes in this PR. |
lib/node_modules/@stdlib/blas/ext/base/dcartesian-square/examples/c/example.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/blas/ext/base/dcartesian-square/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/blas/ext/base/dcartesian-square/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/blas/ext/base/dcartesian-square/README.md
Outdated
Show resolved
Hide resolved
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
lib/node_modules/@stdlib/blas/ext/base/dcartesian-square/src/addon.c
Outdated
Show resolved
Hide resolved
---
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: 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: missing_dependencies
- 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
---
| */ | ||
| function dcartesianSquare( N, x, strideX, out, strideOut1, strideOut2 ) { | ||
| var ox = stride2offset( N, strideX ); | ||
| var oo = stride2offset( N * N, strideOut1 ) + stride2offset( 2, strideOut2 ); // eslint-disable-line max-len |
There was a problem hiding this comment.
I am realizing now why this looks odd to me. Namely, I led you astray with the original API design. For the non-ndarray API, it should be
dcartesianSquare( N, x, strideX, out, LDO )where LDO is the stride of the leading dimension and the stride of the trailing dimension is assumed to be 1. This follows BLAS conventions. See https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/dsyr for an example.
This change should be made here and in the other Cartesian PRs.
| * @param {integer} strideOut1 - stride length between consecutive output pairs | ||
| * @param {integer} strideOut2 - stride length between elements of each output pair |
There was a problem hiding this comment.
This is the wrong interpretation. strideOut* parameters don't have anything to do with the end-user experience of the output data. They refer to the storage layout of the provided array. You need to think about this from the end-user POV for an ndarray. The end-user should always see the results in the same orientation (e.g., rows of pairs); otherwise, the orientation is purely an artifact of the ndarray's underlying storage arrangement, which is clearly undesirable, as then an end-user needs to know the layout in order to interpret returned results and index into the array accordingly.
There is a reason why I said in the OP that the implementation needs to be cache-aware. And the reason is that the results need to be returned in a stable manner. Your implementation is currently unstable and needs to be refactored accordingly.
I suggest always returning results such that pairs are arranged along the first dimension (i.e., rows) and elements within the pair are arranged along the second dimension (i.e., columns).
Accordingly, your implementation needs to be fixed and should incorporate loop interchange. The algorithm for row-major and for column-major should be different.
This thinking is going to apply to all your other Cartesian PRs.
---
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: na
- 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: missing_dependencies
- task: lint_c_examples
status: missing_dependencies
- task: lint_c_benchmarks
status: missing_dependencies
- 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
---
---
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: na
- task: lint_repl_help
status: passed
- 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: missing_dependencies
- 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
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves stdlib-js/metr-issue-tracker#172.
Description
This pull request:
blas/ext/base/dcartesian-squareRelated Issues
This pull request has the following related issues:
blas/ext/base/dcartesian-squaremetr-issue-tracker#172Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Primarily written by Claude Code.
@stdlib-js/reviewers