R/fft.R

Defines functions fftwAvailable fft2D

Documented in fft2D fftwAvailable

#'
#'           fft.R
#' 
#'    choose code for computing Discrete Fourier Transform
#' 
#'    $Revision: 1.1 $  $Date: 2020/11/24 01:10:13 $

fft2D <- function(z, inverse=FALSE, west=fftwAvailable()) {
  if(west) return(fftwtools::fftw2d(data=z, inverse=inverse))
  return(stats::fft(z=z, inverse=inverse))
}

fftwAvailable <- function() {
  ok <- requireNamespace("fftwtools", quietly=TRUE)
  return(ok)
}

Try the spatstat.geom package in your browser

Any scripts or data that you put into this service are public.

spatstat.geom documentation built on Sept. 18, 2024, 9:08 a.m.