Search in sources :

Example 11 with EvalUtilities

use of org.matheclipse.core.eval.EvalUtilities in project symja_android_library by axkr.

the class JavaFormTestCase method testJavaForm002.

public void testJavaForm002() {
    // don't distinguish between lower- and uppercase identifiers
    ParserConfig.PARSER_USE_LOWERCASE_SYMBOLS = true;
    EvalUtilities util = new EvalUtilities(false, true);
    IAST function = Sinc(Times(CI, CInfinity));
    IExpr result = EvalEngine.get().evalHoldPattern(function);
    assertEquals("F.Sinc(F.DirectedInfinity(F.CI))", result.internalJavaString(SYMBOL_FACTORY_PROPERTIES, -1, x -> null).toString());
    result = util.evaluate(function);
    assertEquals("F.oo", result.internalJavaString(SYMBOL_FACTORY_PROPERTIES, -1, x -> null).toString());
}
Also used : EvalUtilities(org.matheclipse.core.eval.EvalUtilities) IAST(org.matheclipse.core.interfaces.IAST) IExpr(org.matheclipse.core.interfaces.IExpr)

Aggregations

EvalUtilities (org.matheclipse.core.eval.EvalUtilities)11 IAST (org.matheclipse.core.interfaces.IAST)9 IExpr (org.matheclipse.core.interfaces.IExpr)9 ISymbol (org.matheclipse.core.interfaces.ISymbol)3 EvalEngine (org.matheclipse.core.eval.EvalEngine)2 Parser (org.matheclipse.parser.client.Parser)2