public void EvaluateTests(string expression, int expectedResult) { var subExpression = new SubExpression(); int result = subExpression.Evaluate(expression); Assert.That(result, Is.EqualTo(expectedResult)); }
public override object Evaluate() { object value = SubExpression.Evaluate(); if (value is Complex) { return(Complex.Exp((Complex)value)); } else if (value is CMatrix) { return(CMatrix.Exp((CMatrix)value)); } throw ExceptionHelper.ThrowWrongArgumentType(value); }
public override object Evaluate() { object value = SubExpression.Evaluate(); if (value is Complex) { return(Complex.Negate((Complex)value)); } else if (value is CMatrix) { return(CMatrix.Negate((CMatrix)value)); } else { throw ThrowWrongArgumentType("-"); } }
public void ErrorEvaluateTests(string expression) { var subExpression = new SubExpression(); Assert.Throws(typeof(ArithmeticException), () => subExpression.Evaluate(expression)); }
public override double Evaluate() { return(Math.Tanh(SubExpression.Evaluate())); }
public override double Evaluate() { return(-SubExpression.Evaluate()); }