org.matheclipse.core.expression
Class ExprImpl
- java.lang.Object
-
- org.matheclipse.core.expression.ExprImpl
-
- All Implemented Interfaces:
- AbelianGroupElem<IExpr>, Element<IExpr>, MonoidElem<IExpr>, RingElem<IExpr>, java.io.Serializable, java.lang.Comparable<IExpr>, IExpr
- Direct Known Subclasses:
- ComplexNum, ComplexSym, FractionSym, IntegerSym, Num, Pattern, PatternSequence, StringX, Symbol
public abstract class ExprImpl extends java.lang.Object implements IExpr
Abstract base class for atomic expression objects.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.matheclipse.core.interfaces.IExpr
ASTID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID
-
-
Constructor Summary
Constructors Constructor and Description ExprImpl()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description IExprabs()Absolute value of this.IExprand(IExpr that)IExprapply(IExpr... leaves)IExprapply(java.util.List<? extends IExpr> leaves)java.lang.ObjectasType(java.lang.Class clazz)IExprcopy()Clone this Element.IExprdivide(IExpr that)Divide this by S.IExpr[]egcd(IExpr b)Extended greatest common divisor.IExprevaluate(EvalEngine engine)Evaluate an expressionElemFactory<IExpr>factory()Get the corresponding element factory.java.lang.StringfullFormString()Return the FullForm of this expressionIExprgcd(IExpr b)Greatest common divisor.IExprgetAt(int index)Get the element at the specifiedindexif this object is of typeIAST.abstract ISymbolhead()If this object is an instance ofIASTget the first element (offset 0) of theIASTlist (i.e.java.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 sz)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 obj)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 obj)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.booleanisONE()Test if this is one.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"booleanisUnit()Test if this is a unit.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.booleanisZERO()Test if this is zero.java.util.List<IExpr>leaves()IExprminus(IExpr that)IExprmod(IExpr that)IExprmultiply(IExpr that)Additional multiply method which works like times to fulfill groovy's method signatureIExprnegate()Negate this.IExprnegative()Additional negative method, which works like opposite to fulfill groovy's method signatureIExpropposite()IExpror(IExpr that)IExprplus(IExpr that)IExprpower(IExpr that)IExprpower(java.lang.Integer n)IExprremainder(IExpr S)Remainder after division of this by S.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.static IExprreplaceRepeated(IExpr expr, VisitorReplaceAll visitor)IExprreplaceSlots(IAST astSlots)intsignum()Deprecated.IExprsubtract(IExpr that)Subtract S from this.IExprsum(IExpr that)Sum of this and S.IExprtimes(IExpr that)Returns the product of this object with the one specified.ISymboltopHead()java.lang.StringtoScript()Get a scripting compatible string representation.java.lang.StringtoScriptFactory()Get a scripting compatible string representation of the factory.IExprvariables2Slots(java.util.Map<IExpr,IExpr> map, java.util.List<IExpr> variableList)Convert the variables (i.e.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
opposite
public IExpr opposite()
-
negative
public final IExpr negative()
Additional negative method, which works like opposite to fulfill groovy's method signature
-
inverse
public IExpr inverse()
Description copied from interface:IExprReturns 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>- Specified by:
inversein interfaceIExpr- Returns:
ONE / this.
-
times
public IExpr times(IExpr that)
Description copied from interface:IExprReturns the product of this object with the one specified.
-
multiply
public final IExpr multiply(IExpr that)
Additional multiply method which works like times to fulfill groovy's method signature- Specified by:
multiplyin interfaceMonoidElem<IExpr>- Specified by:
multiplyin interfaceIExpr- Parameters:
that-- Returns:
-
getAt
public IExpr getAt(int index)
Description copied from interface:IExprGet the element at the specifiedindexif this object is of typeIAST.
-
asType
public java.lang.Object asType(java.lang.Class clazz)
-
head
public abstract ISymbol head()
Description copied from interface:IExprIf this object is an instance ofIASTget the first element (offset 0) of theIASTlist (i.e. get(0) ).
-
topHead
public ISymbol topHead()
-
isConstant
public boolean isConstant()
Test if this expression is a symbol with attributeConstant. Therefore numbers returnfalsefor this method!- Specified by:
isConstantin interfaceIExpr- See Also:
IExpr.isRealFunction(),IExpr.isNumericFunction()
-
isComplexInfinity
public boolean isComplexInfinity()
Test if this expression is representing ComplexInfinity (i.e. DirectedInfinity[])- Specified by:
isComplexInfinityin interfaceIExpr
-
isDirectedInfinity
public boolean isDirectedInfinity()
Test if this expression is representing a DirectedInfinity (i.e.Infinity->DirectedInfinity[1],-Infinity->DirectedInfinity[-1],ComplexInfinity->DirectedInfinity[])- Specified by:
isDirectedInfinityin interfaceIExpr
-
isInfinity
public boolean isInfinity()
Test if this expression is representingInfinity(i.e.Infinity->DirectedInfinity[1])- Specified by:
isInfinityin interfaceIExpr
-
isNegative
public boolean isNegative()
Test if this object is a negative signed number.- Specified by:
isNegativein interfaceIExpr- Returns:
true, ifthis < 0;falsein all other case.
-
isNegativeInfinity
public boolean isNegativeInfinity()
Test if this expression is representing-Infinity(i.e.-Infinity->DirectedInfinity[-1])- Specified by:
isNegativeInfinityin interfaceIExpr
-
isList
public final boolean isList()
Test if this expression is a list (i.e. an AST with head List)
-
isSequence
public final boolean isSequence()
Test if this expression is a sequence (i.e. an AST with head Sequence)- Specified by:
isSequencein interfaceIExpr
-
isListOfLists
public final boolean isListOfLists()
Test if this expression is a list of lists- Specified by:
isListOfListsin interfaceIExpr- See Also:
IExpr.isList(),IExpr.isMatrix(),IExpr.isVector()
-
isTrue
public boolean isTrue()
Test if this expression equals the symbol "True"
-
isFalse
public boolean isFalse()
Test if this expression equals the symbol "False"
-
isSame
public 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
public boolean isSame(IExpr expression, double epsilon)
Description copied from interface:IExprTest if this expression equals the given expression. If the compared expressions are of the same numeric type, they are equal to a given EPSILON
-
isMatrix
public final int[] isMatrix()
Description copied from interface:IExprTest 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.
-
isValue
public boolean isValue()
Returnstrue, if this symbol or ast expression is bound to a value (i.e. the evaluation returns an assigned value).
-
isVector
public final int isVector()
Description copied from interface:IExprTest 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(...).
-
isAST
public final 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.- Specified by:
isASTin interfaceIExpr- See Also:
IExpr.isAtom()
-
isOrderlessAST
public final 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.- Specified by:
isOrderlessASTin interfaceIExpr- See Also:
IExpr.isAtom()
-
isFlatAST
public final 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.- Specified by:
isFlatASTin interfaceIExpr- See Also:
IExpr.isAtom()
-
isAST
public final 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.- Specified by:
isASTin interfaceIExpr- See Also:
IExpr.isAtom()
-
isAST
public final boolean isAST(IExpr header, int sz)
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.- Specified by:
isASTin interfaceIExpr- See Also:
IExpr.isAtom()
-
isASTSizeGE
public final 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.- Specified by:
isASTSizeGEin interfaceIExpr- See Also:
IExpr.isAtom()
-
isAST
public final 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].- Specified by:
isASTin interfaceIExpr- See Also:
IExpr.isAtom()
-
isAST
public final 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].- Specified by:
isASTin interfaceIExpr- See Also:
IExpr.isAtom()
-
isAST
public 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.- Specified by:
isASTin interfaceIExprargs- the arguments of this AST which should be tested, if they are equal, anullvalue argument skips the equals chack.- See Also:
IExpr.isAtom()
-
isPlus
public final boolean isPlus()
Description copied from interface:IExprTest if this expression is the addition functionPlus[<arg1>, <arg2>, ...]
-
isPower
public final boolean isPower()
Description copied from interface:IExprTest if this expression is the functionPower[<arg1>, <arg2>]
-
isRuleAST
public final boolean isRuleAST()
Test if this expression is of the formRule[<arg1>, <arg2>]orRuleDelayed[<arg1>, <arg2>].
-
isTimes
public final boolean isTimes()
Description copied from interface:IExprTest if this expression is the multiplication functionTimes[<arg1>, <arg2>, ...]
-
isSin
public final boolean isSin()
Description copied from interface:IExprTest if this expression is the functionSin[<arg>]
-
isCos
public final boolean isCos()
Description copied from interface:IExprTest if this expression is the functionCos[<arg>]
-
isTan
public final boolean isTan()
Description copied from interface:IExprTest if this expression is the functionTAn[<arg>]
-
isArcSin
public final boolean isArcSin()
Description copied from interface:IExprTest if this expression is the functionArcSin[<arg>]
-
isAnd
public final boolean isAnd()
Description copied from interface:IExprTest if this expression is the functionAnd[<arg>,...]
-
isArcCos
public final boolean isArcCos()
Description copied from interface:IExprTest if this expression is the functionArcCos[<arg>]
-
isArcTan
public final boolean isArcTan()
Description copied from interface:IExprTest if this expression is the functionArcTan[<arg>]
-
isSinh
public final boolean isSinh()
Description copied from interface:IExprTest if this expression is the functionSinh[<arg>]
-
isCosh
public final boolean isCosh()
Description copied from interface:IExprTest if this expression is the functionCosh[<arg>]
-
isTanh
public final boolean isTanh()
Description copied from interface:IExprTest if this expression is the functionTanh[<arg>]
-
isArcSinh
public final boolean isArcSinh()
Description copied from interface:IExprTest if this expression is the functionArcSinh[<arg>]
-
isArcCosh
public final boolean isArcCosh()
Description copied from interface:IExprTest if this expression is the functionArcCosh[<arg>]
-
isArcTanh
public final boolean isArcTanh()
Description copied from interface:IExprTest if this expression is the functionArcTanh[<arg>]
-
isLog
public final boolean isLog()
Description copied from interface:IExprTest if this expression is the functionLog[<arg>]
-
isOne
public boolean isOne()
Description copied from interface:IExprTest if this expression equals1in symbolic or numeric mode.
-
isOr
public boolean isOr()
Test if this expression is the functionOr[<arg>,...]
-
isMinusOne
public boolean isMinusOne()
Description copied from interface:IExprTest if this expression equals-1in symbolic or numeric mode.- Specified by:
isMinusOnein interfaceIExpr
-
isZero
public boolean isZero()
Description copied from interface:IExprTest if this expression equals0in symbolic or numeric mode.
-
isSlot
public boolean isSlot()
Description copied from interface:IExprTest if this expression is the functionSlot[<integer-value>]
-
isSlotSequence
public boolean isSlotSequence()
Description copied from interface:IExprTest if this expression is the functionSlotSequence[<integer-value>]- Specified by:
isSlotSequencein interfaceIExpr
-
isFree
public 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.
-
isFree
public 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.
-
isMember
public 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.
-
isMember
public 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.
-
isFunction
public boolean isFunction()
Test if this expression is aFuntion[ arg1 ]expression with at least 1 argument.- Specified by:
isFunctionin interfaceIExpr
-
isPattern
public boolean isPattern()
Test if this expression is a pattern object
-
isPatternExpr
public boolean isPatternExpr()
Test if this expression or a subexpression is a pattern object. Used in pattern-matching; checks flags inIASTwith flagIAST.CONTAINS_PATTERN_EXPR.- Specified by:
isPatternExprin interfaceIExpr
-
isPatternSequence
public boolean isPatternSequence()
Test if this expression is a pattern sequence object- Specified by:
isPatternSequencein interfaceIExpr
-
isPositive
public boolean isPositive()
Test if this object is a positive signed number.- Specified by:
isPositivein interfaceIExpr- Returns:
true, ifthis > 0;falsein all other case.
-
isCondition
public boolean isCondition()
Test if this expression is the Condition functionCondition[<arg1>, <arg2>]- Specified by:
isConditionin interfaceIExpr
-
isModule
public boolean isModule()
Test if this expression is the Module functionModule[<arg1>, <arg2>]
-
isSymbol
public boolean isSymbol()
Description copied from interface:IExprTest if this expression is a symbol
-
isComplex
public boolean isComplex()
Test if this expression is a symbolic complex number
-
isComplexNumeric
public boolean isComplexNumeric()
Test if this expression is a numeric complex number- Specified by:
isComplexNumericin interfaceIExpr
-
isFraction
public boolean isFraction()
Test if this expression is a fractional number, but no integer number.- Specified by:
isFractionin interfaceIExpr
-
isInteger
public boolean isInteger()
Test if this expression is a integer number
-
isNumEqualInteger
public 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.- Specified by:
isNumEqualIntegerin interfaceIExpr- Returns:
- Throws:
java.lang.ArithmeticException
-
isNumIntValue
public boolean isNumIntValue()
Check if this expression represents anintvalue. The value of anINumobject can be anintvalue.- Specified by:
isNumIntValuein interfaceIExpr- Returns:
-
isRational
public boolean isRational()
Test if this expression is a rational number, i.e. integer or fraction number.- Specified by:
isRationalin interfaceIExpr
-
isSignedNumber
public boolean isSignedNumber()
Test if this expression is a signed number- Specified by:
isSignedNumberin interfaceIExpr
-
isNot
public boolean isNot()
Test if this expression is the functionNot[<arg>]
-
isNumeric
public boolean isNumeric()
Test if this expression is a numeric number (i.e. of typeINumorIComplexNum.
-
isNumericFunction
public 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")- Specified by:
isNumericFunctionin interfaceIExpr- Returns:
true, if the given expression is a numeric function or value.- See Also:
IExpr.isRealFunction()
-
isRealFunction
public 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)- Specified by:
isRealFunctionin interfaceIExpr- Returns:
true, if the given expression is a real (non-complex) value.- See Also:
IExpr.isConstant(),IExpr.isNumericFunction()
-
isNumber
public boolean isNumber()
Test if this expression is a number
-
isLTOrdered
public boolean isLTOrdered(IExpr obj)
Compares this expression with the specified expression for order. Returns true if this expression is canonical less than the specified expression (< relation).- Specified by:
isLTOrderedin interfaceIExpr- Parameters:
obj- an expression to compare with- Returns:
- true if this expression is canonical less than the specified expression.
-
isLEOrdered
public 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).- Specified by:
isLEOrderedin interfaceIExpr- Returns:
- true if this expression is canonical less than or equal to the specified expression.
-
isGTOrdered
public boolean isGTOrdered(IExpr obj)
Compares this expression with the specified expression for order. Returns true if this expression is canonical greater than the specified expression (< relation).- Specified by:
isGTOrderedin interfaceIExpr- Parameters:
obj- an expression to compare with- Returns:
- true if this expression is canonical greater than the specified expression.
-
isGEOrdered
public 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).- Specified by:
isGEOrderedin interfaceIExpr- Returns:
- true if this expression is canonical greater than or equal to the specified expression.
-
isAtom
public boolean isAtom()
Description copied from interface:IExprTest if this expression is an atomic expression (i.e. no AST expression)
-
variables2Slots
public IExpr variables2Slots(java.util.Map<IExpr,IExpr> map, java.util.List<IExpr> variableList)
Description copied from interface:IExprConvert the variables (i.e. ISymbol's with lower case character in the 0-th position of their name) in this expression into Slot[] s.- Specified by:
variables2Slotsin interfaceIExpr- 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.
-
fullFormString
public java.lang.String fullFormString()
Description copied from interface:IExprReturn the FullForm of this expression- Specified by:
fullFormStringin interfaceIExpr
-
internalFormString
public java.lang.String internalFormString(boolean symbolsAsFactoryMethod, int depth)Description copied from interface:IExprReturn the internal Java form of this expression.- Specified by:
internalFormStringin interfaceIExpr- Parameters:
symbolsAsFactoryMethod- iftrueuse theF.symbol()method, otherwise print the symbol name.depth- the recursion depth of this call.0indicates "recurse without a limit".
-
leaves
public java.util.List<IExpr> leaves()
-
replaceAll
public IExpr replaceAll(IAST astRules)
Replace all (sub-) expressions with the given rule set. If no substitution matches, the method returnsnull.- Specified by:
replaceAllin interfaceIExpr- 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.
-
replaceAll
public IExpr replaceAll(Function<IExpr,IExpr> function)
Replace all (sub-) expressions with the given unary function. If no substitution matches, the method returnsnull.- Specified by:
replaceAllin interfaceIExpr- Parameters:
function- if the unary functionsapply()method returnsnullthe expression isn't substituted.- Returns:
nullif no substitution of a (sub-)expression was possible.
-
replacePart
public IExpr replacePart(IAST astRules)
- Specified by:
replacePartin interfaceIExpr
-
replaceRepeated
public IExpr replaceRepeated(IAST astRules)
Repeatedly replace all (sub-) expressions with the given rule set. If no substitution matches, the method returnsthis.- Specified by:
replaceRepeatedin interfaceIExpr- 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.
-
replaceSlots
public IExpr replaceSlots(IAST astSlots)
- Specified by:
replaceSlotsin interfaceIExpr
-
replaceRepeated
public IExpr replaceRepeated(Function<IExpr,IExpr> function)
Repeatedly replace all (sub-) expressions with the given unary function. If no substitution matches, the method returnsthis.- Specified by:
replaceRepeatedin interfaceIExpr- Parameters:
function- if the unary functionsapply()method returnsnullthe expression isn't substituted.- Returns:
thisif no substitution of a (sub-)expression was possible.
-
replaceRepeated
public static IExpr replaceRepeated(IExpr expr, VisitorReplaceAll visitor)
-
egcd
public IExpr[] egcd(IExpr b)
Description copied from interface:RingElemExtended greatest common divisor.
-
evaluate
public IExpr evaluate(EvalEngine engine)
Description copied from interface:IExprEvaluate an expression
-
abs
public IExpr abs()
Description copied from interface:AbelianGroupElemAbsolute value of this.- Specified by:
absin interfaceAbelianGroupElem<IExpr>- Returns:
- |this|.
-
isZERO
public boolean isZERO()
Description copied from interface:AbelianGroupElemTest if this is zero.- Specified by:
isZEROin interfaceAbelianGroupElem<IExpr>- Returns:
- true if this is 0, else false.
-
signum
@Deprecated public int signum()
Deprecated.Signum functionality is used in JAS toString() method, don't use it as math signum function.- Specified by:
signumin interfaceAbelianGroupElem<IExpr>- Specified by:
signumin interfaceIExpr- Returns:
- the sign of this.
-
subtract
public IExpr subtract(IExpr that)
Description copied from interface:AbelianGroupElemSubtract S from this.- Specified by:
subtractin interfaceAbelianGroupElem<IExpr>- Returns:
- this - S.
-
sum
public IExpr sum(IExpr that)
Description copied from interface:AbelianGroupElemSum of this and S.- Specified by:
sumin interfaceAbelianGroupElem<IExpr>- Returns:
- this + S.
-
factory
public ElemFactory<IExpr> factory()
Description copied from interface:ElementGet the corresponding element factory.
-
toScript
public java.lang.String toScript()
Description copied from interface:ElementGet a scripting compatible string representation.
-
toScriptFactory
public java.lang.String toScriptFactory()
Description copied from interface:ElementGet a scripting compatible string representation of the factory.- Specified by:
toScriptFactoryin interfaceElement<IExpr>- Returns:
- script compatible representation for this ElemFactory.
-
divide
public IExpr divide(IExpr that)
Description copied from interface:MonoidElemDivide this by S.- Specified by:
dividein interfaceMonoidElem<IExpr>- Returns:
- this / S.
-
isONE
public boolean isONE()
Description copied from interface:MonoidElemTest if this is one.- Specified by:
isONEin interfaceMonoidElem<IExpr>- Returns:
- true if this is 1, else false.
-
isUnit
public boolean isUnit()
Description copied from interface:MonoidElemTest if this is a unit. I.e. there exists x with this.multiply(x).isONE() == true.- Specified by:
isUnitin interfaceMonoidElem<IExpr>- Returns:
- true if this is a unit, else false.
-
remainder
public IExpr remainder(IExpr S)
Description copied from interface:MonoidElemRemainder after division of this by S.- Specified by:
remainderin interfaceMonoidElem<IExpr>- Returns:
- this - (this / S) * S.
-
negate
public IExpr negate()
Description copied from interface:AbelianGroupElemNegate this.- Specified by:
negatein interfaceAbelianGroupElem<IExpr>- Returns:
- - this.
-
-
DMelt 3.0 © DataMelt by jWork.ORG