FastHadamardTransformer implements RealTransformer, Serializable { public double[] transform(final double[] f, final TransformType type) { if (type == TransformType.FORWARD) { return fht(f); } return TransformUtils.scaleArray(fht(f), 1.0 / f.length); }  double[] transform(final double[] f, final TransformType type); double[] transform(final UnivariateFunction f,
        final double min, final double max, final int n,
        final TransformType type); int[] transform(final int[] f);  }
@Test public void testNoIntInverse() { FastHadamardTransformer transformer = new FastHadamardTransformer(); double[] x = transformer.transform(new double[] { 0, 1, 0, 1}, TransformType.INVERSE); Assert.assertEquals( 0.5, x[0], 0); Assert.assertEquals(-0.5, x[1], 0); Assert.assertEquals( 0.0, x[2], 0); Assert.assertEquals( 0.0, x[3], 0); }
@Test public void test3Points() { try { new FastHadamardTransformer().transform(new double[3], TransformType.FORWARD); Assert.fail("an exception should have been thrown"); } catch (IllegalArgumentException iae) { } }