예제 #1
0
        public void optimised_heap_sort_video()
        {
            const string path = "opt_heap_sort.mp4";

            const int width  = 1920; //640;//1920;
            const int height = 1080; //448;//1080;
            const int fps    = 60;

            using var subject = new VideoFileSynthesiser(path, width, height, fps);
            subject.WriteVideo(new OptimisedHeapMovieGen(width, height, "random", DataSets.Random(1024)));

            Assert.That(File.Exists(path), "file was not written");
        }
예제 #2
0
        public void repeated_heap_sort_video()
        {
            const string path = "repeated_heap_sort.mp4";

            const int width  = 640; //1920;
            const int height = 448; //1080;
            const int fps    = 60;

            using var subject = new VideoFileSynthesiser(path, width, height, fps);
            subject.WriteVideo(new RepeatHeapMovieGen(width, height, "scatter reverse", DataSets.ScatterReverse(128)));

            Assert.That(File.Exists(path), "file was not written");
        }
예제 #3
0
        public void quick_sort_video()
        {
            const string path = "simple_recursive_quicksort.mp4";

            const int width  = 1920; //640;//1920;
            const int height = 1080; //448;//1080;
            const int fps    = 60;

            using var subject = new VideoFileSynthesiser(path, width, height, fps);
            subject.WriteVideo(new QSortMovieGen(width, height, "scatter reverse", DataSets.ScatterReverse(1024)));

            Assert.That(File.Exists(path), "file was not written");
        }
예제 #4
0
        public void tournament_sort_video()
        {
            const string path = "tournament_sort.mp4";

            const int width  = 1920;
            const int height = 1080;
            const int fps    = 60;

            using var subject = new VideoFileSynthesiser(path, width, height, fps);
            subject.WriteVideo(new TournamentMergeSortMovieGen(width, height, "random", DataSets.Random(256)));

            Assert.That(File.Exists(path), "file was not written");
        }
예제 #5
0
        public void Trinity_array_rotation()
        {
            const string path = "trinity_array_rotate_video_out.mp4";

            const int width  = 1920; //640;//1920;
            const int height = 1080; //448;//1080;
            const int fps    = 60;

            using var subject = new VideoFileSynthesiser(path, width, height, fps);
            subject.WriteVideo(new ArrayRotate_Trinity(width, height, length: 1024, rotatePlaces: 256));

            Assert.That(File.Exists(path), "file was not written");
        }
예제 #6
0
        public void create_a_basic_movie_file()
        {
            const string path = "video_out.mp4";

            const int width  = 800;
            const int height = 450;
            const int fps    = 60;

            using var subject = new VideoFileSynthesiser(path, width, height, fps);
            subject.WriteVideo(new SimpleTestGen());

            Assert.That(File.Exists(path), "file was not written");
        }
예제 #7
0
        public void quick_sort_with_pre_phase_video()
        {
            // This sort is pretty bad.
            const string path = "prephase_recursive_quicksort.mp4";

            const int width  = 640; //1920;
            const int height = 448; //1080;
            const int fps    = 60;

            using var subject = new VideoFileSynthesiser(path, width, height, fps);
            subject.WriteVideo(new QSortPrephaseMovieGen(width, height, "scatter reverse", DataSets.ScatterReverse(512)));

            Assert.That(File.Exists(path), "file was not written");
        }
예제 #8
0
        public void merge_sort_video()
        {
            // Everyone does one of these, right?
            const string path = "bottom_up_merge.mp4";

            const int width  = 640; //1920;
            const int height = 448; //1080;
            const int fps    = 60;

            using var subject = new VideoFileSynthesiser(path, width, height, fps);
            subject.WriteVideo(new MergeMovieGen(width, height, "scatter reverse", DataSets.ScatterReverse(512)));

            Assert.That(File.Exists(path), "file was not written");
        }
예제 #9
0
        public void radix_in_place_sort_video()
        {
            const string path = "radix_in_place_sort.mp4";

            const int width  = 1920; //640;//1920;
            const int height = 1080; //448;//1080;
            const int fps    = 60;

            // This does more inspections than the merge, but *can* end up with far fewer copies,
            // and only requires log2(n) aux space
            using var subject = new VideoFileSynthesiser(path, width, height, fps);
            subject.WriteVideo(new InPlaceMsdRadixMovieGen(width, height, "random", DataSets.Random(1024)));

            Assert.That(File.Exists(path), "file was not written");
        }