public class Greater extends AbstractFunctionEvaluator implements ITernaryComparator<IExpr>
>
operator implementation.ITernaryComparator.COMPARE_RESULT
Constructor and Description |
---|
Greater() |
Modifier and Type | Method and Description |
---|---|
protected IExpr |
checkAssumptions(IExpr arg1,
IExpr arg2)
Check assumptions for the comparison operator.
|
ITernaryComparator.COMPARE_RESULT |
compare(IExpr a0,
IExpr a1)
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)
|
IExpr |
evaluate(IAST ast,
EvalEngine engine)
Symbolic evaluation of a function.
|
ITernaryComparator.COMPARE_RESULT |
prepareCompare(IExpr o0,
IExpr o1) |
void |
setUp(ISymbol symbol)
Evaluate built-in rules and define Attributes for a function.
|
protected IAST |
simplifyCompare(IExpr a1,
IExpr a2)
Try to simplify a comparator expression.
|
protected IAST |
simplifyCompare(IExpr a1,
IExpr a2,
ISymbol originalHead,
ISymbol oppositeHead)
Try to simplify a comparator expression.
|
createRuleFromMethod, getNormalizedNegativeExpression, getNormalizedNegativeExpression, getPeriodicParts, getPureImaginaryPart, getRuleAST, initSerializedRules, isNegativeExpression
numericEval
public static final Greater CONST
protected IAST simplifyCompare(IExpr a1, IExpr a2)
3*x > 6
will be simplified to x > 2
.a1
- left-hand-side of the comparator expressiona2
- right-hand-side of the comparator expressionnull
if no
simplification was foundprotected final IAST simplifyCompare(IExpr a1, IExpr a2, ISymbol originalHead, ISymbol oppositeHead)
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 of the comparator operator for which the simplification
was startedoppositeHead
- opposite of the symbol of the comparator operator for which
the comparison was startedF.NIL
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()
protected IExpr checkAssumptions(IExpr arg1, IExpr arg2)
GreaterEqual, Less, LessEqual
.arg1
- the left-hand-side of the comparisonarg2
- the right-hand-side of the comparisonpublic ITernaryComparator.COMPARE_RESULT prepareCompare(IExpr o0, IExpr o1)
public ITernaryComparator.COMPARE_RESULT compare(IExpr a0, IExpr a1)
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