|
|
MathEclipse Development
CVS source codeThe latest source code is available in CVS: The open source tools used by MathEclipse are listed in the MathEclipse Credits page. Some of these open source tools are modified and integrated in the Setting up a development environmentRequirements
CVS ModulesFor the source code of the basic APIs, please check-out the following core modules in your Eclipse IDE:
For interactively testing these modules you can
To test this basic modules you can also check out the associated JUnit tests:
These are the Eclipse IDE related plugins:
Only these 6 modules are required for a basic setup. All required libraries can be found in the folder /org.matheclipse.eval/lib Additional the source code for the online servlet can be found in this CVS module
JUnit Tests
Object oriented design of the expression tree representationIn the following image you can see the design of the classes, which represent the expression tree in a MathEclipse formula: An expression is organized in a tree-like structure. Every node in the tree implements a symbol (i.e. variable or constant), a pattern, a string, a number (i.e. integer, fraction, complex, double or double complex) or a function (i.e. root of subtree). The A function is represented by an
Example: f[x, Sin[y]] is represented as a nested java.util.List: (f, x, (Sin, y) ) FAQHow can I start a simple evaluation console?Run the main method in the org.matheclipse.core.eval.Console class and an input screen similar to the following output should appear Options: -h or -help print this message -f or -file <filename> use given file as input To stop the program type: exit<RETURN> To continue an input line type '\' at the end of the line. ****+****+****+****+****+****+****+****+****+****+****+****+ >>> D[Sin[x],x] Cos[x] >>> 2^128 340282366920938463463374607431768211456 >>> How can I evaluate a given String?The following snippet shows a simple example:
package org.matheclipse.core.test.examples;
import org.matheclipse.core.eval.EvalEngine;
import org.matheclipse.core.eval.EvalUtilities;
import org.matheclipse.core.form.output.OutputFormFactory;
import org.matheclipse.core.form.output.StringBufferWriter;
import org.matheclipse.parser.SyntaxError;
import org.matheclipse.parser.interfaces.IExpr;
public class SimpleExample {
public static void main(String[] args) {
try {
// get the thread local evaluation engine
EvalEngine engine = EvalEngine.get();
EvalUtilities util = new EvalUtilities(engine, false);
// evaluate an expression
IExpr result = util.evaluate("D[Sin[x]*Cos[x],x]");
StringBufferWriter buf = new StringBufferWriter();
OutputFormFactory.convert(buf, result);
// print the result in the console
System.out.println(buf.toString());
} catch (SyntaxError e) {
// catch parser errors here
System.out.println(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Where can I find the most interesting JUnit Tests ?In the SystemTestCase.java file. Where are all built-in functions implemented?You can find all implementations of the built-in functions in the package org.matheclipse.core.reflection.system
|
|
|
All contents copyright of the author. ©2007. JAMWiki Version 0.6.0 |
||