Differentiate ifft and ifft_as_destroy and use of const
Two possibilities:
- Better docstrings. Right now the docstrings are the same for both methods.
-
In C++ level, perhaps we could use
const mycomplex *fieldK
for the first argument ofvoid FFT3DWithFFTW3D::ifft(mycomplex *fieldK, myreal *fieldX)
to guarantee that the array of the first argument is not modified. Also addconst
elsewhere if the array is meant to be read-only?
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
- Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Link issues together to show that they're related.
Learn more.
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Ashwin V. Mohanan added enhancement label
added enhancement label
- Ashwin V. Mohanan changed the description
changed the description
- Ashwin V. Mohanan assigned to @avmo
assigned to @avmo
- Ashwin V. Mohanan mentioned in commit d1e49aac69df
mentioned in commit d1e49aac69df
- Author Maintainer
With d1e49aac69df the generated C++ code does not change so much. Only the function arguments gets an extra
const
:$ diff {with,without}_const/fluidfft/fft2d/fft2d_with_fftw1d.cpp | grep -P '^...(?!\*).*' 1803,1806c1803,1806 < PyObject *(*fft_as_arg)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t const , __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t, int __pyx_skip_dispatch); < PyObject *(*ifft_as_arg)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t const , __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t, int __pyx_skip_dispatch); < PyObject *(*fft)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t const , int __pyx_skip_dispatch); < PyObject *(*ifft)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t const , int __pyx_skip_dispatch); --- > PyObject *(*fft_as_arg)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t, int __pyx_skip_dispatch); > PyObject *(*ifft_as_arg)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t, int __pyx_skip_dispatch); > PyObject *(*fft)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t, int __pyx_skip_dispatch); > PyObject *(*ifft)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t, int __pyx_skip_dispatch); 2702,2705c2702,2705 < static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft_as_arg(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t const __pyx_v_fieldX, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t __pyx_v_fieldK, int __pyx_skip_dispatch); /* proto*/ < static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft_as_arg(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t const __pyx_v_fieldK, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t __pyx_v_fieldX, int __pyx_skip_dispatch); /* proto*/ < static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t const __pyx_v_fieldX, int __pyx_skip_dispatch); /* proto*/ < static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t const __pyx_v_fieldK, int __pyx_skip_dispatch); /* proto*/ --- > static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft_as_arg(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t __pyx_v_fieldX, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t __pyx_v_fieldK, int __pyx_skip_dispatch); /* proto*/ > static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft_as_arg(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t __pyx_v_fieldK, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t __pyx_v_fieldX, int __pyx_skip_dispatch); /* proto*/ > static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t __pyx_v_fieldX, int __pyx_skip_dispatch); /* proto*/ > static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t __pyx_v_fieldK, int __pyx_skip_dispatch); /* proto*/ 6132c6132 --- 6138c6138 < static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft_as_arg(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t const __pyx_v_fieldX, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t __pyx_v_fieldK, int __pyx_skip_dispatch) { --- > static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft_as_arg(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t __pyx_v_fieldX, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t __pyx_v_fieldK, int __pyx_skip_dispatch) { 6258c6258 --- 6378c6378 --- 6384c6384 < static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft_as_arg(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t const __pyx_v_fieldK, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t __pyx_v_fieldX, int __pyx_skip_dispatch) { --- > static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft_as_arg(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t __pyx_v_fieldK, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t __pyx_v_fieldX, int __pyx_skip_dispatch) { 6504c6504 --- 6624c6624 --- 6630c6630 < static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t const __pyx_v_fieldX, int __pyx_skip_dispatch) { --- > static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t __pyx_v_fieldX, int __pyx_skip_dispatch) { 6788c6788 --- 6875c6875 --- 6881c6881 < static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t const __pyx_v_fieldK, int __pyx_skip_dispatch) { --- > static PyObject *__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *__pyx_v_self, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t __pyx_v_fieldK, int __pyx_skip_dispatch) { 7039c7039 --- 26293,26296c26293,26296 < __pyx_vtable_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D.fft_as_arg = (PyObject *(*)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t const , __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t, int __pyx_skip_dispatch))__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft_as_arg; < __pyx_vtable_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D.ifft_as_arg = (PyObject *(*)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t const , __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t, int __pyx_skip_dispatch))__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft_as_arg; < __pyx_vtable_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D.fft = (PyObject *(*)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t const , int __pyx_skip_dispatch))__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft; < __pyx_vtable_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D.ifft = (PyObject *(*)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t const , int __pyx_skip_dispatch))__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft; --- > __pyx_vtable_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D.fft_as_arg = (PyObject *(*)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t, int __pyx_skip_dispatch))__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft_as_arg; > __pyx_vtable_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D.ifft_as_arg = (PyObject *(*)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t, int __pyx_skip_dispatch))__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft_as_arg; > __pyx_vtable_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D.fft = (PyObject *(*)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2df_t, int __pyx_skip_dispatch))__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_fft; > __pyx_vtable_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D.ifft = (PyObject *(*)(struct __pyx_obj_8fluidfft_5fft2d_11with_fftw1d_FFT2DWithFFTW1D *, __pyx_t_8fluidfft_5fft2d_11with_fftw1d_view2dc_t, int __pyx_skip_dispatch))__pyx_f_8fluidfft_5fft2d_11with_fftw1d_15FFT2DWithFFTW1D_ifft;
So I assume there won't be any performance impact.
- Ashwin V. Mohanan marked the checklist item Better docstrings. Right now the docstrings are the same for both methods. as completed
marked the checklist item Better docstrings. Right now the docstrings are the same for both methods. as completed
Please register or sign in to reply