//public Matrix<double> GetMatrixData(int n, string Letter) //{ // var matrix = Matrix<double>.Build.Dense(n, n); // string input = Letter;// @"C:\Users\PC\source\repos\Lab2_TRSPO_Paralel\Lab2_TRSPO_Paralel\bin\Debug\netcoreapp3.1\matrixA.txt"; // //StreamReader reader = new StreamReader(input); // using (var reader = new StreamReader(input)) // { // for (var i = 0; i < n; i++) // { // for (var j = 0; j < n; j++) // { // string line; // //if ((line = reader.ReadAsync()) != null) // //{ // matrix[i, j] = reader.Read(); // Console.WriteLine($"index {i}{j}, Line: {matrix[i, j]}"); // //matrix[i, j] = Convert.ToDouble(line); // //} // } // reader.ReadLine(); // } // } // using (TextWriter tw = new StreamWriter("matrixARew.txt")) // { // for (int i = 0; i < n; i++) // { // for (int j = 0; j < n; j++) // { // tw.Write(matrix[i, j]); // } // tw.WriteLine(); // } // } // return matrix; //} //public Vector<double> GetVectorData(int n, string Letter) //{ // var vector = Vector<double>.Build.Dense(n); // string input = Letter;// @"C:\Users\PC\source\repos\Lab2_TRSPO_Paralel\Lab2_TRSPO_Paralel\bin\Debug\netcoreapp3.1\matrixA.txt"; // //StreamReader reader = new StreamReader(input); // using (var reader = new StreamReader(input)) // { // for (var i = 0; i < n; i++) // { // string line; // if ((line = reader.ReadLine()) != null) // { // Console.WriteLine($"Loop index {i + n * i}, Line: {line}"); // vector[i] = Convert.ToDouble(line); // } // } // } // return vector; //} public ObjectObgortka GetMatrixData(int n, MatrixEnum Letter) { MatrixFactory matrixFactory = new MatrixFactory(); ObjectObgortka obgortka = new ObjectObgortka(); Console.WriteLine(n); obgortka.Matrix = matrixFactory.GetMatrix(Letter, n); //obgortka.Matrix = null; Console.WriteLine("obgortka"); Console.WriteLine(obgortka.Matrix); return(obgortka); }
public Matrix <double> GetMatrix(MatrixEnum en, int count) { switch (en) { case MatrixEnum.A: return(GetSquareRandomMatrix(count)); case MatrixEnum.A1: return(GetSquareRandomMatrix(count)); case MatrixEnum.B2: return(GetSquareRandomMatrix(count)); case MatrixEnum.A2: return(GetSquareRandomMatrix(count)); case MatrixEnum.C2: return(GetC2Matrix(count)); default: return(null); } }