Often you need to convolve a particular vector with a lot of other vectors of equal length, then the program below can be used. It illustrates the use of Rcpp/inline and FFTW used from within R. ### The program below can be used, when a vector is convolved several times ### with vectors of equal length ### In the first step the FFT of x is stored and FFTW plans are created, ### in subsequent steps the FFT of x is reused and FFTW plans recalled. library(Rcpp) require(inline) ### Definition of plugin, makes linkage to FFTW possible plug <- Rcpp:::Rcpp.plugin.maker(include.before = "#include ", libs = paste("-L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp", "-Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib", "-lfftw3 -lm -L/usr/lib")) registerPlugin("FFTWconv", plug ) ### Convoluti