FFT.h 1.21 KB
Newer Older
Uldis Locans's avatar
Uldis Locans committed
1 2 3 4 5 6 7 8
#ifndef H_DKS_FFT
#define H_DKS_FFT

#include <iostream>
#include <math.h>

#include "../DKSDefinitions.h"

9
class FFT {
Uldis Locans's avatar
Uldis Locans committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

protected:
  int defaultN[3];
  int defaultNdim;

  bool useDefaultPlan(int ndim, int N[3]) {
    if (ndim != defaultNdim)
      return false;
    if (N[0] != defaultN[0] && N[1] != defaultN[1] && N[2] != defaultN[2])
      return false;
    return true;
  }

public:

25
  virtual ~FFT() { }
Uldis Locans's avatar
Uldis Locans committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

  virtual int setupFFT(int ndim, int N[3]) = 0;
  virtual int setupFFTRC(int ndim, int N[3], double scale = 1.0) = 0;
  virtual int setupFFTCR(int ndim, int N[3], double scale = 1.0) = 0;
  virtual int destroyFFT() = 0;
  virtual int executeFFT(void * mem_ptr, int ndim, int N[3], 
			 int streamId = -1, bool forward = true) = 0;
  virtual int executeIFFT(void * mem_ptr, int ndim, int N[3], int streamId = -1) = 0;
  virtual int normalizeFFT(void * mem_ptr, int ndim, int N[3], int streamId = -1) = 0;
  virtual int executeRCFFT(void * real_ptr, void * comp_ptr, int ndim, int N[3], 
				int streamId = -1) = 0;
  virtual int executeCRFFT(void * real_ptr, void * comp_ptr, int ndim, int N[3], 
				int streamId = -1) = 0;
  virtual int normalizeCRFFT(void *real_ptr, int ndim, int N[3], int streamId = -1) = 0;

};

#endif