feat: add fft/base/fftpack/rffti#11467
Open
gunjjoshi wants to merge 2 commits intostdlib-js:developfrom
Open
Conversation
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
reviewed
Apr 15, 2026
Comment on lines
+76
to
+83
| if ( y === expected[ off+i ] ) { | ||
| t.strictEqual( y, expected[ off+i ], 'returns expected value' ); | ||
| } else { | ||
| delta = abs( y - expected[ off+i ] ); | ||
| tol = EPS * abs( expected[ off+i ] ); | ||
| t.ok( delta <= tol, 'within tolerance. N: '+N+'. workspace['+(N+i+1)+']. Value: '+y+'. Expected: '+expected[off+i]+'. tol: '+tol+'. delta: '+delta+'.' ); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
I suggest going ahead and migrating to use @stdlib/assert/is-almost-same-value in order to measure differences in units of ULPs, rather than, here, where we compute an epsilon difference.
kgryte
reviewed
Apr 15, 2026
Comment on lines
+117
to
+139
| var workspace; | ||
| var N; | ||
| var nf; | ||
| var i; | ||
| var j; | ||
|
|
||
| N = 8; | ||
| workspace = new Float64Array( ( 2*N ) + 34 ); | ||
|
|
||
| rffti( N, workspace, 1, 0 ); | ||
|
|
||
| console.log( 'Sequence length: %d', N ); | ||
| console.log( 'Twiddle factors:' ); | ||
| for ( i = N; i < 2*N; i++ ) { | ||
| console.log( ' workspace[%d] = %d', i, workspace[ i ] ); | ||
| } | ||
|
|
||
| console.log( 'Factorization:' ); | ||
| nf = workspace[ ( 2*N ) + 1 ]; | ||
| console.log( ' number of factors: %d', nf ); | ||
| for ( j = 0; j < nf; j++ ) { | ||
| console.log( ' factor[%d]: %d', j, workspace[ ( 2*N ) + 2 + j ] ); | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| var workspace; | |
| var N; | |
| var nf; | |
| var i; | |
| var j; | |
| N = 8; | |
| workspace = new Float64Array( ( 2*N ) + 34 ); | |
| rffti( N, workspace, 1, 0 ); | |
| console.log( 'Sequence length: %d', N ); | |
| console.log( 'Twiddle factors:' ); | |
| for ( i = N; i < 2*N; i++ ) { | |
| console.log( ' workspace[%d] = %d', i, workspace[ i ] ); | |
| } | |
| console.log( 'Factorization:' ); | |
| nf = workspace[ ( 2*N ) + 1 ]; | |
| console.log( ' number of factors: %d', nf ); | |
| for ( j = 0; j < nf; j++ ) { | |
| console.log( ' factor[%d]: %d', j, workspace[ ( 2*N ) + 2 + j ] ); | |
| } | |
| var N = 8; | |
| var workspace = new Float64Array( ( 2*N ) + 34 ); | |
| rffti( N, workspace, 1, 0 ); | |
| console.log( 'Sequence length: %d', N ); | |
| console.log( 'Twiddle factors:' ); | |
| var i; | |
| for ( i = N; i < 2*N; i++ ) { | |
| console.log( ' workspace[%d] = %d', i, workspace[ i ] ); | |
| } | |
| console.log( 'Factorization:' ); | |
| var nf = workspace[ ( 2*N ) + 1 ]; | |
| console.log( ' number of factors: %d', nf ); | |
| for ( i = 0; i < nf; i++ ) { | |
| console.log( ' factor[%d]: %d', i, workspace[ ( 2*N ) + 2 + i ] ); | |
| } |
Member
There was a problem hiding this comment.
This may also apply to your example file.
kgryte
reviewed
Apr 15, 2026
Comment on lines
+6
to
+8
| The workspace array is divided into three sections: scratch/workspace | ||
| (indices 0 to N-1), twiddle factors (indices N to 2N-1), and radix factor | ||
| table (indices 2N onwards). |
Member
There was a problem hiding this comment.
Suggested change
| The workspace array is divided into three sections: scratch/workspace | |
| (indices 0 to N-1), twiddle factors (indices N to 2N-1), and radix factor | |
| table (indices 2N onwards). | |
| The workspace array is divided into three sections: | |
| 1. scratch/workspace: the section range from indices 0 to N-1 and is used while performing transforms. This section is not updated during initialization. | |
| 2. twiddle factors (indices N to 2N-1) | |
| 3. radix factor table (indices 2N onwards). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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