<commit_before>﻿using Free.Matrix;
using Matrix.UnitTests;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace CSharp.Multithread.Matrix.Multiply
{
    public class Program
    {
        private static void Main(string[] args)
        {
            const int repeat = 3;
            const int size = 500;

            var allTimes = new List<long>();

            var m1 = new ColumnOptimizedMatrix(size, size);
            var m2 = new RowOptimizedMatrix(size, size);

            var m3 = new ColumnOptimizedMatrix(size, size);

            for (int i = 0; i < repeat; i++)
            {
                var swrf = Stopwatch.StartNew();
                m1.RandomFill(0, 100);
                m2.RandomFill(0, 100);
                swrf.Stop();
                Console.WriteLine($"Fill: {swrf.ElapsedMilliseconds:#,0}");

                Console.WriteLine("-");

                var sw = Stopwatch.StartNew();
                MatrixBase.MatrixMultiply(m1, m2, m3);
                sw.Stop();

                allTimes.Add(sw.ElapsedMilliseconds);

                Console.WriteLine($"Mult: {sw.ElapsedMilliseconds:#,0}");
            }

            var average = allTimes.Average();

            Console.WriteLine($"Average: {average:#,0.00}");

            //Console.WriteLine();

            //Console.WriteLine(m3.ToString());
            //Thread.Sleep(2000);
            Console.ReadKey();
        }
    }
}<commit_msg>Updated console app to test fully<commit_after>﻿using Free.Matrix;
using Matrix.UnitTests;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace CSharp.Multithread.Matrix.Multiply
{
    public class Program
    {
        const int repeat = 3;
        const int size = 1000;

        static MatrixBase co1 = new ColumnOptimizedMatrix(size, size);
        static MatrixBase ro1 = new RowOptimizedMatrix(size, size);
        static MatrixBase co2 = new ColumnOptimizedMatrix(size, size);
        static MatrixBase ro2 = new RowOptimizedMatrix(size, size);

        static MatrixBase aco1 = new ColumnOptimizedMatrix(size, size);
        static MatrixBase aro1 = new RowOptimizedMatrix(size, size);

        public static void Initialize()
        {
            Console.WriteLine("Initializing");
            co1.RandomFill(0, size);
            co2.RandomFill(0, size);
            ro1.RandomFill(0, size);
            ro2.RandomFill(0, size);
            Console.WriteLine("Complete");
        }

        public static double RunTest(IMatrix m1, IMatrix m2, IMatrix m3)
        {
            var allTimes = new List<long>();
            for (int i = 0; i < repeat; i++)
            {
                var sw = Stopwatch.StartNew();
                MatrixBase.MatrixMultiply(m1, m2, m3);
                sw.Stop();

                Console.WriteLine($"ms: {sw.ElapsedMilliseconds:#,0.00}");

                allTimes.Add(sw.ElapsedMilliseconds);
            }
            return allTimes.Average();
        }

        private static void RunATest(IMatrix m1, IMatrix m2, IMatrix m3, string message)
        {
            Console.WriteLine($"Running: {message}", message);
            var allTimes = new List<long>();
            var average = RunTest(m1, m2, m3);
            Console.WriteLine($"{message}: {average:#,0.00}");
        }

        private static void Main(string[] args)
        {
            Initialize();

            RunATest(co1, ro1, aco1, "Optimized input and column output");
            RunATest(co1, ro1, aro1, "Optimized input and row output");

            RunATest(co1, co2, aco1, "Non-Optimized, input 2 matrixes by column and column output");
            RunATest(co1, co2, aro1, "Non-Optimized, input 2 matrixes by column and row output");

            RunATest(ro1, ro2, aco1, "Non-Optimized, input 2 matrixes by row and column output");
            RunATest(ro1, ro2, aro1, "Non-Optimized, input 2 matrixes by row and row output");

            Console.WriteLine("Press any key...");
            Console.ReadKey();
        }
    }
}
{'fraction_non_alphanumeric': 0.11255199412772204, 'fraction_numerical': 0.022265720577440664, 'mean_word_length': 1.973090909090909, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3976620', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1141, 'n_words': 297}