DoubleFFT_1D { public void complexForward(double[] a) { complexForward(a, 0); } DoubleFFT_1D(int n); void complexForward(double[] a); void complexForward(double[] a, int offa); void complexInverse(double[] a, boolean scale); void complexInverse(double[] a, int offa, boolean scale); void realForward(double[] a); void realForward(double[] a, int offa); void realForwardFull(double[] a); void realForwardFull(final double[] a, final int offa); void realInverse(double[] a, boolean scale); void realInverse(double[] a, int offa, boolean scale); void realInverseFull(double[] a, boolean scale); void realInverseFull(final double[] a, final int offa, boolean scale);  }
@Test public void testComplexForward() { final double rel = 1E-9; final double x0 = 1E-8; final double abs = rel * x0; final FloatingPointEqualityChecker checker = createEqualityChecker(rel, abs); final double[] actual = new double[2 * n]; final double[] expected = new double[2 * n]; readData(String.format(FFTW_INPUT_PATTERN, Integer.valueOf(n)), actual); readData(String.format(FFTW_OUTPUT_PATTERN, Integer.valueOf(n)), expected); fft.complexForward(actual); for (int i = 0; i < actual.length; i++) { checker.assertEquals("[" + i + "]", expected[i], actual[i]); } }