org.matheclipse.core.eval.interfaces
Class AbstractFunctionEvaluator
- java.lang.Object
-
- org.matheclipse.core.eval.interfaces.AbstractFunctionEvaluator
-
- All Implemented Interfaces:
- IFunctionEvaluator, IEvaluator
- Direct Known Subclasses:
- AbstractArg1, AbstractArg12, AbstractArg2, AbstractMatrix1Expr, AbstractMatrix1Matrix, AbstractTrigArg1, AddTo, And, Apart, BernoulliB, Boole, BooleanMinimize, Cancel, CartesianProduct, Ceiling, CharacteristicPolynomial, Chop, Coefficient, CoefficientList, Collect, Complement, Complex, CoprimeQ, Curl, D, Default, Derivative, DiagonalMatrix, DigitQ, Dimensions, Discriminant, Distribute, Divergence, Eliminate, Equal, Expand, ExpandAll, Exponent, ExtendedGCD, Extract, Factor, FactorTerms, FindRoot, Fit, Floor, FractionalPart, FromCharacterCode, GeometricMean, Greater, GroebnerBasis, HilbertMatrix, Horner, IdentityMatrix, Inner, IntegerPart, IntegerPartitions, IntegerQ, Integrate, Intersection, IntIntegerQ, IntIntegerQ, IntPolynomialQ, IntPolynomialQ, InverseFunction, JacobiMatrix, Join, KOrderlessPartitions, KPartitions, LetterQ, Level, Limit, LinearProgramming, LinearSolve, LowerCaseQ, LUDecomposition, Map, MapAll, MapThread, MatrixPower, MatrixQ, MatrixRank, Max, Min, MonomialList, Most, Multinomial, NextPrime, NFourierTransform, NIntegrate, NonCommutativeMultiply, NRoots, NSolve, NullSpace, OddQ, Or, Order, OrderedQ, Outer, PadLeft, PadRight, Partition, Permutations, PolynomialExtendedGCD, PolynomialGCD, PolynomialLCM, PolynomialQ, PolynomialQuotientRemainder, PossibleZeroQ, PowerExpand, PowerMod, PrimeQ, RandomInteger, RandomReal, Rational, Rationalize, Resultant, Reverse, RootIntervals, Roots, Round, RowReduce, Rule, RuleDelayed, SameQ, Simplify, SingularValueDecomposition, Solve, Sort, SquareFreeQ, StirlingS2, StringDrop, StringJoin, StringLength, StringTake, Subsets, SyntaxLength, SyntaxQ, Table, Take, Taylor, Thread, Through, ToCharacterCode, Together, ToString, Total, ToUnicode, TrueQ, Tuples, Union, UnsameQ, UpperCaseQ, VandermondeMatrix, Variables, VectorQ
public abstract class AbstractFunctionEvaluator extends java.lang.Object implements IFunctionEvaluator
Abstract interface for built-in Symja functions. ThenumericEval()method delegates to theevaluate()
-
-
Constructor Summary
Constructors Constructor and Description AbstractFunctionEvaluator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidcreateRuleFromMethod(ISymbol symbol, java.lang.String patternString, java.lang.String methodName)Create a rule which invokes the method name in this class instance.abstract IExprevaluate(IAST ast)Symbolic evaluation of a function.static IExpr[]getPeriodicParts(IExpr expr)static IExprgetPureImaginaryPart(IExpr expr)Check ifexpris a pure imaginary number without a real part.IASTgetRuleAST()Get the predefined rules for this function symbol.static booleanisNegativeExpression(IExpr expr)Check if the expression is canonical negative.IExprnumericEval(IAST ast)Numeric evaluation of a function.voidsetUp(ISymbol symbol)Evaluate built-in rules and define Attributes for a function.
-
-
-
Method Detail
-
numericEval
public IExpr numericEval(IAST ast)
Numeric evaluation of a function.ast.get(0)contains the head (i.e. the function symbol) of this abstract syntax tree (AST).ast.get(1)toast.get(n)contains the first to n-th argument of the function.
If necessary use the methods from theValidateclass to check the number or types of arguments in the evaluate method.- Specified by:
numericEvalin interfaceIFunctionEvaluator- Parameters:
ast- the abstract syntax tree (AST) which should be evaluated- Returns:
- the evaluated object or
null, if evaluation isn't possible - See Also:
Validate
-
getRuleAST
public IAST getRuleAST()
Get the predefined rules for this function symbol. If no rules are available returnnull.- Returns:
-
setUp
public void setUp(ISymbol symbol) throws SyntaxError
Evaluate built-in rules and define Attributes for a function.- Specified by:
setUpin interfaceIEvaluator- Parameters:
symbol- the symbol which should be set up- Throws:
SyntaxError
-
evaluate
public abstract IExpr evaluate(IAST ast)
Symbolic evaluation of a function.ast.get(0)contains the head (i.e. the function symbol) of this abstract syntax tree (AST).ast.get(1)toast.get(n)contains the first to n-th argument of the function.
If necessary use the methods from theValidateclass 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 anullvalue without throwing an exception!- Specified by:
evaluatein interfaceIFunctionEvaluator- Parameters:
ast- the abstract syntax tree (AST) which should be evaluated- Returns:
- the evaluated object or
null, if evaluation isn't possible - See Also:
Validate
-
createRuleFromMethod
public void createRuleFromMethod(ISymbol symbol, java.lang.String patternString, java.lang.String methodName)
Create a rule which invokes the method name in this class instance.- Parameters:
symbol-patternString-methodName-
-
isNegativeExpression
public static boolean isNegativeExpression(IExpr expr)
Check if the expression is canonical negative.- Returns:
trueif the first argument is canonical negative
-
getPureImaginaryPart
public static IExpr getPureImaginaryPart(IExpr expr)
Check ifexpris a pure imaginary number without a real part.- Parameters:
expr-- Returns:
null, ifexpris not prue imaginary number.
-
-
DMelt 3.0 © DataMelt by jWork.ORG