public MathScriptEngine() { // get the thread local evaluation engine EvalEngine engine = new EvalEngine(); // engine.setIterationLimit(10); fUtility = new EvalUtilities(engine, false); }
public void beginTrace(Predicate<IExpr> matcher, IAST list) { setTraceMode(true); fTraceStack = new TraceStack(matcher, list); }
/** * 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); }
/** * Copied from MathMLUtilities.startRequest() - the parent class of EvalUtilities: Assign the associated EvalEngine * to the current thread. Every subsequent action evaluation in this thread affects the EvalEngine in this class. */ public void evalEngineAttach() { EvalEngine.set(myEvalEngine); }
/** * Stop the current evaluation thread. */ public void stopRequest() { fEvalEngine.stopRequest(); } }
@Override public EvalEngine initialValue() { if (DEBUG) { System.out.println("ThreadLocal" + fID); } return new EvalEngine("ThreadLocal" + (fID++), 0, System.out, false); } };
/** * Define an unary AST with the header <code>head</code>. The * <code>apply()</code> method evaluates the cretaed AST with the given * expression and checks if the result equals <code>True</code>. * * @param head * the AST's head expresion */ public IsUnaryTrue(final IExpr head) { this(EvalEngine.get(), head); }
public TraceStack(Predicate<IExpr> matcher, IAST list) { super(); fMatcher = matcher; fList = list; pushList(); }
/** * Set the step listener for this evaluation engine. The method also calls <code>setTraceMode(true)</code> to enable * the trace mode. The caller is responsible for calling <code>setTraceMode(false)</code> if no further listening is * desirable. * * @param stepListener * the listener which should listen to the evaluation steps. */ public void setStepListener(IEvalStepListener stepListener) { setTraceMode(true); fTraceStack = stepListener; }
public static IExpr evalLeftHandSide(final IExpr leftHandSide, final EvalEngine engine) { if (leftHandSide instanceof IAST) { final IExpr temp = engine.evalSetAttributes((IAST) leftHandSide); if (temp != null) { return temp; } } return leftHandSide; }
public MathScriptEngine() { // get the thread local evaluation engine fEngine = new EvalEngine(); // fEngine.setRecursionLimit(256); // fEngine.setIterationLimit(256); fUtility = new EvalUtilities(fEngine, false, false); }
private void beginTrace(Predicate<IExpr> matcher, IAST list) { setTraceMode(true); fTraceStack = new TraceStack(matcher, list); }
/** * Assign the associated EvalEngine to the current thread. Every subsequent * action evaluation in this thread affects the EvalEngine in this class. */ public void startRequest() { EvalEngine.set(fEvalEngine); }
/** * Stop the current evaluation thread. */ public void stopRequest() { fEvalEngine.stopRequest(); } }
public MathGateUnscripted() { // Symja comment: get the thread local evaluation engine myEvalEngine = new EvalEngine(); // engine.setIterationLimit(10); // The "false" controls some MathML prefixing behavior that we probably don't care about // myEvalUtilityWrapper = new EvalUtilities(myEvalEngine, false); }
/** * Define a binary AST with the header <code>head</code>. * * @param head * the AST's head expression */ public IsBinaryTrue(final IExpr head) { this(head, EvalEngine.get()); }
/** * Description of the Method */ // private static void version() { // System.out.println("MathEclipse " + Config.VERSION); // } public Console() { // fParser = new Parser(null); // ExpressionFactory factory = ExpressionFactory.get(); // fParser.setFactory(factory); EvalEngine engine = new EvalEngine(); util = new EvalUtilities(engine, false); }
/** * Assign the associated EvalEngine to the current thread. Every subsequent * action evaluation in this thread affects the EvalEngine in this class. */ public void startRequest() { EvalEngine.set(fEvalEngine); }
/** * Copied from MathMLUtilities.stopRequest() - the parent class of EvalUtilities: Stop the current evaluation * thread, by setting stopRequested to true in the EvalEngine. Actual impacts are outside EvalEngine, apparently. * Speculation: Seems to be "interrupt - stop trying to solve", and perhaps also triggers some explicit cleanup? */ public void evalEngineStop() { myEvalEngine.stopRequest(); }