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