Skip to content

Commit 98588c3

Browse files
committed
Readme: add numpy-difference warnings to usage notes
About row-major order (#11) and destructive inverse real FFTs (#12).
1 parent 4bc4c68 commit 98588c3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,17 @@ _xtensor-fftw_ is a header-only library.
4848
To use, include one of the header files in the `include` directory, e.g. `xtensor-fftw/basic.hpp`, in your c++ code.
4949
To compile, one should also include the paths to the FFTW header and libraries and link to the appropriate FFTW library.
5050

51-
Note that _xtensor-fftw_ on Windows does not support `long double` precision.
51+
The functions in `xtensor-fftw/basic.hpp` mimic the behavior of `numpy.fft` as much as possible.
52+
In most cases transforms on identical input data should produce identical results within reasonable machine precision error bounds.
53+
However, there are a few differences that one should keep in mind:
54+
55+
- Since FFTW expects row-major ordered arrays, _xtensor-fftw_ functions currently only accept `xarray`s with row-major layout.
56+
By default, _xtensor_ containers use row-major layout, but take care when manually overriding this default.
57+
58+
- The inverse real FFT functions in FFTW destroy the input arrays during the calculation, i.e. the `irfft` family of functions in _xtensor-fftw_.
59+
(In fact, this does not always happen, depending on which algorithm FFTW decides is most efficient in your particular situation. Don't count on it, though.)
60+
61+
- _xtensor-fftw_ on Windows does not support `long double` precision.
5262
The `long double` precision version of the FFTW library requires that `sizeof(long double) == 12`.
5363
In recent versions of Visual Studio, `long double` is an alias of `double` and has size 8.
5464

0 commit comments

Comments
 (0)