FloatFFT_1D { public void realForwardFull(float[] a) { realForwardFull(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 testRealForwardFull() { float rel = 5E-4f; float x0 = 5E-3f; if (n == 8192) { rel = 5E-3f; } if (n == 16384) { rel = 5E-3f; } if (n == 32768) { rel = 5E-3f; x0 = 1E-2f; } if (n == 65536) { rel = 1E-2f; x0 = 1E-2f; } if (n == 131072) { rel = 1E-2f; } final float abs = rel * x0; final FloatingPointEqualityChecker checker = createEqualityChecker(rel, abs); final float[] actual = new float[2 * n]; final float[] expected = new float[2 * n]; for (int i = 0; i < n; i++) { actual[i] = (float) (2. * random.nextDouble() - 1.); expected[2 * i] = actual[i]; expected[2 * i + 1] = 0f; } fft.complexForward(expected); fft.realForwardFull(actual); for (int i = 0; i < actual.length; i++) { checker.assertEquals("[" + i + "]", expected[i], actual[i]); } }