Thursday October 23, 2008 Started support for Cream in MathEclipse
Thanks to Filippo Carone it's now possible to add new functions to MathEclipse through the Eclipse plugin mechanism.
To test the plugin mechanism, I added a simple example plugin to CVS which uses the CREAM library:
A function call like:
Cream[{x>=0,y>=0,x+y==7,2*x+4*y==20},{x,y}] should give:
{x->4,y->3}
An external Eclipse plugin must add a dependency on org.matheclipse.eval and
then add this extension point in the plugin.xml
<extension
point="org.matheclipse.eval.namespace">
<stringNamespace
package="org.matheclipse.cream.functions"></stringNamespace>
</extension>
where the Java package (org.matheclipse.cream.functions) is the place where new MathEclipse functions must be implemented:
package org.matheclipse.cream.functions;
...
public class Cream implements IFunctionEvaluator {
public Cream() {
}
public IExpr evaluate(final IAST function) {
...
}
public IExpr numericEval(final IAST function) {
// called in numeric mode
return evaluate(function);
}
public void setUp(final ISymbol symbol) {
}
}
It' also important to export the package in the /org.matheclipse.cream/META-INF/MANIFEST.MF:
... Export-Package: org.matheclipse.cream.functions
See the CVS here:
Posted by axelclk ( Oct 23 2008, 08:51:27 PM CEST ) Permalink Comments [0]