internal BinaryOperationExpression(BinaryOperator @operator, SymbolicExpression firstOperand, SymbolicExpression secondOperand)
 {
     Operator        = @operator;
     _operands.Item1 = firstOperand ?? throw new ArgumentNullException(nameof(firstOperand));
     _operands.Item2 = secondOperand ?? throw new ArgumentNullException(nameof(secondOperand));
 }
Пример #2
0
 internal UnaryOperationExpression(UnaryOperator @operator, SymbolicExpression operand)
 {
     Operator = @operator;
     _operand = operand ?? throw new ArgumentNullException(nameof(operand));
 }
Пример #3
0
 public static SymbolicExpression Divide(SymbolicExpression a, SymbolicExpression b)
 => ExpressionSimplifier.TrySimplifyDivision(a, b)
 ?? new BinaryOperationExpression(BinaryOperator.Division, a, b);
Пример #4
0
 public static SymbolicExpression Multiply(SymbolicExpression a, SymbolicExpression b)
 => ExpressionSimplifier.TrySimplifyMultiplication(a, b)
 ?? new BinaryOperationExpression(BinaryOperator.Multiplication, a, b);
Пример #5
0
 public static SymbolicExpression Subtract(SymbolicExpression a, SymbolicExpression b)
 => ExpressionSimplifier.TrySimplifySubtraction(a, b)
 ?? new BinaryOperationExpression(BinaryOperator.Subtraction, a, b);
Пример #6
0
 public static SymbolicExpression Add(SymbolicExpression a, SymbolicExpression b)
 => ExpressionSimplifier.TrySimplifyAddition(a, b)
 ?? new BinaryOperationExpression(BinaryOperator.Addition, a, b);
Пример #7
0
 public static SymbolicExpression Negate(SymbolicExpression e)
 => ExpressionSimplifier.TrySimplifyNegation(e)
 ?? new UnaryOperationExpression(UnaryOperator.Minus, e);