Package com.singularsys.extensions.xjep
Class XFunctionTable
java.lang.Object
com.singularsys.jep.FunctionTable
com.singularsys.jep.standard.StandardFunctionTable
com.singularsys.extensions.xjep.XFunctionTable
- All Implemented Interfaces:
JepComponent,Serializable
Add the following functions to the standard function table:
clean(expr)- clean an expression.eqn(expr)- extract the equation from an expression.eval(expr)- evaluate an expression,rewrite(expr)- rewrite an expression using a rewrite rulescompare(expr1,expr2)- compare two expressions symbolicallysymequals(expr1,expr2)- check if two expressions are symbolically equalexpand(expr)- expand an expressionsimplify(expr)- simplify an expression without expansioncoeffs(expr,var)- return the coefficients of an expression in a variable
rand functions uses DirtyRandom
to prevents cleaning by ExpressionCleaner.
Name of the functions are read from the resource bundle, so they can be changed by providing a custom resource bundle.
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.FunctionTable
table -
Constructor Summary
ConstructorsModifierConstructorDescriptionXFunctionTable(FunctionTable root) Decorator constructor, replaces instances ofRandombyDirtyRandom.protected -
Method Summary
Modifier and TypeMethodDescriptionprotected voidReturns a new shallow copy of this function table.Methods inherited from class com.singularsys.jep.FunctionTable
addFunction, addFunctionIfSet, clear, containsKey, containsValue, copyFunctionsFrom, entrySet, getFunction, getLightWeightInstance, init, isEmpty, keySet, remove, size, threadSafeMapCopy, toString, values
-
Constructor Details
-
XFunctionTable
public XFunctionTable() -
XFunctionTable
Decorator constructor, replaces instances ofRandombyDirtyRandom. and instances ofThreadSafeRandombyDirtyThreadSafeRandom. If neither is defined adds arand()random function usingDirtyRandom. -
XFunctionTable
-
-
Method Details
-
shallowCopy
Description copied from class:FunctionTableReturns a new shallow copy of this function table. Calls theFunctionTable.threadSafeMapCopy()method to ensure the table is safe to use a separate thread. All subclasses should override this method to create a function table of the matching type. A typical implementation would be@Override public FunctionTable shallowCopy() { Map<String,PostfixMathCommandI> newMap = this.threadSafeMapCopy(); return new myFunctionTable(newMap); }using theFunctionTable.threadSafeMapCopy()method to return a copy of the map of functions and a constructor taking this map which uses theFunctionTable(Map)constructor.- Overrides:
shallowCopyin classStandardFunctionTable- Returns:
- a new shallow copy of this function table
-
addXFunctions
protected void addXFunctions()
-