Class LibMatrixFourier
- java.lang.Object
-
- org.apache.sysds.runtime.matrix.data.LibMatrixFourier
-
public class LibMatrixFourier extends Object
-
-
Constructor Summary
Constructors Constructor Description LibMatrixFourier()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
fft(double[] re, double[] im, int rows, int cols, int threads, boolean inclColCalc)
Function to perform FFT for two given double arrays.static MatrixBlock[]
fft(MatrixBlock re, int threads)
Function to perform FFT for a given matrix.static MatrixBlock[]
fft(MatrixBlock re, MatrixBlock im, int threads)
Function to perform FFT for two given matrices.static MatrixBlock[]
fft_linearized(MatrixBlock re, int threads)
Function to perform FFT for each row of a given matrix.static MatrixBlock[]
fft_linearized(MatrixBlock re, MatrixBlock im, int threads)
Function to perform FFT for each row of two given matrices.static void
fft_one_dim(double[] re, double[] im, double[] re_inter, double[] im_inter, int start, int stop, int num, int minStep)
Function to perform one-dimensional FFT for two given double arrays.static void
ifft(double[] re, double[] im, int rows, int cols, int threads, boolean inclColCalc)
Function to perform IFFT for two given double arrays.static MatrixBlock[]
ifft(MatrixBlock re, int threads)
Function to perform IFFT for a given matrix.static MatrixBlock[]
ifft(MatrixBlock re, MatrixBlock im, int threads)
Function to perform IFFT for two given matrices.static MatrixBlock[]
ifft_linearized(MatrixBlock re, int threads)
Function to perform IFFT for each row of a given matrix.static MatrixBlock[]
ifft_linearized(MatrixBlock re, MatrixBlock im, int threads)
Function to perform IFFT for each row of two given matrices.static boolean
isPowerOfTwo(int n)
Function for checking whether the given integer is a power of two.
-
-
-
Method Detail
-
fft
public static MatrixBlock[] fft(MatrixBlock re, MatrixBlock im, int threads)
Function to perform FFT for two given matrices. The first one represents the real values and the second one the imaginary values. The output also contains one matrix for the real and one for the imaginary values.- Parameters:
re
- matrix object representing the real valuesim
- matrix object representing the imaginary valuesthreads
- number of threads- Returns:
- array of two matrix blocks
-
ifft
public static MatrixBlock[] ifft(MatrixBlock re, MatrixBlock im, int threads)
Function to perform IFFT for two given matrices. The first one represents the real values and the second one the imaginary values. The output also contains one matrix for the real and one for the imaginary values.- Parameters:
re
- matrix object representing the real valuesim
- matrix object representing the imaginary valuesthreads
- number of threads- Returns:
- array of two matrix blocks
-
fft_linearized
public static MatrixBlock[] fft_linearized(MatrixBlock re, MatrixBlock im, int threads)
Function to perform FFT for each row of two given matrices. The first one represents the real values and the second one the imaginary values. The output also contains one matrix for the real and one for the imaginary values.- Parameters:
re
- matrix object representing the real valuesim
- matrix object representing the imaginary valuesthreads
- number of threads- Returns:
- array of two matrix blocks
-
ifft_linearized
public static MatrixBlock[] ifft_linearized(MatrixBlock re, MatrixBlock im, int threads)
Function to perform IFFT for each row of two given matrices. The first one represents the real values and the second one the imaginary values. The output also contains one matrix for the real and one for the imaginary values.- Parameters:
re
- matrix object representing the real valuesim
- matrix object representing the imaginary valuesthreads
- number of threads- Returns:
- array of two matrix blocks
-
fft
public static void fft(double[] re, double[] im, int rows, int cols, int threads, boolean inclColCalc)
Function to perform FFT for two given double arrays. The first one represents the real values and the second one the imaginary values. Both arrays get updated and contain the result.- Parameters:
re
- array representing the real valuesim
- array representing the imaginary valuesrows
- number of rowscols
- number of rowsthreads
- number of threadsinclColCalc
- if true, fft is also calculated for each column, otherwise only for each row
-
ifft
public static void ifft(double[] re, double[] im, int rows, int cols, int threads, boolean inclColCalc)
Function to perform IFFT for two given double arrays. The first one represents the real values and the second one the imaginary values. Both arrays get updated and contain the result.- Parameters:
re
- array representing the real valuesim
- array representing the imaginary valuesrows
- number of rowscols
- number of rowsthreads
- number of threadsinclColCalc
- if true, fft is also calculated for each column, otherwise only for each row
-
fft_one_dim
public static void fft_one_dim(double[] re, double[] im, double[] re_inter, double[] im_inter, int start, int stop, int num, int minStep)
Function to perform one-dimensional FFT for two given double arrays. The first one represents the real values and the second one the imaginary values. Both arrays get updated and contain the result.- Parameters:
re
- array representing the real valuesim
- array representing the imaginary valuesre_inter
- array for the real values of intermediate resultsim_inter
- array for the imaginary values of intermediate resultsstart
- start index (incl.)stop
- stop index (excl.)num
- number of values used for fftminStep
- step size between values used for fft
-
isPowerOfTwo
public static boolean isPowerOfTwo(int n)
Function for checking whether the given integer is a power of two.- Parameters:
n
- integer to check- Returns:
- true if n is a power of two, false otherwise
-
fft
public static MatrixBlock[] fft(MatrixBlock re, int threads)
Function to perform FFT for a given matrix. The given matrix only represents real values. The output contains one matrix for the real and one for the imaginary values.- Parameters:
re
- matrix object representing the real valuesthreads
- number of threads- Returns:
- array of two matrix blocks
-
ifft
public static MatrixBlock[] ifft(MatrixBlock re, int threads)
Function to perform IFFT for a given matrix. The given matrix only represents real values. The output contains one matrix for the real and one for the imaginary values.- Parameters:
re
- matrix object representing the real valuesthreads
- number of threads- Returns:
- array of two matrix blocks
-
fft_linearized
public static MatrixBlock[] fft_linearized(MatrixBlock re, int threads)
Function to perform FFT for each row of a given matrix. The given matrix only represents real values. The output contains one matrix for the real and one for the imaginary values.- Parameters:
re
- matrix object representing the real valuesthreads
- number of threads- Returns:
- array of two matrix blocks
-
ifft_linearized
public static MatrixBlock[] ifft_linearized(MatrixBlock re, int threads)
Function to perform IFFT for each row of a given matrix. The given matrix only represents real values. The output contains one matrix for the real and one for the imaginary values.- Parameters:
re
- matrix object representing the real valuesthreads
- number of threads- Returns:
- array of two matrix blocks
-
-