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(); }
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(); }