Package ffx.numerics.fft
Class Complex3D
java.lang.Object
ffx.numerics.fft.Complex3D
Compute the 3D FFT of complex, double precision input of arbitrary dimensions via 1D Mixed Radix
FFTs.
For interleaved data, the location of the input point [x, y, z] 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
For blocked data along x, the location of the input point [x, y, z] within the input array must be:
double real = input[x*nextX + y*nextY + z*nextZ]
double imag = input[x*nextX + y*nextY + z*nextZ + im]
where
int nextX = 1
int nextY = 2*nX
int nextZ = 2*nX*nY
int im = nX for BLOCKED_X
int im = nX*nY for BLOCKED_XY
int im = nX*nY*nZ for BLOCKED_XYZ
- Since:
- 1.0
- Author:
- Michal J. Schnieders
- See Also:
-
Constructor Summary
ConstructorDescriptionComplex3D
(int nX, int nY, int nZ) Initialize the 3D FFT for complex 3D matrix using interleaved data layout.Complex3D
(int nX, int nY, int nZ, DataLayout3D layout) Initialize the 3D FFT for complex 3D matrix. -
Method Summary
Modifier and TypeMethodDescriptionvoid
convolution
(double[] input) Perform a convolution.void
fft
(double[] input) Compute the 3D FFT.void
ifft
(double[] input) Compute the inverse 3D FFT.static int
index3D
(int i, int j, int k, int nX, int nY, DataLayout3D layout) Determine the index of the complex number in the blocked 1D array from the X, Y and Z indices.static int
interleavedIndex
(int i, int j, int k, int nX, int nY) Determine the index of the complex number in the 1D array from the X, Y and Z indices.void
setPackFFTs
(boolean packFFTs) Set the 2D transform to pack FFTs.void
setRecip
(double[] recip) Setter for the fieldrecip
.void
setUseSIMD
(boolean useSIMD) Set the 2D transform to use SIMD instructions.
-
Constructor Details
-
Complex3D
public Complex3D(int nX, int nY, int nZ) Initialize the 3D FFT for complex 3D matrix using interleaved data layout.- Parameters:
nX
- X-dimension.nY
- Y-dimension.nZ
- Z-dimension.
-
Complex3D
Initialize the 3D FFT for complex 3D matrix.- Parameters:
nX
- X-dimension.nY
- Y-dimension.nZ
- Z-dimension.layout
- Data layout.
-
-
Method Details
-
setUseSIMD
public void setUseSIMD(boolean useSIMD) Set the 2D transform to use SIMD instructions.- Parameters:
useSIMD
- True to use SIMD instructions.
-
setPackFFTs
public void setPackFFTs(boolean packFFTs) Set the 2D transform to pack FFTs.- Parameters:
packFFTs
- True to pack FFTs.
-
interleavedIndex
public static int interleavedIndex(int i, int j, int k, int nX, int nY) Determine the index of the complex number in the 1D array from the X, Y and Z indices.- Parameters:
i
- the index along the X-axis.j
- the index along the Y-axis.k
- the index along the Z-axis.nX
- the number of points along the X-axis.nY
- the number of points along the Y-axis.- Returns:
- the index of the complex number in the 1D array.
-
index3D
Determine the index of the complex number in the blocked 1D array from the X, Y and Z indices.- Parameters:
i
- the index along the X-axis.j
- the index along the Y-axis.k
- the index along the Z-axis.nX
- the number of points along the X-axis.nY
- the number of points along the Y-axis.layout
- the data layout.- Returns:
- the index of the complex number in the 1D array using blocked data layout.
-
fft
public void fft(double[] input) Compute the 3D FFT.- Parameters:
input
- The input array must be of size 2 * nX * nY * nZ.
-
ifft
public void ifft(double[] input) Compute the inverse 3D FFT.- Parameters:
input
- The input array must be of size 2 * nX * nY * nZ.
-
convolution
public void convolution(double[] input) Perform a convolution.- Parameters:
input
- The input array.
-
setRecip
public void setRecip(double[] recip) Setter for the fieldrecip
.- Parameters:
recip
- an array of double.
-