-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
feat: add initial implementaion of fft/base/fftpack
#4121
base: develop
Are you sure you want to change the base?
Conversation
fft/base/fftpack
fft/base/fftpack
Signed-off-by: Gunj Joshi <gunjjoshi8372@gmail.com>
Signed-off-by: Gunj Joshi <gunjjoshi8372@gmail.com>
Signed-off-by: Gunj Joshi <gunjjoshi8372@gmail.com>
Signed-off-by: Gunj Joshi <gunjjoshi8372@gmail.com>
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
var i; | ||
var k; | ||
|
||
TI11 *= fsign; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking. Seems a little strange to be mutating a variable in the parent scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the reference implementation, these constants are multiplied with fsign
at the time of declaration itself. But, as fsign
comes as an argument to the passfb5
function, we can't use it in the // VARIABLES //
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I move these declarations inside the function, similar to the reference implementation?
I had a confusion here. If we see the reference implementations of |
@gunjjoshi It's a little hard to follow what you are asking given the various links. Can you provide relevant snippets in a single comment so we can see what you are referencing in one view? |
@kgryte Ahh, sorry for the confusion. This is the static void cosqf1(integer n, real *x, real *w, real *xh) This cosqf1(n, &x[1], &wsave[1], &wsave[n + 1]); In order to replicate this same behavior in JS, currently, what I'm doing is:
function cosqf1( n, x, w, xh ) where And, while calling this cosqf1( n, x[ 1 - 1 ], wsave[ 1 - 1 ], wsave[ n + 1 - 1 ] ); But in this JS version, instead of passing arrays, I am currently passing single elements, such as I think this problem might be summed up as, how should we replicate the logic of passing subarrays (using pointers) in C, for the JS implementation? |
@gunjjoshi What about providing an array and then offsets, similar in concept to the ndarray APIs we have. E.g., xptr = ...;
wptr = ...;
xhptr = ...;
cosqf1(n, x, xptr, wsave, wptr, xhptr ); // =>cosqf1( n: number, x: Float64Array, xptr: number, wsave: Float64Array, wptr: number, xhptr: number ) where the Another alternative is that you pass down slices which has more overhead due to object creation.
|
Thanks, @kgryte, I'll go with the first method! |
Progresses #3131
Description
This pull request:
fft/base/fftpack
.Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers