Example #1
0
        public static void FloatArray(double SIZE)
        {
            float[] numbers     = new float[100];
            var     fileNumbers = File.ReadLines("matrixfloat.txt").Select(float.Parse);
            int     index       = 0;

            foreach (var number in fileNumbers)
            {
                numbers[index] = number;
                index++;
            }

            MyMatrix <float> kolekcja = new MyMatrix <float>();
            int k = 0;

            for (int i = 0; i < SIZE; i++)
            {
                for (int j = 0; j < SIZE; j++)
                {
                    {
                        float value = (float)numbers[k];
                        kolekcja.AddMatrix(value, i, j);
                    }
                    k++;
                }
            }
            kolekcja.Drukuj();
        }
Example #2
0
        public static void DoubleArray(double SIZE)
        {
            double[] numbers     = new double[16];
            var      fileNumbers = File.ReadLines("matrixdouble.txt").Select(double.Parse);
            int      index       = 0;

            foreach (var number in fileNumbers)
            {
                numbers[index] = number;
                index++;
            }
            double[,] result = new double[4, 4];
            MyMatrix <double> MyMatrix = new MyMatrix <double>();
            int k = 0;

            for (int i = 0; i < SIZE; i++)
            {
                for (int j = 0; j < SIZE; j++)
                {
                    {
                        double value = numbers[k];
                        MyMatrix.AddMatrix(value, i, j);
                        MyMatrix.AddWektor(value, i, j);
                        result[i, j] = value;
                    }
                    k++;
                }
            }
            MyMatrix.Multiply();
            MyMatrix.Drukuj();
        }
Example #3
0
        public static void MyArray(double SIZE)
        {
            string[] numbers = new string[100];

            MyMatrix <Fraction> kolekcja = new MyMatrix <Fraction>();
            int k = 0;

            for (int i = 0; i < SIZE; i++)
            {
                for (int j = 0; j < SIZE; j++)
                {
                    {
                        Fraction value = new Fraction(numbers[k]);
                        kolekcja.AddMatrix(value, i, j);
                    }
                    k++;
                }
            }
            // Console.WriteLine(kolekcja.Suma());
        }