JTransformsWrapper { public static ComplexNumber[] inverseTransform1DComplex(final ComplexNumber[] z, final boolean scale) { ArgumentChecker.notNull(z, "array of complex number"); final int n = z.length; final double[] a = packFull(z); DoubleFFT_1D fft = CACHE_1D.get(n); if (fft == null) { fft = new DoubleFFT_1D(n); CACHE_1D.put(n, fft); } fft.complexInverse(a, scale); return unpackFull(a); }  static ComplexNumber[] transform1DComplex(final ComplexNumber[] z); static ComplexNumber[] inverseTransform1DComplex(final ComplexNumber[] z, final boolean scale); static ComplexNumber[] fullTransform1DReal(final double[] h); static ComplexNumber[] fullInverseTransform1DReal(final double[] x, final boolean scale); static ComplexNumber[] transform1DReal(final double[] h); static ComplexNumber[] inverseTransform1DReal(final double[] x, final boolean scale);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNull2() { JTransformsWrapper.inverseTransform1DComplex(null, false); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testEmpty2() { JTransformsWrapper.inverseTransform1DComplex(new ComplexNumber[0], false); }
@Test public void testGaussBackTransform() { final ComplexNumber[] transform = JTransformsWrapper.inverseTransform1DComplex(G_TRANS, false); final int n = transform.length; assertEquals(n, G_TRANS.length, 0); final double deltaX = 2 * Math.PI / n / DELTAX; double x; for (int i = n / 2; i < n; i++) { x = (i - n) * deltaX; final ComplexNumber scale = ComplexMathUtils.multiply(DELTAX / 2 / Math.PI, ComplexMathUtils.exp(new ComplexNumber(0.0, -x * X_MIN))); final ComplexNumber res = ComplexMathUtils.multiply(scale, transform[i]); assertComplexEquals(new ComplexNumber(GAUSS.evaluate(x), 0.0), res); } for (int i = 0; i <= n / 2; i++) { x = i * deltaX; final ComplexNumber scale = ComplexMathUtils.multiply(DELTAX / 2 / Math.PI, ComplexMathUtils.exp(new ComplexNumber(0.0, -x * X_MIN))); final ComplexNumber res = ComplexMathUtils.multiply(scale, transform[i]); assertComplexEquals(new ComplexNumber(GAUSS.evaluate(x), 0.0), res); } }