### FFTPACK-style Real-to-Real Transform (r2r_fftpack) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Carries out an FFTPACK-style real-to-halfcomplex or halfcomplex-to-real transform on specified axes. Interpreting results can be complex for multiple axes. ```cpp template void r2r_fftpack(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, bool real2hermitian, bool forward, const T *data_in, T *data_out, T fct, size_t nthreads=1) ``` -------------------------------- ### r2r_fftpack Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Carries out a FFTPACK-style real-to-halfcomplex or halfcomplex-to-real transform on specified axes. Use with caution when transforming multiple axes. ```APIDOC ## r2r_fftpack ### Description Carries out a FFTPACK-style real-to-halfcomplex or halfcomplex-to-real transform (depending on the parameter `real2hermitian`) on all specified axes in the given order. Interpreting the result can be complicated when transforming more than one axis. ### Signature ```cpp template void r2r_fftpack(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, bool real2hermitian, bool forward, const T *data_in, T *data_out, T fct, size_t nthreads=1) ``` ### Parameters * **shape** (shape_t) - The shape of the input data. * **stride_in** (stride_t) - The strides for the input data in bytes. * **stride_out** (stride_t) - The strides for the output data in bytes. * **axes** (shape_t) - The axes along which to perform the transform. * **real2hermitian** (bool) - If true, performs a real-to-halfcomplex transform; otherwise, halfcomplex-to-real. * **forward** (bool) - `FORWARD` (true) for forward transform, `BACKWARD` (false) for backward transform. * **data_in** (const T*) - Pointer to the input data. * **data_out** (T*) - Pointer to the output data. * **fct** (T) - Normalization factor. * **nthreads** (size_t) - Recommended number of threads to use (0 for logical cores). Ignored if multi-threading is not supported. ``` -------------------------------- ### Real-to-Real Separable Forward Hartley Transform (C++) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Carries out a forward Fourier transform for every requested axis, computing 're(x)-im(x)' from it. Analogous to FFTW's Hartley transform implementation. ```cpp template void r2r_separable_fht(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, const T *data_in, T *data_out, T fct, size_t nthreads=1); ``` -------------------------------- ### Full Fourier Transform (r2r_separable_fht) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Carries out a full Fourier transform over requested axes, storing the sum of real and imaginary parts. Allocates significant temporary working space. ```cpp /* This function carries out a full Fourier transform over the requested axes, and the sum of real and imaginary parts of the result is stored in the output array. For a single transformed axis, this is identical to `r2r_separable_hartley`, but when transforming multiple axes, the results are different. NOTE: This function allocates temporary working space with a size comparable to the input array. */ ``` -------------------------------- ### Real-to-Real Genuine Forward Hartley Transform (C++) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a full forward Fourier transform over requested axes, storing 're(x)-im(x)' of the result. Allocates temporary working space comparable to the input array size. ```cpp template void r2r_genuine_fht(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, const T *data_in, T *data_out, T fct, size_t nthreads=1); ``` -------------------------------- ### Real-to-Real Genuine Hartley Transform (C++) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a genuine Hartley transform. Use `r2r_genuine_fht` for new code. ```cpp template void r2r_genuine_hartley(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, const T *data_in, T *data_out, T fct, size_t nthreads=1); ``` -------------------------------- ### Discrete Sine Transform (DST) (C++) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a Discrete Sine Transform. Orthogonality is achieved through specific scaling of input/output values based on the DST type. ```cpp template void dst(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, int type, const T *data_in, T *data_out, T fct, bool ortho, size_t nthreads=1); ``` -------------------------------- ### Discrete Cosine Transform (DCT) (C++) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a Discrete Cosine Transform. Orthogonality is achieved through specific scaling of input/output values based on the DCT type. ```cpp template void dct(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, int type, const T *data_in, T *data_out, T fct, bool ortho, size_t nthreads=1); ``` -------------------------------- ### Separable Hartley Transform (r2r_separable_hartley) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a forward Fourier transform over requested axes, adding real and imaginary parts before processing the next axis. Kept for backward compatibility; use r2r_separable_fht instead. ```cpp template void r2r_separable_hartley(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, const T *data_in, T *data_out, T fct, size_t nthreads=1); ``` -------------------------------- ### Complex-to-Complex FFT (c2c) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a complex-to-complex Fast Fourier Transform. Supports multi-threading and in-place operations. ```cpp template void c2c(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, bool forward, const complex *data_in, complex *data_out, T fct, size_t nthreads=1) ``` -------------------------------- ### Real-to-Complex FFT (r2c) - Single Axis Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a real-to-complex Fast Fourier Transform along a single specified axis. Supports multi-threading. ```cpp template void r2c(const shape_t &shape_in, const stride_t &stride_in, const stride_t &stride_out, size_t axis, bool forward, const T *data_in, complex *data_out, T fct, size_t nthreads=1) ``` -------------------------------- ### Real-to-Complex FFT (r2c) - Multiple Axes Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a real-to-complex transform along the last specified axis, followed by in-place complex-to-complex transforms on other axes. Supports multi-threading. ```cpp template void r2c(const shape_t &shape_in, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, bool forward, const T *data_in, complex *data_out, T fct, size_t nthreads=1) ``` -------------------------------- ### dct Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a Discrete Cosine Transform (DCT) over specified axes, with options for orthogonality. ```APIDOC ## dct ### Description Performs a Discrete Cosine Transform (DCT) over the requested axes. If `ortho` is true, the transform is made orthogonal by specific steps applied in every 1D sub-transform, depending on the `type`. ### Method `void dct(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, int type, const T *data_in, T *data_out, T fct, bool ortho, size_t nthreads=1)` ### Parameters - **shape** (shape_t) - Describes the dimensions of the input data. - **stride_in** (stride_t) - Describes the strides for the input data. - **stride_out** (stride_t) - Describes the strides for the output data. - **axes** (shape_t) - Specifies the axes to transform. - **type** (int) - The type of DCT (1, 2, 3, or 4). - **data_in** (const T*) - Pointer to the input data. - **data_out** (T*) - Pointer to the output data. - **fct** (T) - Scaling factor. - **ortho** (bool) - If true, the transform is made orthogonal. - **nthreads** (size_t) - Number of threads to use (default is 1). ### Orthogonality Adjustments (when ortho == true): - **Type 1**: Multiply first and last input value by sqrt(2), divide first and last output value by sqrt(2). - **Type 2**: Divide first output value by sqrt(2). - **Type 3**: Multiply first input value by sqrt(2). - **Type 4**: No additional steps. ``` -------------------------------- ### r2r_separable_hartley Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a forward Fourier transform for every requested axis, adding the real and imaginary parts of the result before processing the next axis. Use `r2r_separable_fht()` instead for new code. ```APIDOC ## r2r_separable_hartley ### Description For every requested axis, this function carries out a forward Fourier transform, and the real and imaginary parts of the result are added before the next axis is processed. This function inadvertently follows an unusual convention for real and imaginary parts and is only kept for backwards compatibility. Please use `r2r_separable_fht()` instead. ### Signature ```cpp template void r2r_separable_hartley(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, const T *data_in, T *data_out, T fct, size_t nthreads=1) ``` ### Parameters * **shape** (shape_t) - The shape of the input data. * **stride_in** (stride_t) - The strides for the input data in bytes. * **stride_out** (stride_t) - The strides for the output data in bytes. * **axes** (shape_t) - The axes along which to perform the transform. * **data_in** (const T*) - Pointer to the input data. * **data_out** (T*) - Pointer to the output data. * **fct** (T) - Normalization factor. * **nthreads** (size_t) - Recommended number of threads to use (0 for logical cores). Ignored if multi-threading is not supported. ``` -------------------------------- ### r2r_genuine_hartley Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a real-to-real genuine Hartley transform. This function is kept for backwards compatibility and users should prefer `r2r_genuine_fht()`. ```APIDOC ## r2r_genuine_hartley ### Description Performs a real-to-real genuine Hartley transform. This function follows an unusual convention for real and imaginary parts and is only kept for backwards compatibility. Please use `r2r_genuine_fht()` instead. ### Method `void r2r_genuine_hartley(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, const T *data_in, T *data_out, T fct, size_t nthreads=1)` ### Parameters - **shape** (shape_t) - Describes the dimensions of the input data. - **stride_in** (stride_t) - Describes the strides for the input data. - **stride_out** (stride_t) - Describes the strides for the output data. - **axes** (shape_t) - Specifies the axes to transform. - **data_in** (const T*) - Pointer to the input data. - **data_out** (T*) - Pointer to the output data. - **fct** (T) - Scaling factor. - **nthreads** (size_t) - Number of threads to use (default is 1). ``` -------------------------------- ### dst Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a Discrete Sine Transform (DST) over specified axes, with options for orthogonality. ```APIDOC ## dst ### Description Performs a Discrete Sine Transform (DST) over the requested axes. If `ortho` is true, the transform is made orthogonal by specific steps applied in every 1D sub-transform, depending on the `type`. ### Method `void dst(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, int type, const T *data_in, T *data_out, T fct, bool ortho, size_t nthreads=1)` ### Parameters - **shape** (shape_t) - Describes the dimensions of the input data. - **stride_in** (stride_t) - Describes the strides for the input data. - **stride_out** (stride_t) - Describes the strides for the output data. - **axes** (shape_t) - Specifies the axes to transform. - **type** (int) - The type of DST (1, 2, 3, or 4). - **data_in** (const T*) - Pointer to the input data. - **data_out** (T*) - Pointer to the output data. - **fct** (T) - Scaling factor. - **ortho** (bool) - If true, the transform is made orthogonal. - **nthreads** (size_t) - Number of threads to use (default is 1). ### Orthogonality Adjustments (when ortho == true): - **Type 1**: No additional steps. - **Type 2**: Divide last output value by sqrt(2). - **Type 3**: Multiply last input value by sqrt(2). - **Type 4**: No additional steps. ``` -------------------------------- ### Complex-to-Real FFT (c2r) - Multiple Axes Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a complex-to-complex transform on all axes except the last, then a complex-to-real transform on the last axis. Supports multi-threading. ```cpp template void c2r(const shape_t &shape_out, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, bool forward, const complex *data_in, T *data_out, T fct, size_t nthreads=1) ``` -------------------------------- ### c2r (1D) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a complex-to-real FFT along a single specified axis. The length of the real array along the axis is `s/2 + 1`, where `s` is the length of the complex array. ```APIDOC ## c2r (1D) ### Description Performs a complex-to-real FFT along a single specified axis. The length of the real array along the axis is `s/2 + 1`, where `s` is the length of the complex array. ### Signature ```cpp template void c2r(const shape_t &shape_out, const stride_t &stride_in, const stride_t &stride_out, size_t axis, bool forward, const complex *data_in, T *data_out, T fct, size_t nthreads=1) ``` ### Parameters * **shape_out** (shape_t) - The shape of the output real data. * **stride_in** (stride_t) - The strides for the input data in bytes. * **stride_out** (stride_t) - The strides for the output data in bytes. * **axis** (size_t) - The axis along which to perform the transform. * **forward** (bool) - `FORWARD` (true) for forward transform, `BACKWARD` (false) for backward transform. * **data_in** (const complex*) - Pointer to the input complex data. * **data_out** (T*) - Pointer to the output real data. * **fct** (T) - Normalization factor. * **nthreads** (size_t) - Recommended number of threads to use (0 for logical cores). Ignored if multi-threading is not supported or for 1D transforms. ``` -------------------------------- ### Complex-to-Real FFT (c2r) - Single Axis Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a complex-to-real Fast Fourier Transform along a single specified axis. Supports multi-threading. ```cpp template void c2r(const shape_t &shape_out, const stride_t &stride_in, const stride_t &stride_out, size_t axis, bool forward, const complex *data_in, T *data_out, T fct, size_t nthreads=1) ``` -------------------------------- ### r2c (Multi-axis) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs an r2c transform along the last axis specified in `axes`, followed by an in-place c2c transform along the other specified axes. ```APIDOC ## r2c (Multi-axis) ### Description This function first carries out an r2c transform along the last axis in `axes`, storing the result in `data_out`. Then, an in-place c2c transform is carried out in `data_out` along all other axes. ### Signature ```cpp template void r2c(const shape_t &shape_in, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, bool forward, const T *data_in, complex *data_out, T fct, size_t nthreads=1) ``` ### Parameters * **shape_in** (shape_t) - The shape of the input real data. * **stride_in** (stride_t) - The strides for the input data in bytes. * **stride_out** (stride_t) - The strides for the output data in bytes. * **axes** (shape_t) - The axes along which to perform the transforms. The last axis is for r2c, others for c2c. * **forward** (bool) - `FORWARD` (true) for forward transform, `BACKWARD` (false) for backward transform. * **data_in** (const T*) - Pointer to the input real data. * **data_out** (complex*) - Pointer to the output complex data. * **fct** (T) - Normalization factor. * **nthreads** (size_t) - Recommended number of threads to use (0 for logical cores). Ignored if multi-threading is not supported. ``` -------------------------------- ### r2c (1D) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a real-to-complex FFT along a single specified axis. The length of the complex array along the axis is `s/2 + 1`, where `s` is the length of the real array. ```APIDOC ## r2c (1D) ### Description Performs a real-to-complex FFT along a single specified axis. The length of the complex array along the axis is `s/2 + 1`, where `s` is the length of the real array. ### Signature ```cpp template void r2c(const shape_t &shape_in, const stride_t &stride_in, const stride_t &stride_out, size_t axis, bool forward, const T *data_in, complex *data_out, T fct, size_t nthreads=1) ``` ### Parameters * **shape_in** (shape_t) - The shape of the input real data. * **stride_in** (stride_t) - The strides for the input data in bytes. * **stride_out** (stride_t) - The strides for the output data in bytes. * **axis** (size_t) - The axis along which to perform the transform. * **forward** (bool) - `FORWARD` (true) for forward transform, `BACKWARD` (false) for backward transform. * **data_in** (const T*) - Pointer to the input real data. * **data_out** (complex*) - Pointer to the output complex data. * **fct** (T) - Normalization factor. * **nthreads** (size_t) - Recommended number of threads to use (0 for logical cores). Ignored if multi-threading is not supported or for 1D transforms. ``` -------------------------------- ### r2r_separable_fht Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a separable forward Fourier transform for each requested axis, computing 're(x)-im(x)' from the result. ```APIDOC ## r2r_separable_fht ### Description For every requested axis, this function carries out a forward Fourier transform, and "re(x)-im(x)" is computed from that before the next axis is processed. This is analogous to FFTW's implementation of the Hartley transform. ### Method `void r2r_separable_fht(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, const T *data_in, T *data_out, T fct, size_t nthreads=1)` ### Parameters - **shape** (shape_t) - Describes the dimensions of the input data. - **stride_in** (stride_t) - Describes the strides for the input data. - **stride_out** (stride_t) - Describes the strides for the output data. - **axes** (shape_t) - Specifies the axes to transform. - **data_in** (const T*) - Pointer to the input data. - **data_out** (T*) - Pointer to the output data. - **fct** (T) - Scaling factor. - **nthreads** (size_t) - Number of threads to use (default is 1). ``` -------------------------------- ### r2r_genuine_fht Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a full forward Fourier transform over requested axes, storing the 're(x)-im(x)' of the result. ```APIDOC ## r2r_genuine_fht ### Description This function carries out a full forward Fourier transform over the requested axes, and "re(x)-im(x)" of the result is stored in the output array. For a single transformed axis, this is identical to `r2r_separable_fht`, but when transforming multiple axes, the results are different. This function allocates temporary working space with a size comparable to the input array. ### Method `void r2r_genuine_fht(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, const T *data_in, T *data_out, T fct, size_t nthreads=1)` ### Parameters - **shape** (shape_t) - Describes the dimensions of the input data. - **stride_in** (stride_t) - Describes the strides for the input data. - **stride_out** (stride_t) - Describes the strides for the output data. - **axes** (shape_t) - Specifies the axes to transform. - **data_in** (const T*) - Pointer to the input data. - **data_out** (T*) - Pointer to the output data. - **fct** (T) - Scaling factor. - **nthreads** (size_t) - Number of threads to use (default is 1). ``` -------------------------------- ### c2c Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a complex-to-complex FFT. It supports multi-dimensional transforms and allows specifying input/output strides and axes. The `forward` parameter determines the transform direction. ```APIDOC ## c2c ### Description Performs a complex-to-complex FFT. It supports multi-dimensional transforms and allows specifying input/output strides and axes. The `forward` parameter determines the transform direction. ### Signature ```cpp template void c2c(const shape_t &shape, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, bool forward, const complex *data_in, complex *data_out, T fct, size_t nthreads=1) ``` ### Parameters * **shape** (shape_t) - The shape of the input data. * **stride_in** (stride_t) - The strides for the input data in bytes. * **stride_out** (stride_t) - The strides for the output data in bytes. * **axes** (shape_t) - The axes along which to perform the transform. * **forward** (bool) - `FORWARD` (true) for forward transform, `BACKWARD` (false) for backward transform. * **data_in** (const complex*) - Pointer to the input data. * **data_out** (complex*) - Pointer to the output data. * **fct** (T) - Normalization factor. * **nthreads** (size_t) - Recommended number of threads to use (0 for logical cores). Ignored if multi-threading is not supported or for 1D transforms. ``` -------------------------------- ### c2r (Multi-axis) Source: https://github.com/mreineck/pocketfft/blob/cpp/README.md Performs a c2c transform along all axes except the last one, storing the result in a temporary array. Then, a c2r transform is carried out along the last axis, storing the result in `data_out`. ```APIDOC ## c2r (Multi-axis) ### Description This function first carries out a c2c transform along all axes except the last one, storing the result into a temporary array. Then, a c2r transform is carried out along the last axis, storing the result in `data_out`. ### Signature ```cpp template void c2r(const shape_t &shape_out, const stride_t &stride_in, const stride_t &stride_out, const shape_t &axes, bool forward, const complex *data_in, T *data_out, T fct, size_t nthreads=1) ``` ### Parameters * **shape_out** (shape_t) - The shape of the output real data. * **stride_in** (stride_t) - The strides for the input data in bytes. * **stride_out** (stride_t) - The strides for the output data in bytes. * **axes** (shape_t) - The axes along which to perform the transforms. The last axis is for c2r, others for c2c. * **forward** (bool) - `FORWARD` (true) for forward transform, `BACKWARD` (false) for backward transform. * **data_in** (const complex*) - Pointer to the input complex data. * **data_out** (T*) - Pointer to the output real data. * **fct** (T) - Normalization factor. * **nthreads** (size_t) - Recommended number of threads to use (0 for logical cores). Ignored if multi-threading is not supported. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.