Examples of MirrorExtension


Examples of ru.ifmo.diplom.kirilchuk.jawelet.util.extensioner.actions.MirrorExtension

        double[] approximation = new double[endIndex]; //working only with approximation coefficients
        System.arraycopy(data, 0, approximation, 0, endIndex);

        double[] temp = new Extensioner(approximation)
                .schedule(new MirrorExtension(1))
                .execute();

        //TODO ugly but need one more element...
        double[] extended = new double[temp.length + 1];
        System.arraycopy(temp, 0, extended, 0, temp.length);
View Full Code Here

Examples of ru.ifmo.diplom.kirilchuk.jawelet.util.extensioner.actions.MirrorExtension

    @Test
    public void testMirrorExtension() {
        double[] data = {1, 2, 3, 4, 5};

        double[] expect = {2, 1, 2, 3, 4, 5, 4};
        double[] result = new Extensioner(data).schedule(new MirrorExtension(1)).execute();
        assertArrayEquals(expect, result, 0);

        expect = new double[]{5, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 1};
        result = new Extensioner(data).schedule(new MirrorExtension(4)).execute();
        assertArrayEquals(expect, result, 0);

        expect = new double[]{4, 3, 2, 1, 2, 3, 4, 5, 0, 5, 4, 3};
        result = new Extensioner(data)
                .schedule(new ZeroPaddingToEven())
                .schedule(new MirrorExtension(3)).execute();
        assertArrayEquals(expect, result, 0);
    }
View Full Code Here

Examples of ru.ifmo.diplom.kirilchuk.jawelet.util.extensioner.actions.MirrorExtension

    }

    @Test(expected=IllegalArgumentException.class)
    public void shouldFailWhenDataTooSmallForMirroring() {
        double[] data = {1, 2, 3};
        new Extensioner(data).schedule(new MirrorExtension(3)).execute();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.