1 #include <unsupported/Eigen/FFT> 5 template<
bool adjo
int=false>
6 void fft_work(
const CppAD::vector<double> &x,
7 CppAD::vector<double> &y) {
8 int ncplx = x.size() / 2;
9 typedef std::complex<double> C;
14 f.SetFlag(f.Unscaled);
21 TMB_ATOMIC_VECTOR_FUNCTION_DECLARE(
fft)
22 TMB_ATOMIC_VECTOR_FUNCTION_DECLARE(ifft)
23 TMB_ATOMIC_VECTOR_FUNCTION_DEFINE(
fft, tx.size(), fft_work<0>(tx, ty), px = ifft(py))
24 TMB_ATOMIC_VECTOR_FUNCTION_DEFINE(ifft, tx.size(), fft_work<1>(tx, ty), px = fft(py))
36 bool inverse = false) {
37 CppAD::vector<Type> x(2 * xc.size());
39 Type* pxc = (Type*) xc.data();
40 for (
size_t i=0; i<x.size(); i++) {
43 CppAD::vector<Type> y;
48 px = (Type*) y.data();
49 for (
size_t i=0; i<x.size(); i++) {
Vector class used by TMB.
Namespace with special functions and derivatives.
vector< std::complex< Type > > fft(vector< std::complex< Type > > xc, bool inverse=false)
FFT (unscaled)