feat: add fft/base/fftpack/rffti#11467
Conversation
Coverage Report
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: 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: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Gunj Joshi <gunjjoshi8372@gmail.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: passed
- 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
---
---
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: passed
- 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: 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
---
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
| * var factors = workspace.slice( 2*N, ( 2*N ) + 4 ); | ||
| * // returns <Float64Array>[ 8, 2, 2, 4 ] | ||
| */ | ||
| declare function rffti( N: number, workspace: Collection<number>, strideW: number, offsetW: number ): void; |
There was a problem hiding this comment.
| declare function rffti( N: number, workspace: Collection<number>, strideW: number, offsetW: number ): void; | |
| declare function rffti<T extends Collection<number>>( N: number, workspace: T, strideW: number, offsetW: number ): T; |
I suggest going ahead and just returning the workspace array. Will require some minor edits here and elsewhere in this PR.
There was a problem hiding this comment.
Thanks for making the updates @kgryte. Should we also update all the examples to show the usage of this as a returned workspace array? For example:
Changing this:
rffti( N, workspace, 1, 0 );
To this:
var out = rffti( N, workspace, 1, 0 );
There was a problem hiding this comment.
Yes, that works. And then you can also add
var bool = ( out === workspace);
// returns truewhich is something we do elsewhere in similar situations.
There was a problem hiding this comment.
Not fully understanding why this file differs from what we did in https://github.com/gunjjoshi/stdlib/blob/20edeac7d326443708e922a8aa99dc6a93baa3ef/lib/node_modules/%40stdlib/fft/base/fftpack/rffti/lib/rffti1.js. What is the reason for the various discrepancies?
There was a problem hiding this comment.
The major reasons for these included our discussion to change the signature of the decompose function to include more parameters:
Before:
decompose( N, initial, out, stride, offset );After:
decompose( N, M, initial, strideInitial, offsetInitial, out, strideOut, offsetOut );
Reference: #10354 (comment)
And, while comparing the older implementation with the test fixtures generated by FFTPACK, we were getting the results being stored off by one place.
I have restored the older implementation as given here: https://github.com/stdlib-js/stdlib/pull/4121/changes#diff-50a196b71ed9215f6c0559fab1caf4289f1d0c4b8cd17e50c0503caf39605ea9, and it now has only the following changes, as compared to the older implementation:
| * @param {NonNegativeInteger} offsetF - starting index for `ifac` | ||
| * @returns {void} | ||
| */ | ||
| function rffti1( n, wa, strideW, offsetW, ifac, strideF, offsetF ) { |
There was a problem hiding this comment.
I would revisit this file. IMO, the changes in https://github.com/gunjjoshi/stdlib/blob/20edeac7d326443708e922a8aa99dc6a93baa3ef/lib/node_modules/%40stdlib/fft/base/fftpack/rffti/lib/rffti1.js are arguably better, so unless there is some justification for the current implementation, I'd say go ahead and align with the current status in the draft FFT PR.
There was a problem hiding this comment.
Aligned the implementation with the one in the draft FFT PR, with a few changes described here.
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
| t.strictEqual( rffti.length, 4, 'returns expected value' ); | ||
| t.end(); | ||
| }); | ||
|
|
There was a problem hiding this comment.
Should add a test confirming that the workspace array is returned.
kgryte
left a comment
There was a problem hiding this comment.
Other than the implementation file, this PR is looking good.
---
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: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
|
Adding a summary: I have made the changes to make the rffti1 implementation be more aligned with the one in the draft FFT PR in the commit 2eb785a. Now, the following two things need to be addressed in this PR, which I'll do next:
|
---
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: 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
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: 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: skipped
- task: lint_license_headers
status: passed
---
|
I've made all the required changes. This PR is now ready for a review. |
Resolves None.
Description
This pull request:
fft/base/fftpack/rffti, which is a part of fftpack.fft/base/fftpack#4121.Related Issues
This pull request has the following related issues:
None.
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Used AI to understand how we generate C fixtures using FFTPACK.
@stdlib-js/reviewers