public void Add(IntegerMatrix other) { for (int i = 0; i < RowSize; i++) { for (int j = 0; j < ColumnSize; j++) { Replace(i, j, Get(i, j) + other.Get(i, j)); } } }
//TODO: classify multiplications to have the products be as explicit as possible. //im sure theres a better way to do this lol public SquareIntegerMatrix Multiply(SquareIntegerMatrix other) { IntegerMatrix product = Multiply(other as IntegerMatrix); SquareIntegerMatrix ret = new SquareIntegerMatrix(other.RowSize); for (int i = 0; i < RowSize; i++) { for (int j = 0; j < RowSize; j++) { ret.Replace(i, j, product.Get(i, j)); } } return(ret); }