@@ -0,0 +1,1803 @@
+package ru.ifmo.nds.jmh.main;%0A%0Aimport java.util.Random;%0A%0Aimport ru.ifmo.nds.util.median.DestructiveMedianAlgorithm;%0Aimport ru.ifmo.nds.util.median.DestructiveMedianFactory;%0A%0Apublic class RunMedian %7B%0A    public static void main(String%5B%5D args) throws ClassNotFoundException, InstantiationException, IllegalAccessException %7B%0A        String algoName = args%5B0%5D;%0A        int size = Integer.parseInt(args%5B1%5D);%0A        int count = Integer.parseInt(args%5B2%5D);%0A        int iterations = Integer.parseInt(args%5B3%5D);%0A        long seed = Long.parseLong(args%5B4%5D);%0A%0A        String factoryClassName = DestructiveMedianFactory.class.getName().replace(%22DestructiveMedianFactory%22, algoName);%0A        DestructiveMedianFactory factory = (DestructiveMedianFactory) Class.forName(factoryClassName).newInstance();%0A%0A        DestructiveMedianAlgorithm algorithm = factory.createInstance(size);%0A%0A        //noinspection MismatchedReadAndWriteOfArray the inspection fails to detect the actual filling of the array%0A        double%5B%5D%5B%5D instances = new double%5Bcount%5D%5Bsize%5D;%0A        double%5B%5D buffer = new double%5Bsize%5D;%0A%0A        Random random = new Random(seed);%0A        for (double%5B%5D instance : instances) %7B%0A            for (int i = 0; i %3C size; ++i) %7B%0A                instance%5Bi%5D = random.nextDouble();%0A            %7D%0A        %7D%0A%0A        double checksum = 0;%0A        for (int iteration = 0; iteration %3C iterations; ++iteration) %7B%0A            System.out.print(%22Iteration %22 + (iteration + 1) + %22: %22);%0A            for (double%5B%5D instance : instances) %7B%0A                System.arraycopy(instance, 0, buffer, 0, size);%0A                double median = algorithm.solve(buffer, 0, size);%0A                checksum += median;%0A            %7D%0A            System.out.println(%22done!%22);%0A        %7D%0A        System.out.println(%22Checksum: %22 + checksum);%0A    %7D%0A%7D%0A

add a separate median runner (mainly for inlining testing).