static void Main(string[] args) { double[,] matrix = CreateMatrix(); double[,] matrix2 = CreateMatrix(); MyMatrix mymatrix = new MyMatrix(matrix); ShowOneMatrix(mymatrix.GetMatrix()); MyMatrix mymatrix2 = new MyMatrix(matrix2); ShowMatrix(mymatrix2.GetMatrix()); MyMatrix mat = mymatrix * mymatrix2; ShowOneMatrix(mat.GetMatrix()); }
public static MyMatrix operator +(MyMatrix a, MyMatrix b) { if (a.GetHeight() != b.GetHeight() || a.GetWidth() != b.GetWidth()) { Console.WriteLine("Error: length of matrix not same"); break; } double[,] array = new double[a.GetHeight(), a.GetWidth()]; Parallel.For(0, a.GetHeight(), i => { Parallel.For(0, a.GetWidth(), j => { array[i, j] = a[i, j] + b[i, j]; }); Console.WriteLine(); }); MyMatrix matrix = new MyMatrix(array); return(matrix); }
public void TransponeMe() { MyMatrix mymatrix = new MyMatrix(GetTransponedArray()); Matrix = mymatrix.GetMatrix(); }
public MyMatrix GetTransponedCopy() { MyMatrix mymatrix = new MyMatrix(GetTransponedArray()); return(mymatrix); }
public MyMatrix(MyMatrix mymatrix) { MyMatrix matrix = mymatrix; }