在symja数学解析器中无法识别Abs [x]

时间:2016-01-09 20:02:13

标签: java javafx symja

我导入了.jar文件,但是

DoubleEvaluator engine = new DoubleEvaluator();
engine.defineVariable("x", -1);
engine.evaluate("Abs[x]");

抛出一个错误:org.matheclipse.parser.client.math.ArithmeticMathException:EvalDouble#evaluateFunction(FunctionNode)不可能:Abs(x) 和

engine.evaluate("Sin[x]");

没有。这可能是什么原因?

Exception in thread "main" org.matheclipse.parser.client.math.ArithmeticMathException: EvalDouble#evaluateFunction(FunctionNode) not possible for: Abs(x)
at org.matheclipse.parser.client.eval.DoubleEvaluator.evaluateFunction(DoubleEvaluator.java:563)
at org.matheclipse.parser.client.eval.DoubleEvaluator.evaluateNode(DoubleEvaluator.java:493)
at org.matheclipse.parser.client.eval.DoubleEvaluator.evaluate(DoubleEvaluator.java:460)
at javaapplication14.JavaApplication14.main(JavaApplication14.java:24)
Java Result: 1

和示例运行

import org.matheclipse.parser.client.eval.DoubleEvaluator;

public class application {

public static void main(String[] args) {

    DoubleEvaluator engine = new DoubleEvaluator();

    engine.defineVariable("x",-1);
    engine.evaluate("Abs[x]");

}

}

1 个答案:

答案 0 :(得分:1)

(感谢堆栈跟踪和下载地址)

这个问题已在几个小时前修复,最新版本应解决问题:

https://bitbucket.org/axelclk/symja_android_library/downloads/symjaMMA2016-01-09.zip

添加了缺失的功能:

start "MyWindow" cmd /c "ping localhost & ipconfig & pause"

看到区别: https://bitbucket.org/axelclk/symja_android_library/diff/symja_android_library/matheclipse-parser/src/main/java/org/matheclipse/parser/client/eval/DoubleEvaluator.java?diff2=c84fa1c92f83&at=master