Search in sources :

Example 1 with MathMLUtilities

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

the class MathMLForm method evaluate.

@Override
public IExpr evaluate(final IAST ast, EvalEngine engine) {
    Validate.checkSize(ast, 2);
    MathMLUtilities mathMLUtil = new MathMLUtilities(engine, false, engine.isRelaxedSyntax());
    IExpr arg1 = ast.arg1();
    StringWriter stw = new StringWriter();
    mathMLUtil.toMathML(arg1, stw);
    return F.$str(stw.toString());
}
Also used : MathMLUtilities(org.matheclipse.core.eval.MathMLUtilities) StringWriter(java.io.StringWriter) IExpr(org.matheclipse.core.interfaces.IExpr)

Example 2 with MathMLUtilities

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

the class MathMLPresentationTestCase method setUp.

/**
	 * The JUnit setup method
	 */
protected void setUp() {
    try {
        // F.initSymbols();
        EvalEngine engine = new EvalEngine(false);
        mathUtil = new MathMLUtilities(engine, false, true);
    } catch (Exception e) {
        e.printStackTrace();
    }
// fParser = new Parser(null);
// ExpressionFactory factory = new ExpressionFactory(new Namespace());
// fParser.setFactory(factory);
// fMathMLFactory = new MathMLFormFactory(factory);
}
Also used : MathMLUtilities(org.matheclipse.core.eval.MathMLUtilities) EvalEngine(org.matheclipse.core.eval.EvalEngine)

Aggregations

MathMLUtilities (org.matheclipse.core.eval.MathMLUtilities)2 StringWriter (java.io.StringWriter)1 EvalEngine (org.matheclipse.core.eval.EvalEngine)1 IExpr (org.matheclipse.core.interfaces.IExpr)1