public class Equal extends AbstractFunctionEvaluator implements ITernaryComparator<IExpr>
==
operator implementation.ITernaryComparator.COMPARE_RESULT
Constructor and Description |
---|
Equal() |
Modifier and Type | Method and Description |
---|---|
ITernaryComparator.COMPARE_RESULT |
compare(IExpr o0,
IExpr o1)
Return TRUE if the comparison is
true
Return FALSE if the comparison is false
Return UNDEFINED if the comparison is undetermined (i.e. could not be evaluated)
|
static IExpr |
equal(IAST ast) |
static IExpr |
equalNull(IExpr a1,
IExpr a2)
Compare if the first and second argument are equal.
|
IExpr |
evaluate(IAST ast,
EvalEngine engine)
Symbolic evaluation of a function.
|
void |
setUp(ISymbol symbol)
Evaluate built-in rules and define Attributes for a function.
|
protected IExpr |
simplifyCompare(IExpr a1,
IExpr a2,
ISymbol originalHead)
Try to simplify a comparator expression.
|
createRuleFromMethod, getNormalizedNegativeExpression, getNormalizedNegativeExpression, getPeriodicParts, getPureImaginaryPart, getRuleAST, initSerializedRules, isNegativeExpression
numericEval
public static final Equal CONST
protected IExpr simplifyCompare(IExpr a1, IExpr a2, ISymbol originalHead)
3*x > 6
wll be simplified to x> 2
.a1
- left-hand-side of the comparator expressiona2
- right-hand-side of the comparator expressionoriginalHead
- symbol for which the simplification was startednull
if no
simplification was foundpublic IExpr evaluate(IAST ast, EvalEngine engine)
AbstractFunctionEvaluator
ast.get(0)
(or alternatively ast.head()
) contains the
head (i.e. the function symbol) of this abstract syntax tree (AST). 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()
).Validate
class to check the number or types of arguments in the evaluate
method.null
value without throwing an exception!evaluate
in interface IFunctionEvaluator
evaluate
in class AbstractFunctionEvaluator
ast
- the abstract syntax tree (AST) which should be evaluatedengine
- the users current evaluation enginenull
, if evaluation isn't possibleValidate
,
IExpr.head()
,
IAST.arg1()
,
IAST.arg2()
,
IAST.arg3()
public static IExpr equalNull(IExpr a1, IExpr a2)
a1
- first argumenta2
- second argumentF.NIL
or the simplified expression, if equality
couldn't be determined.public ITernaryComparator.COMPARE_RESULT compare(IExpr o0, IExpr o1)
true
false
compare
in interface ITernaryComparator<IExpr>
public void setUp(ISymbol symbol)
AbstractFunctionEvaluator
setUp
in interface IEvaluator
setUp
in class AbstractFunctionEvaluator
symbol
- the symbol which should be set up