7 #include "TVirtualFFT.h" 24 m_flag(opt==2 ? FFTW_PATIENT : opt==1 ? FFTW_MEASURE : FFTW_ESTIMATE),
25 m_inData(reinterpret_cast<
DftFloat*>(fftw_malloc(m_ndatMax*sizeof(
DftFloat)))),
26 m_outData(reinterpret_cast<
Complex*>(fftw_malloc(m_ndatMax*sizeof(
DftFloat)))) { }
31 for (
auto& iplan :
m_forwardPlans ) fftw_destroy_plan(iplan.second);
44 if ( ndatIn == 0 )
return 3;
63 const string myname =
"Fw2dFFT::forwardPlan: ";
66 cout << myname <<
"Data cannot be accomodated. Maximum data size is " <<
m_ndatMax <<
endl;
78 const string myname =
"Fw2dFFT::backwardPlan: ";
81 cout << myname <<
"Data cannot be accomodated. Maximum data size is " <<
m_ndatMax <<
endl;
94 const string myname =
"Fw2dFFT::fftForward: ";
95 if ( ! dat.
isValid() )
return 1;
98 if ( ! dft.
isValid() )
return 2;
100 cout << myname <<
"ERROR: Power normalization is not (yet) supported." <<
endl;
106 float fndat = ndatIn;
111 cout << myname <<
"ERROR: Copy of input data failed." <<
endl;
124 const string myname =
"Fw2dFFT::fftBackward: ";
125 if ( ! dft.
isValid() )
return 1;
128 cout << myname <<
"Sample counts are too large. Maximum data size is " <<
m_ndatMax <<
endl;
134 cout << myname <<
"ERROR: Power normalization is not (yet) supported." <<
endl;
139 cout << myname <<
"ERROR: Unable to initialize output data container." <<
endl;
142 float fndat = ndatIn;
Index checkDataSize(const IndexArray &nsams) const
int fftForward(const Data &dat, DFT &dft, Index logLevel=0)
DFT::IndexArray IndexArray
bool isConsistent() const
const IndexArray & nSamples() const
Norm normalization() const override
Plan & backwardPlan(const IndexArray &nsams)
FftwComplex * fftwOutData()
int fftBackward(const DFT &dft, Data &dat, Index logLevel=0)
virtual bool isValid() const
int copyDataOut(T *pdat) const
Index size(Index idim) const
static Index dataSize(const std::array< Index, N > &nsams)
void reset(const IndexArray &nsams)
void reset(const IndexArray &nsams) override
Plan & forwardPlan(const IndexArray &nsams)
Q_EXPORT QTSManip setw(int w)
bool haveForwardPlan(const IndexArray &nsams) const
static Index dftFloatDataSize(const std::array< Index, N > &nsams)
int copyDataIn(const DataVector &data)
const IndexArray & nSamples() const override
bool haveBackwardPlan(const IndexArray &nsams) const
Fw2dFFT(Index ndatMax, Index opt)
QTextStream & endl(QTextStream &s)
DftFloat * floatOutData()