org.matheclipse.core.interfaces
Interface IExpr
-
- All Superinterfaces:
- AbelianGroupElem<IExpr>, java.lang.Comparable<IExpr>, Element<IExpr>, MonoidElem<IExpr>, RingElem<IExpr>, java.io.Serializable
- All Known Subinterfaces:
- IAST, IBigNumber, IComplex, IComplexNum, IFraction, IInteger, INum, INumber, IPattern, IPatternSequence, IRational, ISignedNumber, IStringX, ISymbol
- All Known Implementing Classes:
- AST, ComplexNum, ComplexSym, ExprImpl, FractionSym, IntegerSym, MethodSymbol, Num, Pattern, PatternSequence, StringX, Symbol
public interface IExpr extends java.lang.Comparable<IExpr>, RingElem<IExpr>, java.io.Serializable
(I)nterface for a mathematical (Expr)ession
-
-
Field Summary
Fields Modifier and Type Field and Description static intASTIDstatic intCOMPLEXIDstatic intDOUBLECOMPLEXIDstatic intDOUBLEIDstatic intFRACTIONIDstatic intINTEGERIDstatic intMETHODSYMBOLIDstatic intPATTERNIDstatic intSTRINGIDstatic intSYMBOLID
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method and Description <T> Taccept(IVisitor<T> visitor)Accept a visitor with return type Tbooleanaccept(IVisitorBoolean visitor)Accept a visitor with return typebooleanintaccept(IVisitorInt visitor)Accept a visitor with return typeintIExprand(IExpr that)IExprapply(IExpr... leaves)IExprapply(java.util.List<? extends IExpr> leaves)java.lang.ObjectasType(java.lang.Class clazz)intcompareTo(IExpr obj)Compares this expression with the specified expression for order.IExprevaluate(EvalEngine engine)Evaluate an expressionjava.lang.StringfullFormString()Return the FullForm of this expressionIExprgetAt(int index)Get the element at the specifiedindexif this object is of typeIAST.IExprhead()If this object is an instance ofIASTget the first element (offset 0) of theIASTlist (i.e.inthierarchy()A unique integer ID for the implementation of this expressionjava.lang.StringinternalFormString(boolean symbolsAsFactoryMethod, int depth)Return the internal Java form of this expression.IExprinverse()Returns the multiplicative inverse of this object.booleanisAnd()Test if this expression is the functionAnd[<arg>,...]booleanisArcCos()Test if this expression is the functionArcCos[<arg>]booleanisArcCosh()Test if this expression is the functionArcCosh[<arg>]booleanisArcSin()Test if this expression is the functionArcSin[<arg>]booleanisArcSinh()Test if this expression is the functionArcSinh[<arg>]booleanisArcTan()Test if this expression is the functionArcTan[<arg>]booleanisArcTanh()Test if this expression is the functionArcTanh[<arg>]booleanisAST()Test if this expression is an AST list, which contains a header element (i.e.booleanisAST(IExpr header)Test if this expression is an AST list, which contains the given header element at index position0and some optional argument elements at the index positions1..(size()-1).booleanisAST(IExpr header, int length)Test if this expression is an AST list, which contains the given header element at index position0and optional argument elements at the index positions1..(length-1).booleanisAST(IExpr header, int length, IExpr... args)Test if this expression is an AST list, which contains the given header element at index position0and optional argument elements at the index positions1..(length-1).booleanisAST(java.lang.String symbol)Test if this expression is an AST list, where the string representation of the header element at index position0equals the givensymboland some optional argument elements at the index positions1..(size()-1).booleanisAST(java.lang.String symbol, int length)Test if this expression is an AST list, where the string representation of the header element at index position0equals the givensymboland some optional argument elements at the index positions1..(length-1).booleanisASTSizeGE(IExpr header, int length)Test if this expression is an AST (i.e.booleanisAtom()Test if this expression is an atomic expression (i.e.booleanisComplex()Test if this expression is a symbolic complex numberbooleanisComplexInfinity()Test if this expression is representing ComplexInfinity (i.e.booleanisComplexNumeric()Test if this expression is a numeric complex numberbooleanisCondition()Test if this expression is the Condition functionCondition[<arg1>, <arg2>]booleanisConstant()Test if this expression is a symbol with attributeConstant.booleanisCos()Test if this expression is the functionCos[<arg>]booleanisCosh()Test if this expression is the functionCosh[<arg>]booleanisDirectedInfinity()Test if this expression is representing a DirectedInfinity (i.e.booleanisFalse()Test if this expression equals the symbol "False"booleanisFlatAST()Test if this expression is an AST list, which contains a header element (i.e.booleanisFraction()Test if this expression is a fractional number, but no integer number.booleanisFree(IExpr pattern, boolean heads)Returnstrue, if all of the elements in the subexpressions or the expression itself, did not match the given pattern.booleanisFree(Predicate<IExpr> predicate, boolean heads)Returnstrue, if all of the elements in the subexpressions or the expression itself, did not satisfy the given unary predicate.booleanisFunction()Test if this expression is aFuntion[ arg1 ]expression with at least 1 argument.booleanisGEOrdered(IExpr obj)Compares this expression with the specified expression for order.booleanisGTOrdered(IExpr expr)Compares this expression with the specified expression for order.booleanisInfinity()Test if this expression is representingInfinity(i.e.booleanisInteger()Test if this expression is a integer numberbooleanisLEOrdered(IExpr obj)Compares this expression with the specified expression for order.booleanisList()Test if this expression is a list (i.e.booleanisListOfLists()Test if this expression is a list of listsbooleanisLog()Test if this expression is the functionLog[<arg>]booleanisLTOrdered(IExpr expr)Compares this expression with the specified expression for order.int[]isMatrix()Test if this expression is a matrix and return the dimensions as array [row-dimension, column-dimension].booleanisMember(IExpr pattern, boolean heads)Returnstrue, if at least one of the elements in the subexpressions or the expression itself, match the given pattern.booleanisMember(Predicate<IExpr> predicate, boolean heads)Returnstrue, if at least one of the elements in the subexpressions or the expression itself, satisfy the given unary predicate.booleanisMinusOne()Test if this expression equals-1in symbolic or numeric mode.booleanisModule()Test if this expression is the Module functionModule[<arg1>, <arg2>]booleanisNegative()Test if this object is a negative signed number.booleanisNegativeInfinity()Test if this expression is representing-Infinity(i.e.booleanisNot()Test if this expression is the functionNot[<arg>]booleanisNumber()Test if this expression is a numberbooleanisNumEqualInteger(IInteger ii)Check if this expression equals anIIntegervalue.booleanisNumeric()Test if this expression is a numeric number (i.e.booleanisNumericFunction()Test if this expression is a numeric function (i.e.booleanisNumIntValue()Check if this expression represents anintvalue.booleanisOne()Test if this expression equals1in symbolic or numeric mode.booleanisOr()Test if this expression is the functionOr[<arg>,...]booleanisOrderlessAST()Test if this expression is an AST list, which contains a header element (i.e.booleanisPattern()Test if this expression is a pattern objectbooleanisPatternExpr()Test if this expression or a subexpression is a pattern object.booleanisPatternSequence()Test if this expression is a pattern sequence objectbooleanisPlus()Test if this expression is the addition functionPlus[<arg1>, <arg2>, ...]booleanisPositive()Test if this object is a positive signed number.booleanisPower()Test if this expression is the functionPower[<arg1>, <arg2>]booleanisRational()Test if this expression is a rational number, i.e.booleanisRealFunction()Test if this expression is a real (non-complex) value (i.e.booleanisRuleAST()Test if this expression is of the formRule[<arg1>, <arg2>]orRuleDelayed[<arg1>, <arg2>].booleanisSame(IExpr expression)Test if this expression equals the given expression.booleanisSame(IExpr expression, double epsilon)Test if this expression equals the given expression.booleanisSequence()Test if this expression is a sequence (i.e.booleanisSignedNumber()Test if this expression is a signed numberbooleanisSin()Test if this expression is the functionSin[<arg>]booleanisSinh()Test if this expression is the functionSinh[<arg>]booleanisSlot()Test if this expression is the functionSlot[<integer-value>]booleanisSlotSequence()Test if this expression is the functionSlotSequence[<integer-value>]booleanisSymbol()Test if this expression is a symbolbooleanisTan()Test if this expression is the functionTAn[<arg>]booleanisTanh()Test if this expression is the functionTanh[<arg>]booleanisTimes()Test if this expression is the multiplication functionTimes[<arg1>, <arg2>, ...]booleanisTrue()Test if this expression equals the symbol "True"booleanisValue()Returnstrue, if this symbol or ast expression is bound to a value (i.e.intisVector()Test if this expression is a vector and return the dimension of the vector.booleanisZero()Test if this expression equals0in symbolic or numeric mode.java.util.List<IExpr>leaves()IExprminus(IExpr that)IExprmod(IExpr that)IExprmultiply(IExpr that)Multiply this with S.IExprnegative()IExpror(IExpr that)IExprplus(IExpr that)IExprpower(IExpr that)IExprpower(java.lang.Integer n)IExprreplaceAll(Function<IExpr,IExpr> function)Replace all (sub-) expressions with the given unary function.IExprreplaceAll(IAST astRules)Replace all (sub-) expressions with the given rule set.IExprreplacePart(IAST astRules)IExprreplaceRepeated(Function<IExpr,IExpr> function)Repeatedly replace all (sub-) expressions with the given unary function.IExprreplaceRepeated(IAST astRules)Repeatedly replace all (sub-) expressions with the given rule set.IExprreplaceSlots(IAST astSlots)intsignum()Deprecated.IExprtimes(IExpr that)Returns the product of this object with the one specified.ISymboltopHead()IExprvariables2Slots(java.util.Map<IExpr,IExpr> map, java.util.List<IExpr> variableList)Convert the variables (i.e.-
Methods inherited from interface edu.jas.structure.AbelianGroupElem
abs, isZERO, negate, subtract, sum
-
Methods inherited from interface edu.jas.structure.MonoidElem
divide, isONE, isUnit, remainder
-
-
-
-
Field Detail
-
ASTID
static final int ASTID
- See Also:
- Constant Field Values
-
COMPLEXID
static final int COMPLEXID
- See Also:
- Constant Field Values
-
DOUBLECOMPLEXID
static final int DOUBLECOMPLEXID
- See Also:
- Constant Field Values
-
DOUBLEID
static final int DOUBLEID
- See Also:
- Constant Field Values
-
FRACTIONID
static final int FRACTIONID
- See Also:
- Constant Field Values
-
INTEGERID
static final int INTEGERID
- See Also:
- Constant Field Values
-
METHODSYMBOLID
static final int METHODSYMBOLID
- See Also:
- Constant Field Values
-
PATTERNID
static final int PATTERNID
- See Also:
- Constant Field Values
-
STRINGID
static final int STRINGID
- See Also:
- Constant Field Values
-
SYMBOLID
static final int SYMBOLID
- See Also:
- Constant Field Values
-
-
Method Detail
-
accept
<T> T accept(IVisitor<T> visitor)
Accept a visitor with return type T
-
accept
boolean accept(IVisitorBoolean visitor)
Accept a visitor with return typeboolean
-
accept
int accept(IVisitorInt visitor)
Accept a visitor with return typeint- Parameters:
visitor-- Returns:
-
apply
IExpr apply(IExpr... leaves)
- Parameters:
leaves-- Returns:
- an IExpr instance with the current expression as head(), and leaves as leaves().
-
apply
IExpr apply(java.util.List<? extends IExpr> leaves)
- Parameters:
leaves-- Returns:
- an IExpr instance with the current expression as head(), and leaves as leaves().
-
asType
java.lang.Object asType(java.lang.Class clazz)
-
compareTo
int compareTo(IExpr obj)
Compares this expression with the specified expression for order. Returns a negative integer, zero, or a positive integer as this expression is canonical less than, equal to, or greater than the specified expression.
-
evaluate
IExpr evaluate(EvalEngine engine)
Evaluate an expression- Parameters:
engine- the evaluation engine- Returns:
- the evaluated Object or
nullif the evaluation is not possible (i.e. the evaluation doesn't change the object).
-
fullFormString
java.lang.String fullFormString()
Return the FullForm of this expression
-
getAt
IExpr getAt(int index)
Get the element at the specifiedindexif this object is of typeIAST.- Parameters:
index-- Returns:
-
head
IExpr head()
If this object is an instance ofIASTget the first element (offset 0) of theIASTlist (i.e. get(0) ).- Returns:
- the head of the expression, which must not be null.
-
hierarchy
int hierarchy()
A unique integer ID for the implementation of this expression- Returns:
- a unique integer id for the implementation of this expression
-
internalFormString
java.lang.String internalFormString(boolean symbolsAsFactoryMethod, int depth)Return the internal Java form of this expression.- Parameters:
symbolsAsFactoryMethod- iftrueuse theF.symbol()method, otherwise print the symbol name.depth- the recursion depth of this call.0indicates "recurse without a limit".
-
inverse
IExpr inverse()
Returns the multiplicative inverse of this object. It is the object such asthis.times(this.inverse()) == ONE, withONEbeing the multiplicative identity.- Specified by:
inversein interfaceMonoidElem<IExpr>- Returns:
ONE / this.
-
isAnd
boolean isAnd()
Test if this expression is the functionAnd[<arg>,...]
-
isArcCos
boolean isArcCos()
Test if this expression is the functionArcCos[<arg>]
-
isArcCosh
boolean isArcCosh()
Test if this expression is the functionArcCosh[<arg>]
-
isArcSin
boolean isArcSin()
Test if this expression is the functionArcSin[<arg>]
-
isArcSinh
boolean isArcSinh()
Test if this expression is the functionArcSinh[<arg>]
-
isArcTan
boolean isArcTan()
Test if this expression is the functionArcTan[<arg>]
-
isArcTanh
boolean isArcTanh()
Test if this expression is the functionArcTanh[<arg>]
-
isAST
boolean isAST()
Test if this expression is an AST list, which contains a header element (i.e. the function name) at index position0and some optional argument elements at the index positions1..n. Therefore this expression is no atomic expression.- See Also:
isAtom()
-
isOrderlessAST
boolean isOrderlessAST()
Test if this expression is an AST list, which contains a header element (i.e. a function symbol like for examplePlus or Times) with attributeOrderlessat index position0and some optional argument elements at the index positions1..n. Examples forOrderlessfunctions arePlus[] or Times[]. Therefore this expression is no atomic expression.- See Also:
isAtom()
-
isFlatAST
boolean isFlatAST()
Test if this expression is an AST list, which contains a header element (i.e. a function symbol like for exampleDot, Plus or Times) with attributeFlatat index position0and some optional argument elements at the index positions1..(size()-1). Examples forFlatfunctions areDot[], Plus[] or Times[]. Therefore this expression is no atomic expression.- See Also:
isAtom()
-
isAST
boolean isAST(IExpr header)
Test if this expression is an AST list, which contains the given header element at index position0and some optional argument elements at the index positions1..(size()-1). Therefore this expression is not an atomic expression.- See Also:
isAtom()
-
isAST
boolean isAST(IExpr header, int length)
Test if this expression is an AST list, which contains the given header element at index position0and optional argument elements at the index positions1..(length-1). Therefore this expression is not an atomic expression.- See Also:
isAtom()
-
isAST
boolean isAST(IExpr header, int length, IExpr... args)
Test if this expression is an AST list, which contains the given header element at index position0and optional argument elements at the index positions1..(length-1). Therefore this expression is not an atomic expression.- Parameters:
args- the arguments of this AST which should be tested, if they are equal, anullvalue argument skips the equals chack.- See Also:
isAtom()
-
isAST
boolean isAST(java.lang.String symbol)
Test if this expression is an AST list, where the string representation of the header element at index position0equals the givensymboland some optional argument elements at the index positions1..(size()-1). Therefore this expression is no atomic expression. Example:isAST("Sin")givestrueforSin[Pi/2].- See Also:
isAtom()
-
isAST
boolean isAST(java.lang.String symbol, int length)Test if this expression is an AST list, where the string representation of the header element at index position0equals the givensymboland some optional argument elements at the index positions1..(length-1). Therefore this expression is no atomic expression. Example:isAST("Sin", 2)givestrueforSin[0].- See Also:
isAtom()
-
isASTSizeGE
boolean isASTSizeGE(IExpr header, int length)
Test if this expression is an AST (i.e. no atomic expression) with the given head expression and size of elements greater equal than the AST#size() Test if this expression is an AST list, which contains the given header element at index position0and optional argument elements at the index positions1..n.nmust be greater equal than the givenlength. Therefore this expression is no atomic expression.- See Also:
isAtom()
-
isAtom
boolean isAtom()
Test if this expression is an atomic expression (i.e. no AST expression)
-
isComplex
boolean isComplex()
Test if this expression is a symbolic complex number
-
isComplexNumeric
boolean isComplexNumeric()
Test if this expression is a numeric complex number
-
isConstant
boolean isConstant()
Test if this expression is a symbol with attributeConstant. Therefore numbers returnfalsefor this method!- See Also:
isRealFunction(),isNumericFunction()
-
isComplexInfinity
boolean isComplexInfinity()
Test if this expression is representing ComplexInfinity (i.e. DirectedInfinity[])
-
isDirectedInfinity
boolean isDirectedInfinity()
Test if this expression is representing a DirectedInfinity (i.e.Infinity->DirectedInfinity[1],-Infinity->DirectedInfinity[-1],ComplexInfinity->DirectedInfinity[])
-
isInfinity
boolean isInfinity()
Test if this expression is representingInfinity(i.e.Infinity->DirectedInfinity[1])
-
isNegative
boolean isNegative()
Test if this object is a negative signed number.- Returns:
true, ifthis < 0;falsein all other case.
-
isNegativeInfinity
boolean isNegativeInfinity()
Test if this expression is representing-Infinity(i.e.-Infinity->DirectedInfinity[-1])
-
isCos
boolean isCos()
Test if this expression is the functionCos[<arg>]
-
isCosh
boolean isCosh()
Test if this expression is the functionCosh[<arg>]
-
isFalse
boolean isFalse()
Test if this expression equals the symbol "False"
-
isFraction
boolean isFraction()
Test if this expression is a fractional number, but no integer number.
-
isFree
boolean isFree(IExpr pattern, boolean heads)
Returnstrue, if all of the elements in the subexpressions or the expression itself, did not match the given pattern.- Parameters:
pattern- a pattern-matching expressionheads- if set tofalse, only the arguments of an IAST should be tested and not theHead[]element.
-
isFree
boolean isFree(Predicate<IExpr> predicate, boolean heads)
Returnstrue, if all of the elements in the subexpressions or the expression itself, did not satisfy the given unary predicate.- Parameters:
predicate- a unary predicateheads- if set tofalse, only the arguments of an IAST should be tested and not theHead[]element.
-
isMember
boolean isMember(IExpr pattern, boolean heads)
Returnstrue, if at least one of the elements in the subexpressions or the expression itself, match the given pattern.- Parameters:
pattern- a pattern-matching expressionheads- if set tofalse, only the arguments of an IAST should be tested and not theHead[]element.
-
isMember
boolean isMember(Predicate<IExpr> predicate, boolean heads)
Returnstrue, if at least one of the elements in the subexpressions or the expression itself, satisfy the given unary predicate.- Parameters:
predicate- a unary predicateheads- if set tofalse, only the arguments of an IAST should be tested and not theHead[]element.
-
isFunction
boolean isFunction()
Test if this expression is aFuntion[ arg1 ]expression with at least 1 argument.
-
isGEOrdered
boolean isGEOrdered(IExpr obj)
Compares this expression with the specified expression for order. Returns true if this expression is canonical greater than or equal to the specified expression (<= relation).- Parameters:
expr- an expression to compare with- Returns:
- true if this expression is canonical greater than or equal to the specified expression.
-
isGTOrdered
boolean isGTOrdered(IExpr expr)
Compares this expression with the specified expression for order. Returns true if this expression is canonical greater than the specified expression (< relation).- Parameters:
expr- an expression to compare with- Returns:
- true if this expression is canonical greater than the specified expression.
-
isInteger
boolean isInteger()
Test if this expression is a integer number
-
isNumIntValue
boolean isNumIntValue()
Check if this expression represents anintvalue. The value of anINumobject can be anintvalue.- Returns:
-
isNumEqualInteger
boolean isNumEqualInteger(IInteger ii) throws java.lang.ArithmeticException
Check if this expression equals anIIntegervalue. The value of anINumor the value of anIIntegerobject can be anIIntegervalue.- Returns:
- Throws:
java.lang.ArithmeticException
-
isLEOrdered
boolean isLEOrdered(IExpr obj)
Compares this expression with the specified expression for order. Returns true if this expression is canonical less than or equal to the specified expression (<= relation).- Parameters:
expr- an expression to compare with- Returns:
- true if this expression is canonical less than or equal to the specified expression.
-
isList
boolean isList()
Test if this expression is a list (i.e. an AST with head List)
-
isSequence
boolean isSequence()
Test if this expression is a sequence (i.e. an AST with head Sequence)
-
isListOfLists
boolean isListOfLists()
Test if this expression is a list of lists- See Also:
isList(),isMatrix(),isVector()
-
isLog
boolean isLog()
Test if this expression is the functionLog[<arg>]
-
isLTOrdered
boolean isLTOrdered(IExpr expr)
Compares this expression with the specified expression for order. Returns true if this expression is canonical less than the specified expression (< relation).- Parameters:
expr- an expression to compare with- Returns:
- true if this expression is canonical less than the specified expression.
-
isMatrix
int[] isMatrix()
Test if this expression is a matrix and return the dimensions as array [row-dimension, column-dimension]. This expression is only a matrix, if all elements are lists with the headerListand have the same size.- Returns:
nullif the expression is not a matrix
-
isNot
boolean isNot()
Test if this expression is the functionNot[<arg>]
-
isNumber
boolean isNumber()
Test if this expression is a number
-
isOne
boolean isOne()
Test if this expression equals1in symbolic or numeric mode.
-
isOr
boolean isOr()
Test if this expression is the functionOr[<arg>,...]
-
isMinusOne
boolean isMinusOne()
Test if this expression equals-1in symbolic or numeric mode.
-
isPlus
boolean isPlus()
Test if this expression is the addition functionPlus[<arg1>, <arg2>, ...]
-
isPattern
boolean isPattern()
Test if this expression is a pattern object
-
isPatternExpr
boolean isPatternExpr()
Test if this expression or a subexpression is a pattern object. Used in pattern-matching; checks flags inIASTwith flagIAST.CONTAINS_PATTERN_EXPR.
-
isPatternSequence
boolean isPatternSequence()
Test if this expression is a pattern sequence object
-
isPositive
boolean isPositive()
Test if this object is a positive signed number.- Returns:
true, ifthis > 0;falsein all other case.
-
isCondition
boolean isCondition()
Test if this expression is the Condition functionCondition[<arg1>, <arg2>]
-
isModule
boolean isModule()
Test if this expression is the Module functionModule[<arg1>, <arg2>]
-
isPower
boolean isPower()
Test if this expression is the functionPower[<arg1>, <arg2>]
-
isRational
boolean isRational()
Test if this expression is a rational number, i.e. integer or fraction number.
-
isRuleAST
boolean isRuleAST()
Test if this expression is of the formRule[<arg1>, <arg2>]orRuleDelayed[<arg1>, <arg2>].
-
isSame
boolean isSame(IExpr expression)
Test if this expression equals the given expression. If the compared expressions are of the same numeric type, they are equal to a given EPSILON
-
isSame
boolean isSame(IExpr expression, double epsilon)
Test if this expression equals the given expression. If the compared expressions are of the same numeric type, they are equal to a given EPSILON
-
isSignedNumber
boolean isSignedNumber()
Test if this expression is a signed number
-
isNumeric
boolean isNumeric()
Test if this expression is a numeric number (i.e. of typeINumorIComplexNum.
-
isNumericFunction
boolean isNumericFunction()
Test if this expression is a numeric function (i.e. a number, a symbolic constant or a function (with attribute NumericFunction) where all arguments are also "numeric functions")- Returns:
true, if the given expression is a numeric function or value.- See Also:
isRealFunction()
-
isRealFunction
boolean isRealFunction()
Test if this expression is a real (non-complex) value (i.e. a real number or a real symbolic constant or aPlus, Timesexpression with only real values)- Returns:
true, if the given expression is a real (non-complex) value.- See Also:
isConstant(),isNumericFunction()
-
isSin
boolean isSin()
Test if this expression is the functionSin[<arg>]
-
isSinh
boolean isSinh()
Test if this expression is the functionSinh[<arg>]
-
isSlot
boolean isSlot()
Test if this expression is the functionSlot[<integer-value>]
-
isSlotSequence
boolean isSlotSequence()
Test if this expression is the functionSlotSequence[<integer-value>]
-
isSymbol
boolean isSymbol()
Test if this expression is a symbol
-
isTan
boolean isTan()
Test if this expression is the functionTAn[<arg>]
-
isTanh
boolean isTanh()
Test if this expression is the functionTanh[<arg>]
-
isTimes
boolean isTimes()
Test if this expression is the multiplication functionTimes[<arg1>, <arg2>, ...]
-
isTrue
boolean isTrue()
Test if this expression equals the symbol "True"
-
isValue
boolean isValue()
Returnstrue, if this symbol or ast expression is bound to a value (i.e. the evaluation returns an assigned value).
-
isVector
int isVector()
Test if this expression is a vector and return the dimension of the vector. This expression is only a vector, if the expression is aList(...)and no element is itself aList(...).- Returns:
-1if the expression is no vector orsize()-1of the corresponding IAST.
-
isZero
boolean isZero()
Test if this expression equals0in symbolic or numeric mode.
-
leaves
java.util.List<IExpr> leaves()
- Returns:
- a list of the the leaf expressions. Instances of ExprImpl should return null, while any other expression may not return null (but can return an empty list).
-
multiply
IExpr multiply(IExpr that)
Description copied from interface:MonoidElemMultiply this with S.- Specified by:
multiplyin interfaceMonoidElem<IExpr>- Returns:
- this * S.
-
negative
IExpr negative()
-
power
IExpr power(java.lang.Integer n)
-
replaceAll
@Nullable IExpr replaceAll(Function<IExpr,IExpr> function)
Replace all (sub-) expressions with the given unary function. If no substitution matches, the method returnsnull.- Parameters:
function- if the unary functionsapply()method returnsnullthe expression isn't substituted.- Returns:
nullif no substitution of a (sub-)expression was possible.
-
replaceAll
@Nullable IExpr replaceAll(IAST astRules)
Replace all (sub-) expressions with the given rule set. If no substitution matches, the method returnsnull.- Parameters:
astRules- rules of the formx->yor{a->b, c->d}; the left-hand-side of the rule can contain pattern objects.- Returns:
nullif no substitution of a (sub-)expression was possible.
-
replaceRepeated
IExpr replaceRepeated(Function<IExpr,IExpr> function)
Repeatedly replace all (sub-) expressions with the given unary function. If no substitution matches, the method returnsthis.- Parameters:
function- if the unary functionsapply()method returnsnullthe expression isn't substituted.- Returns:
thisif no substitution of a (sub-)expression was possible.
-
replaceRepeated
IExpr replaceRepeated(IAST astRules)
Repeatedly replace all (sub-) expressions with the given rule set. If no substitution matches, the method returnsthis.- Parameters:
astRules- rules of the formx->yor{a->b, c->d}; the left-hand-side of the rule can contain pattern objects.- Returns:
thisif no substitution of a (sub-)expression was possible.
-
signum
@Deprecated int signum()
Deprecated.Signum functionality is used in JAS toString() method, don't use it as math signum function.- Specified by:
signumin interfaceAbelianGroupElem<IExpr>- Returns:
- the sign of this.
-
times
IExpr times(IExpr that)
Returns the product of this object with the one specified.- Parameters:
that- the object multiplier.- Returns:
this ยท that.
-
topHead
ISymbol topHead()
- Returns:
- the 'highest level' head of the expression, before Symbol, Integer, Real or String. for example while the head of a[b][c] is a[b], the top head is a.
-
variables2Slots
IExpr variables2Slots(java.util.Map<IExpr,IExpr> map, java.util.List<IExpr> variableList)
Convert the variables (i.e. ISymbol's with lower case character in the 0-th position of their name) in this expression into Slot[] s.- Returns:
nullif the expression contains a variable with a '$' character in the 0-th position of its name and the math engine runs in server mode.
-
-
DMelt 3.0 © DataMelt by jWork.ORG