feat: add fft/base/fftpack/costi#13200
Conversation
---
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_pkg_readmes
status: passed
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: na
- 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: passed
- 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_pkg_readmes
status: passed
- task: lint_markdown_docs
status: na
- 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
---
|
The CI tests should pass once #13170 is merged. Marking this PR as a draft PR until then. |
---
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_pkg_readmes
status: na
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: na
- 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: 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
---
Coverage ReportNo coverage information available. |
| iw = offsetW; | ||
| for ( i = 1; i < ns2; i++ ) { | ||
| fk += 1.0; | ||
| sc = sincos( fk * dt ); |
There was a problem hiding this comment.
You need to be using sincos.assign here with a WORKSPACE buffer. Otherwise, you are allocating a new 2-element array for each invocation. It is okay to write to this temporary workspace given that you need to multiply the factors by two. Otherwise, write directly to workspace and then do workspace[ j ] *= 2.0.
If you do the latter, cache the index computations. But also, why are you doing both addition and multiplication for indices? You should be doing iw += strideW. For the other index, define a separate iw variable and do iwc -= strideW, since it seems like you are decrementing the pointer.
In short, I suggest making your pointer arithmetic logic cleaner.
| * ↓ ↓ ↓ ↓ | ||
| * | sine/cosine table | scratch/workspace | twiddle factors | radix factor table | | ||
| * ↑ ↑ ↑ ↑ | ||
| * i = 0 ... N ... 2N-1 ... 3N-2 ... |
There was a problem hiding this comment.
Is it me, or does this table layout feel off? I feel like the scratch/workspace should start at 2N not 2N-1 and the radix factor table at 3N, not 3N-2. Otherwise, you don't need 3N+34 elements; you only need 3N+32 elements. I get that we are passing N-1 to rffti, so that is where the alignment issues come from, but it is still a bit odd to my eye.
Resolves stdlib-js/metr-issue-tracker#831.
Description
This pull request:
fft/base/fftpack/costi, which is a part of fftpack.fft/base/fftpack#4121.Related Issues
This pull request has the following related issues:
fft/base/fftpack/costimetr-issue-tracker#831Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Used
gpt-5.1-codex-minito review the package which was initially implemented manually, by copying over a similar package (fft/base/fftpack/cosqi) and modifying it.@stdlib-js/reviewers