/** * Evaluate an expression. If no evaluation was possible this method returns * the given argument. * * @param a * the expression which should be evaluated * @return the evaluated expression * @see EvalEngine#eval(IExpr) */ public static IExpr eval(IExpr a) { return EvalEngine.eval(a); }
/** * Apply <code>ExpandAll[]</code> to the given expression and evaluate it. If * no evaluation was possible this method returns the given argument. * * @param a * the expression which should be evaluated * @return the evaluated expression * @see EvalEngine#eval(IExpr) */ public static IExpr evalExpandAll(IExpr a) { return EvalEngine.eval(ExpandAll(a)); }
/** * Create a function with 1 argument and evaluate it. * * @param head * @param a0 * @return the evaluated object */ public static IExpr eval(final ISymbol head, final IExpr a0) { final IAST ast = ast(head); ast.add(a0); return EvalEngine.eval(ast); }
/** * Create a function with 2 arguments and evaluate it. * * @param head * @param a0 * @param a1 * @return the evaluated object */ public static IExpr eval(final ISymbol head, final IExpr a0, final IExpr a1) { final IAST ast = ast(head); ast.add(a0); ast.add(a1); return EvalEngine.eval(ast); }
/** * Create a function with 3 arguments and evaluate it. * * @param head * @param a0 * @param a1 * @param a2 * @return the evaluated object */ public static IExpr eval(final ISymbol head, final IExpr a0, final IExpr a1, final IExpr a2) { final IAST ast = ast(head); ast.add(a0); ast.add(a1); ast.add(a2); return EvalEngine.eval(ast); }
public IExpr numericEval(final IAST functionList) { if (functionList.size() != 2) { throw new WrongNumberOfArguments(functionList, 1, functionList.size() - 1); } final EvalEngine engine = EvalEngine.get(); final boolean numericMode = engine.isNumericMode(); try { engine.setNumericMode(true); return EvalEngine.eval(functionList.get(1)); } finally { engine.setNumericMode(numericMode); } // return functionList.get(1); }
EvalEngine.eval(resultList.get(i));