private static DiagonaleMatrix <T> Add <T>(DiagonaleMatrix <T> lhs, DiagonaleMatrix <T> rhs) { var result = new T[lhs.Order, lhs.Order]; for (int i = 0; i < lhs.Order; i++) { for (int j = 0; j < lhs.Order; j++) { result[i, j] = (dynamic)lhs[i, j] + (dynamic)rhs[i, j]; } } return(new DiagonaleMatrix <T>(result)); }
private static SquareMatrix <T> Add <T>(DiagonaleMatrix <T> lhs, SquareMatrix <T> rhs) => Add(rhs, lhs);
private static DiagonaleMatrix <T> Add <T>(SymmetricMatrix <T> lhs, DiagonaleMatrix <T> rhs) => Add(rhs, lhs);