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

            return(CalculateProvider.Substract(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("Substraction is impossible");
            }

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