本文整理汇总了C#中UnaryExpression.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# UnaryExpression.Accept方法的具体用法?C# UnaryExpression.Accept怎么用?C# UnaryExpression.Accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnaryExpression
的用法示例。
在下文中一共展示了UnaryExpression.Accept方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDoFoldConstantInPositiveSquareRoot
public void TestDoFoldConstantInPositiveSquareRoot()
{
AbstractExpr input = new UnaryExpression(Polynomial.CreateConstant(4), new PositiveSquareroot());
IAbstractExpr result = input.Accept(visitor, Ig.nore);
Assert.AreNotEqual(input, result);
Assert.AreEqual(Polynomial.CreateConstant(2), result);
}
示例2: TestDontFoldConstantInFormalSquareRoot
public void TestDontFoldConstantInFormalSquareRoot()
{
AbstractExpr input = new UnaryExpression(Polynomial.CreateConstant(4), new FormalSquareroot());
IAbstractExpr result = input.Accept(visitor, Ig.nore);
Assert.AreEqual(input, result);
Assert.AreSame(input, result);
}
示例3: TestSquareOfUnaryMinus
public void TestSquareOfUnaryMinus()
{
AbstractExpr input = new UnaryExpression(-Polynomial.CreateNamedVariable("a").C, new Square());
string result = input.Accept(new ToStringVisitor(), BASE_PAR);
Assert.AreEqual("(-a)²", result);
}
示例4: TestSquareOfSum
public void TestSquareOfSum()
{
AbstractExpr input = new UnaryExpression(Polynomial.CreateNamedVariable("a").C + Polynomial.CreateConstant(1), new Square());
string result = input.Accept(new ToStringVisitor(), BASE_PAR);
Assert.AreEqual("(a+1)²", result);
}
示例5: TestSinOfUnaryMinus
public void TestSinOfUnaryMinus()
{
AbstractExpr input = new UnaryExpression(-Polynomial.CreateConstant(1).C, new Sin());
string result = input.Accept(new ToStringVisitor(), BASE_PAR);
Assert.AreEqual("sin (-1)", result);
}
示例6: TestSinOfSquare
public void TestSinOfSquare()
{
AbstractExpr input = new UnaryExpression(new UnaryExpression(Polynomial.CreateNamedVariable("a"), new Square()), new Sin());
string result = input.Accept(new ToStringVisitor(), BASE_PAR);
Assert.AreEqual("sin a²", result);
}