Documentation of 'org.matheclipse.core.expression.ExprImpl' Java class
ExprImpl
org.matheclipse.core.expression

Class ExprImpl

    • 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
      IExpr abs()
      Absolute value of this.
      IExpr and(IExpr that) 
      IExpr apply(IExpr... leaves)
      IExpr apply(java.util.List<? extends IExpr> leaves)
      java.lang.Object asType(java.lang.Class clazz) 
      IExpr copy()
      Clone this Element.
      IExpr divide(IExpr that)
      Divide this by S.
      IExpr[] egcd(IExpr b)
      Extended greatest common divisor.
      IExpr evaluate(EvalEngine engine)
      Evaluate an expression
      ElemFactory<IExpr> factory()
      Get the corresponding element factory.
      java.lang.String fullFormString()
      Return the FullForm of this expression
      IExpr gcd(IExpr b)
      Greatest common divisor.
      IExpr getAt(int index)
      Get the element at the specified index if this object is of type IAST.
      abstract ISymbol head()
      If this object is an instance of IAST get the first element (offset 0) of the IAST list (i.e.
      java.lang.String internalFormString(boolean symbolsAsFactoryMethod, int depth)
      Return the internal Java form of this expression.
      IExpr inverse()
      Returns the multiplicative inverse of this object.
      boolean isAnd()
      Test if this expression is the function And[<arg>,...]
      boolean isArcCos()
      Test if this expression is the function ArcCos[<arg>]
      boolean isArcCosh()
      Test if this expression is the function ArcCosh[<arg>]
      boolean isArcSin()
      Test if this expression is the function ArcSin[<arg>]
      boolean isArcSinh()
      Test if this expression is the function ArcSinh[<arg>]
      boolean isArcTan()
      Test if this expression is the function ArcTan[<arg>]
      boolean isArcTanh()
      Test if this expression is the function ArcTanh[<arg>]
      boolean isAST()
      Test if this expression is an AST list, which contains a header element (i.e.
      boolean isAST(IExpr header)
      Test if this expression is an AST list, which contains the given header element at index position 0 and some optional argument elements at the index positions 1..(size()-1).
      boolean isAST(IExpr header, int sz)
      Test if this expression is an AST list, which contains the given header element at index position 0 and optional argument elements at the index positions 1..(length-1).
      boolean isAST(IExpr header, int length, IExpr... args)
      Test if this expression is an AST list, which contains the given header element at index position 0 and optional argument elements at the index positions 1..(length-1).
      boolean isAST(java.lang.String symbol)
      Test if this expression is an AST list, where the string representation of the header element at index position 0 equals the given symbol and some optional argument elements at the index positions 1..(size()-1).
      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 position 0 equals the given symbol and some optional argument elements at the index positions 1..(length-1).
      boolean isASTSizeGE(IExpr header, int length)
      Test if this expression is an AST (i.e.
      boolean isAtom()
      Test if this expression is an atomic expression (i.e.
      boolean isComplex()
      Test if this expression is a symbolic complex number
      boolean isComplexInfinity()
      Test if this expression is representing ComplexInfinity (i.e.
      boolean isComplexNumeric()
      Test if this expression is a numeric complex number
      boolean isCondition()
      Test if this expression is the Condition function Condition[<arg1>, <arg2>]
      boolean isConstant()
      Test if this expression is a symbol with attribute Constant.
      boolean isCos()
      Test if this expression is the function Cos[<arg>]
      boolean isCosh()
      Test if this expression is the function Cosh[<arg>]
      boolean isDirectedInfinity()
      Test if this expression is representing a DirectedInfinity (i.e.
      boolean isFalse()
      Test if this expression equals the symbol "False"
      boolean isFlatAST()
      Test if this expression is an AST list, which contains a header element (i.e.
      boolean isFraction()
      Test if this expression is a fractional number, but no integer number.
      boolean isFree(IExpr pattern, boolean heads)
      Returns true, if all of the elements in the subexpressions or the expression itself, did not match the given pattern.
      boolean isFree(Predicate<IExpr> predicate, boolean heads)
      Returns true, if all of the elements in the subexpressions or the expression itself, did not satisfy the given unary predicate.
      boolean isFunction()
      Test if this expression is a Funtion[ arg1 ] expression with at least 1 argument.
      boolean isGEOrdered(IExpr obj)
      Compares this expression with the specified expression for order.
      boolean isGTOrdered(IExpr obj)
      Compares this expression with the specified expression for order.
      boolean isInfinity()
      Test if this expression is representing Infinity (i.e.
      boolean isInteger()
      Test if this expression is a integer number
      boolean isLEOrdered(IExpr obj)
      Compares this expression with the specified expression for order.
      boolean isList()
      Test if this expression is a list (i.e.
      boolean isListOfLists()
      Test if this expression is a list of lists
      boolean isLog()
      Test if this expression is the function Log[<arg>]
      boolean isLTOrdered(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].
      boolean isMember(IExpr pattern, boolean heads)
      Returns true, if at least one of the elements in the subexpressions or the expression itself, match the given pattern.
      boolean isMember(Predicate<IExpr> predicate, boolean heads)
      Returns true, if at least one of the elements in the subexpressions or the expression itself, satisfy the given unary predicate.
      boolean isMinusOne()
      Test if this expression equals -1 in symbolic or numeric mode.
      boolean isModule()
      Test if this expression is the Module function Module[<arg1>, <arg2>]
      boolean isNegative()
      Test if this object is a negative signed number.
      boolean isNegativeInfinity()
      Test if this expression is representing -Infinity (i.e.
      boolean isNot()
      Test if this expression is the function Not[<arg>]
      boolean isNumber()
      Test if this expression is a number
      boolean isNumEqualInteger(IInteger ii)
      Check if this expression equals an IInteger value.
      boolean isNumeric()
      Test if this expression is a numeric number (i.e.
      boolean isNumericFunction()
      Test if this expression is a numeric function (i.e.
      boolean isNumIntValue()
      Check if this expression represents an int value.
      boolean isOne()
      Test if this expression equals 1 in symbolic or numeric mode.
      boolean isONE()
      Test if this is one.
      boolean isOr()
      Test if this expression is the function Or[<arg>,...]
      boolean isOrderlessAST()
      Test if this expression is an AST list, which contains a header element (i.e.
      boolean isPattern()
      Test if this expression is a pattern object
      boolean isPatternExpr()
      Test if this expression or a subexpression is a pattern object.
      boolean isPatternSequence()
      Test if this expression is a pattern sequence object
      boolean isPlus()
      Test if this expression is the addition function Plus[<arg1>, <arg2>, ...]
      boolean isPositive()
      Test if this object is a positive signed number.
      boolean isPower()
      Test if this expression is the function Power[<arg1>, <arg2>]
      boolean isRational()
      Test if this expression is a rational number, i.e.
      boolean isRealFunction()
      Test if this expression is a real (non-complex) value (i.e.
      boolean isRuleAST()
      Test if this expression is of the form Rule[<arg1>, <arg2>] or RuleDelayed[<arg1>, <arg2>].
      boolean isSame(IExpr expression)
      Test if this expression equals the given expression.
      boolean isSame(IExpr expression, double epsilon)
      Test if this expression equals the given expression.
      boolean isSequence()
      Test if this expression is a sequence (i.e.
      boolean isSignedNumber()
      Test if this expression is a signed number
      boolean isSin()
      Test if this expression is the function Sin[<arg>]
      boolean isSinh()
      Test if this expression is the function Sinh[<arg>]
      boolean isSlot()
      Test if this expression is the function Slot[<integer-value>]
      boolean isSlotSequence()
      Test if this expression is the function SlotSequence[<integer-value>]
      boolean isSymbol()
      Test if this expression is a symbol
      boolean isTan()
      Test if this expression is the function TAn[<arg>]
      boolean isTanh()
      Test if this expression is the function Tanh[<arg>]
      boolean isTimes()
      Test if this expression is the multiplication function Times[<arg1>, <arg2>, ...]
      boolean isTrue()
      Test if this expression equals the symbol "True"
      boolean isUnit()
      Test if this is a unit.
      boolean isValue()
      Returns true, if this symbol or ast expression is bound to a value (i.e.
      int isVector()
      Test if this expression is a vector and return the dimension of the vector.
      boolean isZero()
      Test if this expression equals 0 in symbolic or numeric mode.
      boolean isZERO()
      Test if this is zero.
      java.util.List<IExpr> leaves()
      IExpr minus(IExpr that) 
      IExpr mod(IExpr that) 
      IExpr multiply(IExpr that)
      Additional multiply method which works like times to fulfill groovy's method signature
      IExpr negate()
      Negate this.
      IExpr negative()
      Additional negative method, which works like opposite to fulfill groovy's method signature
      IExpr opposite() 
      IExpr or(IExpr that) 
      IExpr plus(IExpr that) 
      IExpr power(IExpr that) 
      IExpr power(java.lang.Integer n) 
      IExpr remainder(IExpr S)
      Remainder after division of this by S.
      IExpr replaceAll(Function<IExpr,IExpr> function)
      Replace all (sub-) expressions with the given unary function.
      IExpr replaceAll(IAST astRules)
      Replace all (sub-) expressions with the given rule set.
      IExpr replacePart(IAST astRules)
      IExpr replaceRepeated(Function<IExpr,IExpr> function)
      Repeatedly replace all (sub-) expressions with the given unary function.
      IExpr replaceRepeated(IAST astRules)
      Repeatedly replace all (sub-) expressions with the given rule set.
      static IExpr replaceRepeated(IExpr expr, VisitorReplaceAll visitor) 
      IExpr replaceSlots(IAST astSlots)
      int signum()
      Deprecated.  
      IExpr subtract(IExpr that)
      Subtract S from this.
      IExpr sum(IExpr that)
      Sum of this and S.
      IExpr times(IExpr that)
      Returns the product of this object with the one specified.
      ISymbol topHead() 
      java.lang.String toScript()
      Get a scripting compatible string representation.
      java.lang.String toScriptFactory()
      Get a scripting compatible string representation of the factory.
      IExpr variables2Slots(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
    • Constructor Detail

      • ExprImpl

        public ExprImpl()
    • Method Detail

      • opposite

        public IExpr opposite()
      • negative

        public final IExpr negative()
        Additional negative method, which works like opposite to fulfill groovy's method signature
        Specified by:
        negative in interface IExpr
        Returns:
      • inverse

        public IExpr inverse()
        Description copied from interface: IExpr
        Returns the multiplicative inverse of this object. It is the object such as this.times(this.inverse()) == ONE , with ONE being the multiplicative identity.
        Specified by:
        inverse in interface MonoidElem<IExpr>
        Specified by:
        inverse in interface IExpr
        Returns:
        ONE / this.
      • times

        public IExpr times(IExpr that)
        Description copied from interface: IExpr
        Returns the product of this object with the one specified.
        Specified by:
        times in interface IExpr
        Parameters:
        that - the object multiplier.
        Returns:
        this · that.
      • multiply

        public final IExpr multiply(IExpr that)
        Additional multiply method which works like times to fulfill groovy's method signature
        Specified by:
        multiply in interface MonoidElem<IExpr>
        Specified by:
        multiply in interface IExpr
        Parameters:
        that -
        Returns:
      • power

        public final IExpr power(java.lang.Integer n)
        Specified by:
        power in interface IExpr
      • getAt

        public IExpr getAt(int index)
        Description copied from interface: IExpr
        Get the element at the specified index if this object is of type IAST.
        Specified by:
        getAt in interface IExpr
        Returns:
      • asType

        public java.lang.Object asType(java.lang.Class clazz)
        Specified by:
        asType in interface IExpr
      • head

        public abstract ISymbol head()
        Description copied from interface: IExpr
        If this object is an instance of IAST get the first element (offset 0) of the IAST list (i.e. get(0) ).
        Specified by:
        head in interface IExpr
        Returns:
        the head of the expression, which must not be null.
      • topHead

        public ISymbol topHead()
        Specified by:
        topHead in interface IExpr
        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.
      • isComplexInfinity

        public boolean isComplexInfinity()
        Test if this expression is representing ComplexInfinity (i.e. DirectedInfinity[])
        Specified by:
        isComplexInfinity in interface IExpr
      • isDirectedInfinity

        public boolean isDirectedInfinity()
        Test if this expression is representing a DirectedInfinity (i.e. Infinity->DirectedInfinity[1], -Infinity->DirectedInfinity[-1], ComplexInfinity->DirectedInfinity[])
        Specified by:
        isDirectedInfinity in interface IExpr
      • isInfinity

        public boolean isInfinity()
        Test if this expression is representing Infinity (i.e. Infinity->DirectedInfinity[1])
        Specified by:
        isInfinity in interface IExpr
      • isNegative

        public boolean isNegative()
        Test if this object is a negative signed number.
        Specified by:
        isNegative in interface IExpr
        Returns:
        true, if this < 0; false in all other case.
      • isNegativeInfinity

        public boolean isNegativeInfinity()
        Test if this expression is representing -Infinity (i.e. -Infinity->DirectedInfinity[-1])
        Specified by:
        isNegativeInfinity in interface IExpr
      • isList

        public final boolean isList()
        Test if this expression is a list (i.e. an AST with head List)
        Specified by:
        isList in interface IExpr
      • isSequence

        public final boolean isSequence()
        Test if this expression is a sequence (i.e. an AST with head Sequence)
        Specified by:
        isSequence in interface IExpr
      • isTrue

        public boolean isTrue()
        Test if this expression equals the symbol "True"
        Specified by:
        isTrue in interface IExpr
      • isFalse

        public boolean isFalse()
        Test if this expression equals the symbol "False"
        Specified by:
        isFalse in interface IExpr
      • 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
        Specified by:
        isSame in interface IExpr
      • isSame

        public boolean isSame(IExpr expression,
                              double epsilon)
        Description copied from interface: IExpr
        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
        Specified by:
        isSame in interface IExpr
      • isMatrix

        public final int[] isMatrix()
        Description copied from interface: IExpr
        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 header List and have the same size.
        Specified by:
        isMatrix in interface IExpr
        Returns:
        null if the expression is not a matrix
      • isValue

        public boolean isValue()
        Returns true, if this symbol or ast expression is bound to a value (i.e. the evaluation returns an assigned value).
        Specified by:
        isValue in interface IExpr
      • isVector

        public final int isVector()
        Description copied from interface: IExpr
        Test if this expression is a vector and return the dimension of the vector. This expression is only a vector, if the expression is a List(...) and no element is itself a List(...).
        Specified by:
        isVector in interface IExpr
        Returns:
        -1 if the expression is no vector or size()-1 of the corresponding IAST.
      • 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 position 0 and some optional argument elements at the index positions 1..n. Therefore this expression is no atomic expression.
        Specified by:
        isAST in interface IExpr
        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 example Plus or Times) with attribute Orderless at index position 0 and some optional argument elements at the index positions 1..n. Examples for Orderless functions are Plus[] or Times[]. Therefore this expression is no atomic expression.
        Specified by:
        isOrderlessAST in interface IExpr
        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 example Dot, Plus or Times) with attribute Flat at index position 0 and some optional argument elements at the index positions 1..(size()-1). Examples for Flat functions are Dot[], Plus[] or Times[]. Therefore this expression is no atomic expression.
        Specified by:
        isFlatAST in interface IExpr
        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 position 0 and some optional argument elements at the index positions 1..(size()-1). Therefore this expression is not an atomic expression.
        Specified by:
        isAST in interface IExpr
        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 position 0 and optional argument elements at the index positions 1..(length-1). Therefore this expression is not an atomic expression.
        Specified by:
        isAST in interface IExpr
        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 position 0 and optional argument elements at the index positions 1..n. n must be greater equal than the given length. Therefore this expression is no atomic expression.
        Specified by:
        isASTSizeGE in interface IExpr
        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 position 0 equals the given symbol and some optional argument elements at the index positions 1..(size()-1). Therefore this expression is no atomic expression. Example: isAST("Sin") gives true for Sin[Pi/2].
        Specified by:
        isAST in interface IExpr
        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 position 0 equals the given symbol and some optional argument elements at the index positions 1..(length-1). Therefore this expression is no atomic expression. Example: isAST("Sin", 2) gives true for Sin[0].
        Specified by:
        isAST in interface IExpr
        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 position 0 and optional argument elements at the index positions 1..(length-1). Therefore this expression is not an atomic expression.
        Specified by:
        isAST in interface IExpr
        args - the arguments of this AST which should be tested, if they are equal, a null value argument skips the equals chack.
        See Also:
        IExpr.isAtom()
      • isPlus

        public final boolean isPlus()
        Description copied from interface: IExpr
        Test if this expression is the addition function Plus[<arg1>, <arg2>, ...]
        Specified by:
        isPlus in interface IExpr
      • isPower

        public final boolean isPower()
        Description copied from interface: IExpr
        Test if this expression is the function Power[<arg1>, <arg2>]
        Specified by:
        isPower in interface IExpr
      • isRuleAST

        public final boolean isRuleAST()
        Test if this expression is of the form Rule[<arg1>, <arg2>] or RuleDelayed[<arg1>, <arg2>].
        Specified by:
        isRuleAST in interface IExpr
      • isTimes

        public final boolean isTimes()
        Description copied from interface: IExpr
        Test if this expression is the multiplication function Times[<arg1>, <arg2>, ...]
        Specified by:
        isTimes in interface IExpr
      • isSin

        public final boolean isSin()
        Description copied from interface: IExpr
        Test if this expression is the function Sin[<arg>]
        Specified by:
        isSin in interface IExpr
      • isCos

        public final boolean isCos()
        Description copied from interface: IExpr
        Test if this expression is the function Cos[<arg>]
        Specified by:
        isCos in interface IExpr
      • isTan

        public final boolean isTan()
        Description copied from interface: IExpr
        Test if this expression is the function TAn[<arg>]
        Specified by:
        isTan in interface IExpr
      • isArcSin

        public final boolean isArcSin()
        Description copied from interface: IExpr
        Test if this expression is the function ArcSin[<arg>]
        Specified by:
        isArcSin in interface IExpr
      • isAnd

        public final boolean isAnd()
        Description copied from interface: IExpr
        Test if this expression is the function And[<arg>,...]
        Specified by:
        isAnd in interface IExpr
      • isArcCos

        public final boolean isArcCos()
        Description copied from interface: IExpr
        Test if this expression is the function ArcCos[<arg>]
        Specified by:
        isArcCos in interface IExpr
      • isArcTan

        public final boolean isArcTan()
        Description copied from interface: IExpr
        Test if this expression is the function ArcTan[<arg>]
        Specified by:
        isArcTan in interface IExpr
      • isSinh

        public final boolean isSinh()
        Description copied from interface: IExpr
        Test if this expression is the function Sinh[<arg>]
        Specified by:
        isSinh in interface IExpr
      • isCosh

        public final boolean isCosh()
        Description copied from interface: IExpr
        Test if this expression is the function Cosh[<arg>]
        Specified by:
        isCosh in interface IExpr
      • isTanh

        public final boolean isTanh()
        Description copied from interface: IExpr
        Test if this expression is the function Tanh[<arg>]
        Specified by:
        isTanh in interface IExpr
      • isArcSinh

        public final boolean isArcSinh()
        Description copied from interface: IExpr
        Test if this expression is the function ArcSinh[<arg>]
        Specified by:
        isArcSinh in interface IExpr
      • isArcCosh

        public final boolean isArcCosh()
        Description copied from interface: IExpr
        Test if this expression is the function ArcCosh[<arg>]
        Specified by:
        isArcCosh in interface IExpr
      • isArcTanh

        public final boolean isArcTanh()
        Description copied from interface: IExpr
        Test if this expression is the function ArcTanh[<arg>]
        Specified by:
        isArcTanh in interface IExpr
      • isLog

        public final boolean isLog()
        Description copied from interface: IExpr
        Test if this expression is the function Log[<arg>]
        Specified by:
        isLog in interface IExpr
      • isOne

        public boolean isOne()
        Description copied from interface: IExpr
        Test if this expression equals 1 in symbolic or numeric mode.
        Specified by:
        isOne in interface IExpr
      • isOr

        public boolean isOr()
        Test if this expression is the function Or[<arg>,...]
        Specified by:
        isOr in interface IExpr
      • isMinusOne

        public boolean isMinusOne()
        Description copied from interface: IExpr
        Test if this expression equals -1 in symbolic or numeric mode.
        Specified by:
        isMinusOne in interface IExpr
      • isZero

        public boolean isZero()
        Description copied from interface: IExpr
        Test if this expression equals 0 in symbolic or numeric mode.
        Specified by:
        isZero in interface IExpr
      • isSlot

        public boolean isSlot()
        Description copied from interface: IExpr
        Test if this expression is the function Slot[<integer-value>]
        Specified by:
        isSlot in interface IExpr
      • isSlotSequence

        public boolean isSlotSequence()
        Description copied from interface: IExpr
        Test if this expression is the function SlotSequence[<integer-value>]
        Specified by:
        isSlotSequence in interface IExpr
      • isFree

        public boolean isFree(IExpr pattern,
                              boolean heads)
        Returns true, if all of the elements in the subexpressions or the expression itself, did not match the given pattern.
        Specified by:
        isFree in interface IExpr
        Parameters:
        pattern - a pattern-matching expression
        heads - if set to false, only the arguments of an IAST should be tested and not the Head[] element.
      • isFree

        public boolean isFree(Predicate<IExpr> predicate,
                              boolean heads)
        Returns true, if all of the elements in the subexpressions or the expression itself, did not satisfy the given unary predicate.
        Specified by:
        isFree in interface IExpr
        Parameters:
        predicate - a unary predicate
        heads - if set to false, only the arguments of an IAST should be tested and not the Head[] element.
      • isMember

        public boolean isMember(IExpr pattern,
                                boolean heads)
        Returns true, if at least one of the elements in the subexpressions or the expression itself, match the given pattern.
        Specified by:
        isMember in interface IExpr
        Parameters:
        pattern - a pattern-matching expression
        heads - if set to false, only the arguments of an IAST should be tested and not the Head[] element.
      • isMember

        public boolean isMember(Predicate<IExpr> predicate,
                                boolean heads)
        Returns true, if at least one of the elements in the subexpressions or the expression itself, satisfy the given unary predicate.
        Specified by:
        isMember in interface IExpr
        Parameters:
        predicate - a unary predicate
        heads - if set to false, only the arguments of an IAST should be tested and not the Head[] element.
      • isFunction

        public boolean isFunction()
        Test if this expression is a Funtion[ arg1 ] expression with at least 1 argument.
        Specified by:
        isFunction in interface IExpr
      • isPattern

        public boolean isPattern()
        Test if this expression is a pattern object
        Specified by:
        isPattern in interface IExpr
      • isPatternExpr

        public boolean isPatternExpr()
        Test if this expression or a subexpression is a pattern object. Used in pattern-matching; checks flags in IAST with flag IAST.CONTAINS_PATTERN_EXPR.
        Specified by:
        isPatternExpr in interface IExpr
      • isPatternSequence

        public boolean isPatternSequence()
        Test if this expression is a pattern sequence object
        Specified by:
        isPatternSequence in interface IExpr
      • isPositive

        public boolean isPositive()
        Test if this object is a positive signed number.
        Specified by:
        isPositive in interface IExpr
        Returns:
        true, if this > 0; false in all other case.
      • isCondition

        public boolean isCondition()
        Test if this expression is the Condition function Condition[<arg1>, <arg2>]
        Specified by:
        isCondition in interface IExpr
      • isModule

        public boolean isModule()
        Test if this expression is the Module function Module[<arg1>, <arg2>]
        Specified by:
        isModule in interface IExpr
      • isSymbol

        public boolean isSymbol()
        Description copied from interface: IExpr
        Test if this expression is a symbol
        Specified by:
        isSymbol in interface IExpr
      • isComplex

        public boolean isComplex()
        Test if this expression is a symbolic complex number
        Specified by:
        isComplex in interface IExpr
      • isComplexNumeric

        public boolean isComplexNumeric()
        Test if this expression is a numeric complex number
        Specified by:
        isComplexNumeric in interface IExpr
      • isFraction

        public boolean isFraction()
        Test if this expression is a fractional number, but no integer number.
        Specified by:
        isFraction in interface IExpr
      • isInteger

        public boolean isInteger()
        Test if this expression is a integer number
        Specified by:
        isInteger in interface IExpr
      • isNumEqualInteger

        public boolean isNumEqualInteger(IInteger ii)
                                  throws java.lang.ArithmeticException
        Check if this expression equals an IInteger value. The value of an INum or the value of an IInteger object can be an IInteger value.
        Specified by:
        isNumEqualInteger in interface IExpr
        Returns:
        Throws:
        java.lang.ArithmeticException
      • isNumIntValue

        public boolean isNumIntValue()
        Check if this expression represents an int value. The value of an INum object can be an int value.
        Specified by:
        isNumIntValue in interface IExpr
        Returns:
      • isRational

        public boolean isRational()
        Test if this expression is a rational number, i.e. integer or fraction number.
        Specified by:
        isRational in interface IExpr
      • isSignedNumber

        public boolean isSignedNumber()
        Test if this expression is a signed number
        Specified by:
        isSignedNumber in interface IExpr
      • isNot

        public boolean isNot()
        Test if this expression is the function Not[<arg>]
        Specified by:
        isNot in interface IExpr
      • isNumeric

        public boolean isNumeric()
        Test if this expression is a numeric number (i.e. of type INum or IComplexNum.
        Specified by:
        isNumeric in interface IExpr
      • 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:
        isNumericFunction in interface IExpr
        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 a Plus, Times expression with only real values)
        Specified by:
        isRealFunction in interface IExpr
        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
        Specified by:
        isNumber in interface IExpr
      • 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:
        isLTOrdered in interface IExpr
        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:
        isLEOrdered in interface IExpr
        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:
        isGTOrdered in interface IExpr
        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:
        isGEOrdered in interface IExpr
        Returns:
        true if this expression is canonical greater than or equal to the specified expression.
      • isAtom

        public boolean isAtom()
        Description copied from interface: IExpr
        Test if this expression is an atomic expression (i.e. no AST expression)
        Specified by:
        isAtom in interface IExpr
      • variables2Slots

        public IExpr variables2Slots(java.util.Map<IExpr,IExpr> map,
                                     java.util.List<IExpr> variableList)
        Description copied from interface: IExpr
        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.
        Specified by:
        variables2Slots in interface IExpr
        Returns:
        null if 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: IExpr
        Return the FullForm of this expression
        Specified by:
        fullFormString in interface IExpr
      • internalFormString

        public java.lang.String internalFormString(boolean symbolsAsFactoryMethod,
                                                   int depth)
        Description copied from interface: IExpr
        Return the internal Java form of this expression.
        Specified by:
        internalFormString in interface IExpr
        Parameters:
        symbolsAsFactoryMethod - if true use the F.symbol() method, otherwise print the symbol name.
        depth - the recursion depth of this call. 0 indicates "recurse without a limit".
      • leaves

        public java.util.List<IExpr> leaves()
        Specified by:
        leaves in interface IExpr
        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).
      • apply

        public IExpr apply(java.util.List<? extends IExpr> leaves)
        Specified by:
        apply in interface IExpr
        Returns:
        an IExpr instance with the current expression as head(), and leaves as leaves().
      • apply

        public IExpr apply(IExpr... leaves)
        Specified by:
        apply in interface IExpr
        Returns:
        an IExpr instance with the current expression as head(), and leaves as leaves().
      • replaceAll

        public IExpr replaceAll(IAST astRules)
        Replace all (sub-) expressions with the given rule set. If no substitution matches, the method returns null.
        Specified by:
        replaceAll in interface IExpr
        Parameters:
        astRules - rules of the form x->y or {a->b, c->d}; the left-hand-side of the rule can contain pattern objects.
        Returns:
        null if 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 returns null.
        Specified by:
        replaceAll in interface IExpr
        Parameters:
        function - if the unary functions apply() method returns null the expression isn't substituted.
        Returns:
        null if no substitution of a (sub-)expression was possible.
      • replaceRepeated

        public IExpr replaceRepeated(IAST astRules)
        Repeatedly replace all (sub-) expressions with the given rule set. If no substitution matches, the method returns this.
        Specified by:
        replaceRepeated in interface IExpr
        Parameters:
        astRules - rules of the form x->y or {a->b, c->d}; the left-hand-side of the rule can contain pattern objects.
        Returns:
        this if no substitution of a (sub-)expression was possible.
      • replaceRepeated

        public IExpr replaceRepeated(Function<IExpr,IExpr> function)
        Repeatedly replace all (sub-) expressions with the given unary function. If no substitution matches, the method returns this.
        Specified by:
        replaceRepeated in interface IExpr
        Parameters:
        function - if the unary functions apply() method returns null the expression isn't substituted.
        Returns:
        this if no substitution of a (sub-)expression was possible.
      • egcd

        public IExpr[] egcd(IExpr b)
        Description copied from interface: RingElem
        Extended greatest common divisor.
        Specified by:
        egcd in interface RingElem<IExpr>
        Parameters:
        b - other element.
        Returns:
        [ gcd(this,b), c1, c2 ] with c1*this + c2*b = gcd(this,b).
      • evaluate

        public IExpr evaluate(EvalEngine engine)
        Description copied from interface: IExpr
        Evaluate an expression
        Specified by:
        evaluate in interface IExpr
        Parameters:
        engine - the evaluation engine
        Returns:
        the evaluated Object or null if the evaluation is not possible (i.e. the evaluation doesn't change the object).
      • gcd

        public IExpr gcd(IExpr b)
        Description copied from interface: RingElem
        Greatest common divisor.
        Specified by:
        gcd in interface RingElem<IExpr>
        Parameters:
        b - other element.
        Returns:
        gcd(this,b).
      • signum

        @Deprecated
        public int signum()
        Deprecated. 
        Signum functionality is used in JAS toString() method, don't use it as math signum function.
        Specified by:
        signum in interface AbelianGroupElem<IExpr>
        Specified by:
        signum in interface IExpr
        Returns:
        the sign of this.
      • factory

        public ElemFactory<IExpr> factory()
        Description copied from interface: Element
        Get the corresponding element factory.
        Specified by:
        factory in interface Element<IExpr>
        Returns:
        factory for this Element.
      • toScript

        public java.lang.String toScript()
        Description copied from interface: Element
        Get a scripting compatible string representation.
        Specified by:
        toScript in interface Element<IExpr>
        Returns:
        script compatible representation for this Element.
      • toScriptFactory

        public java.lang.String toScriptFactory()
        Description copied from interface: Element
        Get a scripting compatible string representation of the factory.
        Specified by:
        toScriptFactory in interface Element<IExpr>
        Returns:
        script compatible representation for this ElemFactory.
      • isONE

        public boolean isONE()
        Description copied from interface: MonoidElem
        Test if this is one.
        Specified by:
        isONE in interface MonoidElem<IExpr>
        Returns:
        true if this is 1, else false.
      • isUnit

        public boolean isUnit()
        Description copied from interface: MonoidElem
        Test if this is a unit. I.e. there exists x with this.multiply(x).isONE() == true.
        Specified by:
        isUnit in interface MonoidElem<IExpr>
        Returns:
        true if this is a unit, else false.
      • remainder

        public IExpr remainder(IExpr S)
        Description copied from interface: MonoidElem
        Remainder after division of this by S.
        Specified by:
        remainder in interface MonoidElem<IExpr>
        Returns:
        this - (this / S) * S.
      • copy

        public IExpr copy()
        Description copied from interface: Element
        Clone this Element.
        Specified by:
        copy in interface Element<IExpr>
        Returns:
        Creates and returns a copy of this Element.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.