use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class BasicPatternPropertiesTestCase method comparePriority.
public void comparePriority(String patternString1, String patternString2, int result) {
try {
EvalEngine engine = EvalEngine.get();
ASTNode node = fParser.parse(patternString1);
IExpr pat1 = new AST2Expr(false, engine).convert(node);
PatternMatcher matcher1 = new PatternMatcher(pat1);
node = fParser.parse(patternString2);
IExpr pat2 = new AST2Expr(false, engine).convert(node);
PatternMatcher matcher2 = new PatternMatcher(pat2);
assertEquals(matcher1.equivalentTo(matcher2), result);
} catch (Exception e) {
e.printStackTrace();
assertEquals(Integer.MAX_VALUE, result);
}
}
use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class BasicPatternPropertiesTestCase method setUp.
/**
* The JUnit setup method
*/
@Override
protected void setUp() {
try {
// setup the evaluation engine (and bind to current thread)
// EvalEngine.get();
EvalEngine engine = new EvalEngine();
EvalEngine.set(engine);
engine.setSessionID("BasicPatternPropertiesTestCase");
engine.setRecursionLimit(256);
engine.setIterationLimit(1024 * 1024);
fParser = new Parser();
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class ConstantTest method setUp.
/**
* The JUnit setup method
*/
@Override
protected void setUp() {
Config.BUILTIN_PROTECTED = ISymbol.PROTECTED;
super.setUp();
Config.SHORTEN_STRING_LENGTH = 1024;
Config.MAX_AST_SIZE = 1000000;
// // dummy eval
// try {
// fScriptEngine.eval("");
// } catch (ScriptException e) {
// }
EvalEngine engine = (EvalEngine) fScriptEngine.get("EVAL_ENGINE");
engine.setIterationLimit(50000);
engine.setRecursionLimit(256);
}
use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class ExpandTestCase method testExpandPerformance002.
public void testExpandPerformance002() {
// Expand((a+b+2*c+x+y+3*z)^12)
IAST ast = Power(Plus(a, b, F.Times(C2, c), x, y, F.Times(F.C3, z)), F.ZZ(12));
IAST temp = (IAST) Algebra.expand(ast, null, false, false, false);
EvalEngine engine = EvalEngine.get();
temp = (IAST) engine.evaluate(temp);
// number of terms
assertEquals(temp.argSize(), 6188);
assertEquals(temp.get(6188).toString(), "531441*z^12");
assertEquals(temp.get(462).toString(), "5544*a^5*b^6*y");
}
use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class SerializableTest method testPowerSeries.
public void testPowerSeries() {
equalsCopy(new ASTSeriesData(F.x, F.a, F.List(F.C0, F.C1, F.C3), 0, 10, 1));
// Series(Log(x),{x,a,4})
EvalEngine engine = EvalEngine.get();
IExpr result = engine.evaluate(F.Series(F.Log(F.x), F.List(F.x, F.a, F.C4)));
equalsCopy(result);
}
Aggregations