public void VisualizeIterationsSimpleCPU()
        {
            ClusteringSimple clustering = new ClusteringSimple(descriptors);

            TestClusteringSimple(clustering);

            clustering.Clusterize(0.1, 1, 5334);
            Centroid[] centroids1 = clustering.Centroids;
            clustering.Clusterize(0.1, 2, 5334);
            Centroid[] centroids2 = clustering.Centroids;
            clustering.Clusterize(0.1, 4, 5334);
            Centroid[] centroids4 = clustering.Centroids;
            clustering.Clusterize(0.1, 8, 5334);
            Centroid[] centroids8 = clustering.Centroids;
            clustering.Clusterize(0.1, 16, 5334);
            Centroid[] centroids16 = clustering.Centroids;
            clustering.Clusterize(0.1, 32, 5334);
            Centroid[] centroids32 = clustering.Centroids;
            clustering.Clusterize(0.1, 64, 5334);
            Centroid[] centroids64 = clustering.Centroids;

            HelperTestClass.VisualizeClustering(clustering.Descriptors, centroids1, windowSize, windowSize);
            HelperTestClass.VisualizeClustering(clustering.Descriptors, centroids2, windowSize, windowSize);
            HelperTestClass.VisualizeClustering(clustering.Descriptors, centroids4, windowSize, windowSize);
            HelperTestClass.VisualizeClustering(clustering.Descriptors, centroids8, windowSize, windowSize);
            HelperTestClass.VisualizeClustering(clustering.Descriptors, centroids16, windowSize, windowSize);
            HelperTestClass.VisualizeClustering(clustering.Descriptors, centroids32, windowSize, windowSize);
            HelperTestClass.VisualizeClustering(clustering.Descriptors, centroids64, windowSize, windowSize);
        }
        public void HugeSimpleCPU()
        {
            int nDescriptors       = 350000;
            int descriptorDiension = 4096;
            int nClusters          = 25;// 128;
            int iterationCount     = 10;

            int nDescriptorsDiv5 = nDescriptors / 5;

            Descriptor[]     descriptors = HelperTestClass.GenerateHierarchicalDescriptors(seed, nDescriptorsDiv5, descriptorDiension);
            ClusteringSimple clustering  = new ClusteringSimple(descriptors);

            TestClusteringSimple(clustering);

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();
            clustering.Clusterize(nClusters, iterationCount, seed);
            stopWatch.Stop();

            double elapsedSeconds = (stopWatch.ElapsedMilliseconds * 0.001);
            double nPerSecond     = nDescriptorsDiv5 * 5 * nClusters / elapsedSeconds;

            Console.WriteLine("Computing time: " + elapsedSeconds + " seconds (" + nPerSecond + " per second).");

            HelperTestClass.VisualizeClustering(clustering.Descriptors, clustering.Centroids, windowSize, windowSize);
        }
        public void TestDescriptorAssignmentSimple()
        {
            ClusteringSimple clustering = new ClusteringSimple(descriptors);

            clustering.Clusterize(nClusters, iterationCount, seed);
            HelperTestClass.TestDescriptorAssignment(descriptors.Length, clustering.Centroids);
        }
        public void TestDescriptorAssignmentDivisive()
        {
            int[] nClusters       = new int[] { 10, 10 };
            int[] iterationCounts = new int[] { 10, 10 };

            ClusteringDivisive clustering = new ClusteringDivisive(descriptors);

            clustering.Clusterize(nClusters, iterationCounts, seed);
            HelperTestClass.TestDescriptorAssignment(descriptors.Length, clustering.Centroids[clustering.Centroids.Length - 1]);
        }
        public void VisualizeHeuristicDivisive3Layer()
        {
            int[] seedCounts      = new int[] { 10, 10, 10 };
            int[] iterationCounts = new int[] { 10, 10, 10 };

            ClusteringDivisive clustering = new ClusteringDivisive(descriptors);

            clustering.Clusterize(seedCounts, iterationCounts, seed);
            HelperTestClass.VisualizeClustering(clustering.Descriptors, clustering.Centroids, windowSize, windowSize);
        }
        public void VisualizeSimpleCPU()
        {
            double seedPercentage = 0.1;
            int    iterationCount = 10;

            ClusteringSimple clustering = new ClusteringSimple(descriptors);

            TestClusteringSimple(clustering);

            clustering.Clusterize(seedPercentage, iterationCount, seed);
            HelperTestClass.VisualizeClustering(clustering.Descriptors, clustering.Centroids, windowSize, windowSize);
        }
        public void VisualizeAgglomerative()
        {
            int nDescriptors        = 100;
            int descriptorDimension = 2;
            int nDescriptorsDiv5    = nDescriptors / 5;

            Descriptor[]            descriptors = HelperTestClass.GenerateHierarchicalDescriptors(seed, nDescriptorsDiv5, descriptorDimension);
            ClusteringAgglomerative clustering  = new ClusteringAgglomerative(descriptors);

            clustering.Clusterize();
            HelperTestClass.TestDescriptorAssignment(descriptors.Length, clustering.Centroids[0]);
            HelperTestClass.VisualizeClustering(clustering.Descriptors, clustering.Centroids[23], windowSize, windowSize);
        }