evaluate
public IExpr evaluate(IAST ast,
EvalEngine engine)
Symbolic evaluation of a function. ast.get(0)
(or alternatively ast.head()
) contains the
head (i.e. the function symbol) of this abstract syntax tree (AST).
From ast.arg1()
to ast.get(n)
the ast
contains the first to n-th argument of the
function (alternatively you get the first to fifth argument with the methods arg1()
, arg2()
,...
arg5()
).
If necessary use the methods from the Validate
class to check the number or types of arguments in the evaluate
method.
Note: if the symbolic evaluation isn't possible or no result is found the evaluate method returns with a
null
value without throwing an exception!
- Specified by:
evaluate
in interface IFunctionEvaluator
- Specified by:
evaluate
in class AbstractCoreFunctionEvaluator
- Parameters:
ast
- the abstract syntax tree (AST) which should be evaluated
engine
- the users current evaluation engine
- Returns:
- the evaluated object or
null
, if evaluation isn't possible
- See Also:
Validate
,
IExpr.head()
,
IAST.arg1()
,
IAST.arg2()
,
IAST.arg3()