1 #ifndef MHO_MultidimensionalFastFourierTransform_HH__
2 #define MHO_MultidimensionalFastFourierTransform_HH__
32 template<
typename XArgType >
38 "Array element type must be a complex floating point type.");
64 #ifdef HOPS_ENABLE_DEBUG_MSG
65 msg_debug(
"operators",
"initialized a native FFT plan." << eom);
66 for(std::size_t i = 0; i < XArgType::rank::value; i++)
86 if(in ==
nullptr || out ==
nullptr)
90 if(!HaveSameDimensions(in, out))
92 out->Resize(in->GetDimensions());
97 #ifdef HOPS_ENABLE_DEBUG_MSG
98 msg_debug(
"operators",
"initialized a native FFT plan." << eom);
99 for(std::size_t i = 0; i < XArgType::rank::value; i++)
101 msg_debug(
"operators",
"fft plan dimension: " << i <<
" has size: " << this->
fDimensionSize[i] <<
", enabled? "
120 size_t total_size = 1;
121 for(
size_t i = 0; i < XArgType::rank::value; i++)
126 size_t index[XArgType::rank::value];
127 size_t non_active_dimension_size[XArgType::rank::value - 1];
128 size_t non_active_dimension_value[XArgType::rank::value - 1];
129 size_t non_active_dimension_index[XArgType::rank::value - 1];
132 for(
size_t d = 0; d < XArgType::rank::value; d++)
140 for(
size_t i = 0; i < XArgType::rank::value; i++)
145 non_active_dimension_index[count] = i;
152 for(
size_t n = 0; n < n_fft; n++)
156 non_active_dimension_value);
159 for(
size_t i = 0; i < XArgType::rank::value - 1; i++)
161 index[non_active_dimension_index[i]] = non_active_dimension_value[i];
164 size_t data_location;
168 MHO_NDArrayMath::OffsetFromRowMajorIndex< XArgType::rank::value >(this->
fDimensionSize, index);
169 data = &((in->GetData())[data_location]);
172 unsigned int stride =
173 MHO_NDArrayMath::StrideFromRowMajorIndex< XArgType::rank::value >(d, this->
fDimensionSize);
194 msg_error(
"math",
"FFT input/output array dimensions are not valid or intialization failed. Aborting transform."
212 if(in && out && in != out)
223 void AllocateWorkspace()
225 for(
size_t i = 0; i < XArgType::rank::value; i++)
#define msg_debug(xKEY, xCONTENT)
Definition: MHO_Message.hh:291
#define msg_error(xKEY, xCONTENT)
Definition: MHO_Message.hh:238
#define profiler_scope()
Definition: MHO_Profiler.hh:237
static void RowMajorIndexFromOffset(std::size_t offset, const std::size_t *DimSize, std::size_t *Index)
Function RowMajorIndexFromOffset.
Definition: MHO_NDArrayMath.hh:117
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_AdhocFlagging.hh:18
void FFTBluestein(std::complex< XFloatType > *data, MHO_FastFourierTransformWorkspace< XFloatType > &work, bool isForward, unsigned int stride=1)
Performs Bluestein's FFT algorithm on complex data using a workspace for arbitrary N....
Definition: MHO_FastFourierTransformCalls.hh:65
void FFTRadix2(std::complex< XFloatType > *data, MHO_FastFourierTransformWorkspace< XFloatType > &work, bool isForward, unsigned int stride=1)
Performs a Radix-2 Decimation-in-time (DIT) FFT algorithm on complex data using a workspace for arbit...
Definition: MHO_FastFourierTransformCalls.hh:35
Definition: MHO_Meta.hh:372