Package ffx.numerics.fft
Class Complex3DParallel
java.lang.Object
ffx.numerics.fft.Complex3DParallel
Compute the 3D FFT of complex, double precision input of arbitrary dimensions via 1D Mixed Radix
FFTs in parallel.
The location of the input point [i, j, k] within the input array must be:
double real = input[x*nextX + y*nextY + z*nextZ]
double imag = input[x*nextX + y*nextY + z*nextZ + 1]
where
int nextX = 2
int nextY = 2*nX
int nextZ = 2*nX*nY
- Since:
- 1.0
- Author:
- Michal J. Schnieders
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionComplex3DParallel
(int nX, int nY, int nZ, ParallelTeam parallelTeam) Initialize the 3D FFT for complex 3D matrix.Complex3DParallel
(int nX, int nY, int nZ, ParallelTeam parallelTeam, IntegerSchedule integerSchedule) Initialize the 3D FFT for complex 3D matrix.Complex3DParallel
(int nX, int nY, int nZ, ParallelTeam parallelTeam, IntegerSchedule integerSchedule, DataLayout3D dataLayout) Initialize the 3D FFT for complex 3D matrix.Complex3DParallel
(int nX, int nY, int nZ, ParallelTeam parallelTeam, DataLayout3D dataLayout) Initialize the 3D FFT for complex 3D matrix. -
Method Summary
Modifier and TypeMethodDescriptionvoid
convolution
(double[] input) Compute the 3D FFT, perform a multiplication in reciprocal space, and the inverse 3D FFT in parallel.void
fft
(double[] input) Compute the 3D FFT in parallel.long[]
Get the timings for each thread.void
ifft
(double[] input) Compute the inverse 3D FFT in parallel.static double[]
initRandomData
(int dim, ParallelTeam parallelTeam) Initialize a 3D data for testing purposes.void
Initialize the timing array.static void
Test the Complex3DParallel FFT.void
setPackFFTs
(boolean packFFTs) Pack the FFTs for optimal use of SIMD instructions.void
setRecip
(double[] recip) Setter for the fieldrecip
.void
setUseSIMD
(boolean useSIMD) Use SIMD instructions if available.Get the timing string.toString()
-
Field Details
-
input
public double[] inputThis is a reference to the input array for convenience. The input array must be of size 2 * nX * nY * nZ. -
work3D
public final double[] work3DWork array used for transforms along the Z-axis.
-
-
Constructor Details
-
Complex3DParallel
Initialize the 3D FFT for complex 3D matrix.- Parameters:
nX
- X-dimension.nY
- Y-dimension.nZ
- Z-dimension.parallelTeam
- A ParallelTeam instance.- Since:
- 1.0
-
Complex3DParallel
public Complex3DParallel(int nX, int nY, int nZ, ParallelTeam parallelTeam, DataLayout3D dataLayout) Initialize the 3D FFT for complex 3D matrix.- Parameters:
nX
- X-dimension.nY
- Y-dimension.nZ
- Z-dimension.parallelTeam
- A ParallelTeam instance.dataLayout
- The data layout.- Since:
- 1.0
-
Complex3DParallel
public Complex3DParallel(int nX, int nY, int nZ, ParallelTeam parallelTeam, @Nullable IntegerSchedule integerSchedule) Initialize the 3D FFT for complex 3D matrix.- Parameters:
nX
- X-dimension.nY
- Y-dimension.nZ
- Z-dimension.parallelTeam
- A ParallelTeam instance.integerSchedule
- The IntegerSchedule to use.- Since:
- 1.0
-
Complex3DParallel
public Complex3DParallel(int nX, int nY, int nZ, ParallelTeam parallelTeam, @Nullable IntegerSchedule integerSchedule, DataLayout3D dataLayout) Initialize the 3D FFT for complex 3D matrix.- Parameters:
nX
- X-dimension.nY
- Y-dimension.nZ
- Z-dimension.parallelTeam
- A ParallelTeam instance.integerSchedule
- The IntegerSchedule to use.dataLayout
- The data layout.- Since:
- 1.0
-
-
Method Details
-
toString
-
setUseSIMD
public void setUseSIMD(boolean useSIMD) Use SIMD instructions if available.- Parameters:
useSIMD
- True to use SIMD instructions.
-
setPackFFTs
public void setPackFFTs(boolean packFFTs) Pack the FFTs for optimal use of SIMD instructions.- Parameters:
packFFTs
- True to pack the FFTs.
-
convolution
public void convolution(double[] input) Compute the 3D FFT, perform a multiplication in reciprocal space, and the inverse 3D FFT in parallel.- Parameters:
input
- The input array must be of size 2 * nX * nY * nZ.- Since:
- 1.0
-
fft
public void fft(double[] input) Compute the 3D FFT in parallel.- Parameters:
input
- The input array must be of size 2 * nX * nY * nZ.- Since:
- 1.0
-
getTiming
public long[] getTiming()Get the timings for each thread.- Returns:
- The timings for each thread.
-
ifft
public void ifft(double[] input) Compute the inverse 3D FFT in parallel.- Parameters:
input
- The input array must be of size 2 * nX * nY * nZ.- Since:
- 1.0
-
initTiming
public void initTiming()Initialize the timing array. -
timingString
Get the timing string.- Returns:
- The timing string.
-
setRecip
public void setRecip(double[] recip) Setter for the fieldrecip
.- Parameters:
recip
- an array of double.
-
initRandomData
Initialize a 3D data for testing purposes.- Parameters:
dim
- The dimension of the cube.parallelTeam
- The parallel team.- Returns:
- The 3D data.
- Since:
- 1.0
-
main
Test the Complex3DParallel FFT.
-