Skip to contents

zufft 0.2.0

New features

  • The C table in inst/include/zufft.h gains single-precision members, c2c_f(), r2c_f() and c2r_f(), for consumers whose data are float (#31). They are appended, so consumers built against 0.1.0 are unaffected; ZUFFT_HAS(api, c2c_f) tells a consumer whether the loaded zufft has them, and zufft_api_get() now accepts a 0.1.0 table. Their results repeat for a given nthreads but, unlike the double members’, may differ in the last bit between thread counts (#89).

Bug fixes

  • Transforming an empty axis other than the first with n no longer crashes R (#69).
  • fft_stats() and mvfft_stats() accept Date, POSIXct and difftime input as stats::fft() does, and read inverse as it does, a list included (#70).
  • Arrays of more than 64 dimensions transform, instead of failing with an internal error (#71).
  • The C table reads _R_CHECK_LIMIT_CORES_ case-insensitively, as the R functions do (#72).
  • Unloading zufft now joins its worker threads: R_unload_zufft() was never called, so on Windows reloading the package with live workers could crash R (#75).
  • Running out of memory while the thread pool grows now raises the same zufft_engine_error (“out of memory”) as any other allocation failure, instead of a zufft_thread_error (#80).
  • fft_stats() and mvfft_stats() read a factor inverse by its integer code, as stats::fft() does, rather than by its label (#85).
  • The worker threads are joined however the DLL is unloaded, including pkgload::unload()’s fallback while another package imports zufft (#86).
  • After zufft is unloaded and loaded again, the C table’s nthreads = 0 follows fft_workers() again instead of keeping the value set before (#88).
  • A process that used several threads no longer hangs at exit when its output pipe closes: the worker threads block signals, so R’s handlers never run on them (#90).
  • fft_workers() refuses a negative count that leaves fewer than one thread when it is set, instead of making every later transform fail (#96).

zufft 0.1.0

CRAN release: 2026-10-22

First release.

  • fft_c2c(), fft_r2c() and fft_c2r() compute complex, real-to-complex and complex-to-real discrete Fourier transforms over any axes of an array, with SciPy’s crop-or-pad n and norm = "backward", "ortho", "forward" or "none" (the unnormalised convention of fftwtools and stats::fft()).
  • With axes = NULL, fft_r2c() and fft_c2r() halve the first dimension, the contiguous one in R, as fftwtools’ 2-D and 3-D real transforms do; give axes explicitly to halve the last axis listed, as SciPy does.
  • Results are bit-identical whatever the number of threads: zufft_info()$fp_contract is "off" for every build that cannot fuse multiply-adds, which includes all of CRAN’s.
  • fft_dct() and fft_dst() compute discrete cosine and sine transforms of types 1 to 4 and their inverses over any axes, with SciPy’s definitions, norm and orthogonalize.
  • fft_next_len() and fft_prev_len() find fast transform lengths; fft_freq(), fft_rfreq(), fft_shift() and fft_ishift() are SciPy’s frequency and shift helpers.
  • fft_stats() and mvfft_stats() are drop-in replacements for stats::fft() and stats::mvfft().
  • workers runs a transform on several threads, through zufft’s own lazy thread pool; fft_workers(), with_fft_workers() and local_fft_workers() set the default. Results do not depend on the number of threads, and forked children (parallel::mclapply()) are safe.
  • A registered C table and the header inst/include/zufft.h let other packages call the transforms from C with LinkingTo: zufft, from any thread.
  • Setting the environment variable ZUFFT_CXXFLAGS (for example to "-march=native") before installing from source builds zufft for the local CPU on Linux and macOS; see the README.
  • vignette("migrating-from-fftwtools") maps every fftwtools function to zufft; an article covers scipy.fft users.
  • Bundles the BSD-licensed FFT subset of ducc0 (the files and commit SciPy vendors) and compiles it.
  • zufft_info() reports the vendored ducc0 and SciPy commits, the SIMD backend and width, fused multiply-add support, the threading mode and the complex path.