public ObjectObgortka CompileY1(Vector <double> vectorB, Matrix <double> matrixA) { ObjectObgortka obgortka = new ObjectObgortka(); var compileY1 = matrixA * vectorB; obgortka.compileY1 = compileY1; return(obgortka); }
public ObjectObgortka GetVectorData(int n, VectorEnum Letter) { VectorFactory vectorFactory = new VectorFactory(); ObjectObgortka obgortka = new ObjectObgortka(); obgortka.Vector = vectorFactory.GetVector(Letter, n); return(obgortka); }
public ObjectObgortka CompileY3(Matrix <double> matrixA2, Matrix <double> matrixB2, Matrix <double> matrixC2) { ObjectObgortka obgortka = new ObjectObgortka(); var compileY3 = (matrixA2 * matrixB2) - matrixC2; obgortka.compileY3 = compileY3; return(obgortka); }
public ObjectObgortka CompileY2(Vector <double> vectorC1, Matrix <double> matrixA1, Vector <double> vectorB1) { ObjectObgortka obgortka = new ObjectObgortka(); var compileY2 = matrixA1 * (vectorB1 + (20 * vectorC1)); obgortka.compileY2 = compileY2; return(obgortka); }
//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); }