Ejemplo n.º 1
0
        public static Matrix operator +(Matrix matrix, double number)
        {
            if (matrix == null)
            {
                throw new ArgumentNullException(nameof(matrix));
            }

            return(CalculateProvider.Add(matrix, number));
        }
Ejemplo n.º 2
0
        public static Matrix operator +(Matrix leftSide, Matrix rightSide)
        {
            if (leftSide == null)
            {
                throw new ArgumentNullException(nameof(leftSide));
            }

            if (rightSide == null)
            {
                throw new ArgumentNullException(nameof(rightSide));
            }

            if (leftSide.RowsCount != rightSide.RowsCount || leftSide.ColumnsCount != rightSide.ColumnsCount)
            {
                throw new DimensionsDontMatchException("Addition is impossible");
            }

            return(CalculateProvider.Add(leftSide, rightSide));
        }