DoubleFFT_1D { public void realForwardFull(double[] a) { realForwardFull(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 testRealForwardFull() { final double rel = 1E-8; final double x0 = 5E-6; 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]; for (int i = 0; i < n; i++) { actual[i] = 2. * random.nextDouble() - 1.; expected[2 * i] = actual[i]; expected[2 * i + 1] = 0.; } fft.complexForward(expected); fft.realForwardFull(actual); for (int i = 0; i < actual.length; i++) { checker.assertEquals("[" + i + "]", expected[i], actual[i]); } }