public static MyMatrix operator *(MyMatrix matrixA, MyMatrix matrixB) { if (matrixA.matrix.Length != matrixB.matrix.Length) { throw new Exception("Умножение невозможно"); } MyMatrix matrixC = new MyMatrix(matrixA.height, matrixB.width); for (var i = 0; i < matrixA.height; i++) { for (var j = 0; j < matrixB.width; j++) { matrixC[i, j] = 0; for (var k = 0; k < matrixA.width; k++) { matrixC[i, j] += matrixA[i, k] * matrixB[k, j]; } } } return(matrixC); }
public MyMatrix(MyMatrix ob) { matrix = ob.matrix; this.height = ob.height; this.width = ob.width; }
public void TransponeMe(MyMatrix ob) { this.matrix = GetTransponedArray(ob); }
public MyMatrix GetTransponedCopy(MyMatrix ob) { double[,] resultArr = GetTransponedArray(ob); return(new MyMatrix(resultArr)); }