// Path: src/main/java/ro/hasna/ts/math/normalization/ZNormalizer.java
// public class ZNormalizer implements Normalizer {
//     private static final long serialVersionUID = 6446811014325682141L;
//     private final Mean mean;
//     private final StandardDeviation standardDeviation;
// 
//     public ZNormalizer() {
//         this(new Mean(), new StandardDeviation(false));
//     }
// 
//     /**
//      * Creates a new instance of this class with the given mean and standard deviation algorithms.
//      *
//      * @param mean              the mean
//      * @param standardDeviation the standard deviation
//      */
//     public ZNormalizer(final Mean mean, final StandardDeviation standardDeviation) {
//         this.mean = mean;
//         this.standardDeviation = standardDeviation;
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     @Override
//     public double[] normalize(double[] values) {
//         double m = mean.evaluate(values);
//         double sd = standardDeviation.evaluate(values, m);
// 
//         int length = values.length;
//         double[] normalizedValues = new double[length];
//         for (int i = 0; i < length; i++) {
//             normalizedValues[i] = (values[i] - m) / sd;
//         }
//         return normalizedValues;
//     }
// }


import org.junit.Assert;
import org.junit.Test;
import ro.hasna.ts.math.normalization.ZNormalizer;
        Assert.assertArrayEquals(expected, result);
    }

    @Test
    public void testTransformToIntArray2() throws Exception {
        double[] list = new double[64];
        for (int i = 0; i < 32; i++) {
            list[i] = i;
        }
        for (int i = 32; i < 64; i++) {
            list[i] = 64 - i;
        }
        double[] breakpoints = {-0.4307272992954576, 0.4307272992954576};
        int[] expected = {0, 0, 1, 2, 2, 2, 1, 0};

        SymbolicAggregateApproximation sax = new SymbolicAggregateApproximation(8, breakpoints);
        int[] result = sax.transform(list);

        Assert.assertArrayEquals(expected, result);
    }

    @Test
    public void testNormalisationAndPaaOrder() throws Exception {
        int segments = 16;
        int valuesPerSegment = 1024;
        int len = segments * valuesPerSegment;
        double[] list = new double[len];
        for (int i = 0; i < len; i++) {
            list[i] = i;
        }
// Path: src/main/java/ro/hasna/ts/math/normalization/ZNormalizer.java
// public class ZNormalizer implements Normalizer {
//     private static final long serialVersionUID = 6446811014325682141L;
//     private final Mean mean;
//     private final StandardDeviation standardDeviation;
// 
//     public ZNormalizer() {
//         this(new Mean(), new StandardDeviation(false));
//     }
// 
//     /**
//      * Creates a new instance of this class with the given mean and standard deviation algorithms.
//      *
//      * @param mean              the mean
//      * @param standardDeviation the standard deviation
//      */
//     public ZNormalizer(final Mean mean, final StandardDeviation standardDeviation) {
//         this.mean = mean;
//         this.standardDeviation = standardDeviation;
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     @Override
//     public double[] normalize(double[] values) {
//         double m = mean.evaluate(values);
//         double sd = standardDeviation.evaluate(values, m);
// 
//         int length = values.length;
//         double[] normalizedValues = new double[length];
//         for (int i = 0; i < length; i++) {
//             normalizedValues[i] = (values[i] - m) / sd;
//         }
//         return normalizedValues;
//     }
// }


// Path: src/test/java/ro/hasna/ts/math/representation/SymbolicAggregateApproximationTest.java
import org.junit.Assert;
import org.junit.Test;
import ro.hasna.ts.math.normalization.ZNormalizer;

        Assert.assertArrayEquals(expected, result);
    }

    @Test
    public void testTransformToIntArray2() throws Exception {
        double[] list = new double[64];
        for (int i = 0; i < 32; i++) {
            list[i] = i;
        }
        for (int i = 32; i < 64; i++) {
            list[i] = 64 - i;
        }
        double[] breakpoints = {-0.4307272992954576, 0.4307272992954576};
        int[] expected = {0, 0, 1, 2, 2, 2, 1, 0};

        SymbolicAggregateApproximation sax = new SymbolicAggregateApproximation(8, breakpoints);
        int[] result = sax.transform(list);

        Assert.assertArrayEquals(expected, result);
    }

    @Test
    public void testNormalisationAndPaaOrder() throws Exception {
        int segments = 16;
        int valuesPerSegment = 1024;
        int len = segments * valuesPerSegment;
        double[] list = new double[len];
        for (int i = 0; i < len; i++) {
            list[i] = i;
        }
        ZNormalizer normalizer = new ZNormalizer();