Class AbstractAST
- java.lang.Object
-
- org.matheclipse.core.expression.AbstractAST
-
- All Implemented Interfaces:
edu.jas.structure.AbelianGroupElem<IExpr>,edu.jas.structure.Element<IExpr>,edu.jas.structure.GcdRingElem<IExpr>,edu.jas.structure.MonoidElem<IExpr>,edu.jas.structure.RingElem<IExpr>,Serializable,Cloneable,Comparable<IExpr>,Iterable<IExpr>,org.hipparchus.CalculusFieldElement<IExpr>,org.hipparchus.FieldElement<IExpr>,IAST,IASTMutable,IExpr,ITensorAccess
- Direct Known Subclasses:
AbstractAST.NILPointer,AST0,ASTRealMatrix,ASTRealVector,ASTRRBTree,ASTSeriesData,B1,B2,B3,HMArrayList
public abstract class AbstractAST extends Object implements IASTMutable, Cloneable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractAST.ASTIteratorstatic classAbstractAST.NILPointerThe classNILPointerimplements the constant objectF.NIL(not in list), which indicates in the evaluation process that no evaluation was possible (i.e.-
Nested classes/interfaces inherited from interface org.matheclipse.core.interfaces.IAST
IAST.PROPERTY
-
Nested classes/interfaces inherited from interface org.matheclipse.core.interfaces.IExpr
IExpr.COMPARE_TERNARY
-
-
Field Summary
Fields Modifier and Type Field Description protected intfEvalFlagsFlags for controlling evaluation and left-hand-side pattern-matching expressionsprotected inthashValue-
Fields inherited from interface org.matheclipse.core.interfaces.IAST
BUILT_IN_EVALED, CONTAINS_DEFAULT_PATTERN, CONTAINS_NO_DEFAULT_PATTERN_MASK, CONTAINS_NO_PATTERN, CONTAINS_NUMERIC_ARG, CONTAINS_PATTERN, CONTAINS_PATTERN_EXPR, CONTAINS_PATTERN_SEQUENCE, IS_ALL_EXPANDED, IS_DECOMPOSED_PARTIAL_FRACTION, IS_DERIVATIVE_EVALED, IS_EXPANDED, IS_FLAT_ORDERLESS_EVALED, IS_FLATTENED, IS_FLATTENED_OR_SORTED_MASK, IS_HASH_EVALED, IS_LISTABLE_THREADED, IS_MATRIX, IS_MATRIX_OR_VECTOR, IS_NOT_NUMERIC_FUNCTION, IS_NOT_NUMERIC_FUNCTION_OR_LIST, IS_NUMERIC_FUNCTION, IS_NUMERIC_FUNCTION_OR_LIST, IS_NUMERIC_MASK, IS_SORTED, IS_VECTOR, NO_FLAG, NUMERIC_ARBITRARY_EVALED, NUMERIC_DOUBLE_EVALED, OUTPUT_MULTILINE, SEQUENCE_FLATTENED, TIMES_PARSED_IMPLICIT
-
Fields inherited from interface org.matheclipse.core.interfaces.IExpr
ASTID, BDDEXPRID, BIOSEQUENCEID, BLANKID, BYTEARRAYID, COMPILEFUNCTONID, COMPLEXID, DATAID, DATASETID, DATEOBJECTEXPRID, DISPATCHID, DOUBLECOMPLEXID, DOUBLEID, FILEEXPRID, FITTEDMODELID, FRACTIONID, GEOPOSITIONID, GRAPHEXPRID, IMAGEID, INPUTSTREAMEXPRID, INTEGERID, INTERPOLATEDFUNCTONID, JAVACLASSEXPRID, JAVAOBJECTEXPRID, LINEARSOLVEUNCTONID, METHODSYMBOLID, NUMERICARRAYID, OUTPUTSTREAMEXPRID, PATTERNID, QUANTITYID, SERIESID, SPARSEARRAYID, STRINGID, SYMBOLID, TESTREPORTOBJECT, TESTRESULTOBJECT, TIMEOBJECTEXPRID
-
-
Constructor Summary
Constructors Constructor Description AbstractAST()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IExpraccept(IVisitor visitor)Accept a visitor with return type Tbooleanaccept(IVisitorBoolean visitor)Accept a visitor with return typeboolean.intaccept(IVisitorInt visitor)Accept a visitor with return typeintlongaccept(IVisitorLong visitor)Accept a visitor with return typelongIASTaddEvalFlags(int i)Add an evaluation flag to the existing ones.IASTAppendableappendAtClone(int position, IExpr expr)Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and add theexprat the givenposition.IASTAppendableappendClone(IExpr expr)Append an expression to this list.IASTAppendableapply(IExpr head)Apply the given head to this expression (i.e.IASTapply(IExpr head, int start)Apply the given head to this expression (i.e.IASTapply(IExpr head, int start, int end)Apply the given head to this expression (i.e.PairasNumerDenom()Expressiona/b -> [a, b]DefaultDict<IExpr>asPowersDict()Set<IExpr>asSet()Collect all arguments of this AST in a new set.ObjectasType(Class<?> clazz)voidclearHashCache()Set the cached hash value to zero.booleancompareAdjacent(BiPredicate<IExpr,IExpr> predicate)Compare all adjacent elements from lowest to highest index and return true, if the binary predicate gives true in each step.intcompareTo(IExpr rhsExpr)Compares this expression with the specified expression for canonical order.booleancontains(Object object)Tests whether thisListcontains the specified object.IASTcopyAlloc(int capacity)IASTAppendablecopyFrom(int index)Create a copy of thisAST, which contains the same head and all elements from the givenposition(inclusive).IASTAppendablecopyFrom(int startPosition, int endPosition)Create a copy of thisAST, which contains the same head and all elements from the givenposition(inclusive).IASTAppendablecopyHead()Create a copy of thisAST, which only contains the head element of the list (i.e.IASTAppendablecopyHead(int intialCapacity)Create a copy of thisAST, which only contains the head element of the list (i.e.IASTAppendablecopyUntil(int index)Create a copy of thisAST, which contains the same head and all elements up to the givenposition(exclusive).IASTAppendablecopyUntil(int intialCapacity, int index)Create a copy of thisAST, which contains the same head and all elements up to the givenposition(exclusive).intcount(Predicate<? super IExpr> predicate, int fromIndex)Test each argument with thePredicateand sum up how often it returnstrue.intdepth(boolean heads)Calculates the depth of an expression.longdeterminePrecision()Determine precision of this expression.booleanequals(Object obj)booleanequalsArgs(IExpr that, int startPosition, int endPosition)Check if this expression and that expression are bothIASTs with the same number of arguments, where all arguments are equals each other.booleanequalsAt(int position, IExpr expr)Callsget(position).equals(expr).booleanequalsFromPosition(int from0, IAST f1, int from1)IExpr.COMPARE_TERNARYequalTernary(IExpr that, EvalEngine engine)IExprevalEvaluate(EvalEngine engine)Evaluate arguments with the headF.Evaluate, i.e.INumberevalNumber()Evaluate the expression to aINumbervalue.IRealevalReal()Evaluate the expression to aIRealvalue.IExprevaluate(EvalEngine engine)Evaluate an expressionbooleanexists(Predicate<? super IExpr> predicate, int startOffset)Check all elements by applying thepredicateto each argument in thisASTand returntrueif one of the arguments starting from indexstartOffsetsatisfy the predicate.booleanexists(ObjIntPredicate<? super IExpr> predicate, int startOffset)Check all elements by applying thepredicateto each argument in thisASTand returntrueif one of the arguments starting from indexstartOffsetsatisfy the predicate.IExprextractConditionalExpression(boolean isUnaryConditionalExpression)ExtractConditionalExpressionfrom the arguments ofthisexpression.IASTAppendable[]filter(Predicate<? super IExpr> predicate)Select all elements by applying thepredicateto each argument in thisASTand append the arguments which satisfy the predicate to the0th elementof the result array, or otherwise append it to the1st elementof the result array.IASTfilter(IASTAppendable filterAST, Predicate<? super IExpr> predicate)Select all elements by applying thepredicateto each argument in thisASTand append the arguments which satisfy the predicate to thefilterAST.IASTfilter(IASTAppendable filterAST, Predicate<? super IExpr> predicate, int maxMatches)Select all elements by applying thepredicateto each argument in thisASTand append up tomaxMatchesarguments which satisfy the predicate to thefilterAST.IASTfilter(IASTAppendable filterAST, IASTAppendable restAST, Predicate<? super IExpr> predicate)Select all elements by applying thepredicateto each argument in thisASTand append the elements which satisfy thepredicateto thefilterAST, or otherwise append it to therestAST.IASTfilter(IASTAppendable filterAST, IExpr unaryHead)Select all elements by applying thePredicates.isTrue(expr)predicate to each argument in thisASTand append the elements which satisfy thePredicates.isTrue(expr)predicate to thefilterAST.protected IASTfilterFunction(IASTAppendable filterAST, IASTAppendable restAST, Function<IExpr,IExpr> function)Select all elements by applying thefunctionto each argument in thisASTand append the result elements for which thefunctionreturns nonF.NILelements to thefilterAST, or otherwise append the argument to therestAST.IASTAppendable[]filterNIL(Function<IExpr,IExpr> function)Select all elements by applying thefunctionto each argument in thisASTand append the result elements for which the function returns nonF.NILelements to the0th elementof the result array, or otherwise append it to the1st elementof the result array.IExprfindFirst(Function<IExpr,IExpr> function)Find the first argument position, where the thefunctiondoesn't returnF.NIL.IExprfoldLeft(BiFunction<IExpr,IExpr,? extends IExpr> function, IExpr startValue, int start)Apply the functor to the elements of the range from left to right and return the final result.IExprfoldRight(BiFunction<IExpr,IExpr,? extends IExpr> function, IExpr startValue, int start)Apply the functor to the elements of the range from right to left and return the final result.booleanforAll(Predicate<? super IExpr> predicate, int startOffset)Check all elements by applying thepredicateto each argument in thisASTand returntrueif all of the arguments starting from indexstartOffsetsatisfy the predicate.booleanforAll(ObjIntPredicate<? super IExpr> predicate, int startOffset)Check all elements by applying thepredicateto each argument in thisASTand returntrueif all of the arguments starting from indexstartOffsetsatisfy the predicate.booleanforAllLeaves(Predicate<? super IExpr> predicate, int startOffset)Check all atomic (non IAST objects) leaf elements by applying thepredicateto each leaf argument in thisASTand sub-ASTs and returntrueif all of the leaf elements starting from indexstartOffsetsatisfy the predicate.booleanforAllLeaves(IExpr head, Predicate<? super IExpr> predicate, int startOffset)voidforEach(Consumer<? super IExpr> action)Iterate over allvalue-elementsfrom index1tosize()-1and call the methodConsumer.accept()for these elements.voidforEach(Consumer<? super IExpr> action, int startOffset)Iterate over allvalue-elementsfrom indexstartOffsettosize()-1and call the methodConsumer.accept()for these elements.voidforEachRule(Consumer<? super IExpr> action)Iterate over all elements from index1tosize()-1and call the methodConsumer.accept()for these elements.voidforEachRule(Consumer<? super IExpr> action, int startOffset)Iterate over all elements from indexstartOffsettosize()-1and call the methodConsumer.accept()for these elements.StringfullFormString()Return theFullForm()of this expressionprotected StringfullFormString(IExpr head)IExprgcd(IExpr that)abstract IExprget(int location)Returns the element at the specified location in thisIAST.IExprget(IInteger location)Returns the element at the specified location in thisIAST.IExprgetArg(int position, IExpr defaultValue)Returnthis.get(position)ifargSize() >= position, otherwise returndefaultValueIASTgetAST(int index)Casts anIExprat positionindexto anIAST.IExprgetAt(int index)Get the element at the specifiedindexif this object is of typeIAST.intgetEvalFlags()Get the evaluation flags for this list.intgetHashCache()Get the cached hash value.IExprgetIndex(int... positions)Low level access.IIntegergetInt(int index)Casts anIExprat positionindexto anIInteger.IASTgetList(int index)Casts anIExprwhich is a list at positionindexto anIAST.INumbergetNumber(int index)Casts anIExprat positionindexto anINumber.IExprgetOptionalValue()IExprgetPart(int... positions)Returns the element at the specified positions in the nested ASTs.IExprgetPart(it.unimi.dsi.fastutil.ints.IntList positions)Returns the element at the specified positions in the nested ASTs.ObjectgetProperty(IAST.PROPERTY key)Returns the value to which the specified property is mapped, ornullif this map contains no mapping for the property.IExprgetUnevaluated(int position)Get the argument of theIASTfunction (i.e.booleanhas(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.inthashCode()FNV-1 hash code of thisIAST.booleanhasTrigonometricFunction()Returnstrue, if one of the headers of this AST contains a trigonometric function.inthierarchy()A unique integer ID for the implementation of this expressionintindexOf(Predicate<? super IExpr> predicate, int fromIndex)If this is of typeIAST, find the first argument position, which fulfills thepredicate.intindexOf(IExpr expr)If this is of typeIAST, find the first argument position, which equalsexpr.CharSequenceinternalFormString(boolean symbolsAsFactoryMethod, int depth)Return the internal Java form of this expression.CharSequenceinternalJavaString(SourceCodeProperties properties, int depth, Function<ISymbol,? extends CharSequence> variables)Return the internal Java form of this expression.CharSequenceinternalScalaString(boolean symbolsAsFactoryMethod, int depth)Return the internal Scala form of this expression.IIntegerintSlot()If this is a slot return the slot number, otherwise returnF.CN1(value -1)booleanisAbs()Test if this expression is the functionAbs[<arg>]booleanisAllExpanded()Test if this expression and all subexpressions are already expanded i.e.booleanisAlternatives()Test if this expression is theAlternativesfunctionAlternatives[<pattern1>, <pattern2>, ...]booleanisAnd()Test if this expression is the functionAnd[<arg>,...]and has at least 2 arguments.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 function, which contains a header element (i.e.booleanisAST(String symbol)Test if this expression is anIASTfunction, where the string representation of the header element at index position0equals the givensymboland some optional argument elements at the index positions1..(size()-1).booleanisAST(String symbol, int length)Test if this expression is anIASTfunction, 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.booleanisAST(IExpr header)Test if this expression is an AST function, 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 anIASTfunction, which contains the given header element at index position0and optional argument elements at the index positions1..(length-1).booleanisAST(IExpr head, int minLength, int maxLength)Test if this expression is anIASTfunction, 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 anIASTfunction, which contains the given header element at index position0and optional argument elements at the index positions1..(length-1).booleanisAST0()Test if this expression is anIASTfunction, which contains a header element (i.e.booleanisAST1()Test if this expression is anIASTfunction, which contains a header element (i.e.booleanisAST2()Test if this expression is anIASTfunction, which contains a header element (i.e.booleanisAST3()Test if this expression is anIASTfunction, which contains a header element (i.e.booleanisASTSizeGE(IExpr header, int length)Test if this expression is anIASTfunction, which contains the given header element at index position0and optional argument elements at the index positions1..n.booleanisAtom()Test if this expression is an atomic expression (i.e.booleanisBooleanFormula()Test if this expression is a boolean formula (i.e.booleanisBooleanFunction()Test if this expression is a boolean function with headAnd, Equivalent, Nand, Nor, Not, Or, Xor.booleanisBooleanResult()Test if this expression is a boolean function (i.e.booleanisComparatorFunction()Test if this expression is a comparator function (i.e.booleanisComplexInfinity()Test if this expression is representing ComplexInfinity (i.e.booleanisCondition()Test if this expression is the Condition functionCondition[<arg1>, <arg2>]booleanisConditionalExpression()Test if this expression is the ConditionalExpression functionConditionalExpression[<arg1>, <arg2>]booleanisConjugate()Test if this expression is the functionConjugate[<arg>]booleanisContinuousDistribution()Test if this expression is a continuous distribution AST (i.e.booleanisCos()Test if this expression is the functionCos[<arg>]booleanisCosh()Test if this expression is the functionCosh[<arg>]booleanisDefer()Test if this expression is the functionDefer[<arg>]IAST[]isDerivative()Test if this expression is aDerivative[number, ...][symbol][arg,...]orDerivative[number][symbol]expression and return the correspondingIASTstructures.IAST[]isDerivativeAST1()Test if this expression is aDerivative[number][symbol][arg]orDerivative[number][symbol]expression with one argument and return the correspondingIASTstructures.booleanisDirectedInfinity()Test if this expression is representing a DirectedInfinity (i.e.booleanisDirectedInfinity(IExpr x)Test if this expression is representing a DirectedInfinity (i.e.booleanisDiscreteDistribution()Test if this expression is a discrete distribution AST (i.e.booleanisDistribution()Test if this expression is a distribution AST (i.e.booleanisEdge()Test if this expression is an DirectedEdge, UndirectedEdge, Rule, TwoWayRule.booleanisEmpty()Test if this AST contains no argumentbooleanisEmptyIntervalData()booleanisEmptyList()Test if this expression is an empty list (i.e.booleanisEqual()Test if this expression is the functionEqual[<arg1>, <arg2>]booleanisEvalFlagOff(int i)Are the given evaluation flags disabled for this list ?booleanisEvalFlagOn(int i)Are the given evaluation flags enabled for this list ?booleanisExcept()Test if this expression is theExceptfunctionExcept(<pattern1>)orExcept(<pattern1>, <pattern2>)booleanisExpanded()Test if this expression is already expanded i.e.booleanisFlatAST()Test if this expression is an AST list, which contains a header element (i.e.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.booleanisFree(IPatternMatcher predicate, boolean heads)Returnstrue, if all of the elements in the subexpressions or the expression itself, did not satisfy the given unary predicate.booleanisFreeAST(Predicate<IExpr> predicate)Returnstrue, if all of the elements in the subexpressions or the expression itself, aren't ASTs with a head which match the given predicate.booleanisFreeAST(IExpr pattern)Returnstrue, if all of the elements in the subexpressions or the expression itself, aren't ASTs with a head which match the given pattern.booleanisFreeAt(int position, IExpr pattern)Returnstrue, if all of the elements in the expressions or the expression itself at the givenposition, did not match thepattern.booleanisFreeOfPatterns()Returnstrue, if all of the elements in the subexpressions or the expression itself, are no pattern objects.booleanisFunction()Test if this expression is aFunction( arg1 )orFunction( arg1, arg2 )expression with at least 1 argument.booleanisFunctionID(int... builtinIDs)Test if this expression is anIASTfunction with one of the built-in head IDs.booleanisGEOrdered(IExpr obj)Compares this expression with the specified expression for order.booleanisGTOrdered(IExpr obj)Compares this expression with the specified expression for order.booleanisHoldAllCompleteAST()Test if this expression is an AST list, which contains a header element with attributeISymbol.HOLDALLCOMPLETEat index position0.booleanisHoldPatternOrLiteral()Test if this expression is theHoldPatternfunctionHoldPattern[<expression>]or the deprecatedLiteral[<expression>]form.booleanisHyperbolicFunction()Test if this expression is a hyperbolic function.intisInexactVector()booleanisInfinity()Test if this expression is representingInfinity(i.e.booleanisIntegerResult()Test if this expression is a integer function (i.e.booleanisInterval()Test if this expression is a closed interval expression with one or moreList[min, max]argumentsInterval[{min1, max1}, {min2, max2}, ...]which represent the union of the interval ranges.booleanisInterval1()Test if this expression is a closed/open ended interval expression with oneList[min, max]argumentInterval[{min, max}]booleanisIntervalData()Test if this expression is a mixed opened/closed interval expression with one or more{min, Less/LessEqual, Less/LessEqual, max}list arguments which represent the union of the interval ranges.booleanisList()Test if this expression is a list (i.e.booleanisList(int[] dimensions)Test if this expression is a nested list with the dimensions.booleanisList(Predicate<IExpr> pred)Test if this expression is a list (i.e.booleanisListableAST()Test if this expression is anIASTlist, which contains a header element (i.e.org.jgrapht.GraphTypeisListOfEdges()Test if this expression is a list of DirectedEdge or UndirectedEdgebooleanisListOfLists()Test if this expression is a list of lists{{...},{...},...}and contains at least 1 sublist.booleanisListOfMatrices()Test if this expression is a list of matrices and contains at least 1 matrix.booleanisListOfPoints(int pointDimension)Test ifthisis a list of points in the given dimension.booleanisListOfRules(boolean ignoreEmptySublists)Test if this expression is a list of rules (head Rule or RuleDelayed)booleanisListOfRulesOrAssociation(boolean ignoreEmptySublists)Test if this expression is a list of rules (head Rule or RuleDelayed) or an Association.booleanisListOfStrings()Test if this expression is a list of strings and contains at least 1 element.booleanisLog()Test if this expression is the functionLog[<arg>]int[]isMatrix(boolean setMatrixFormat)Test if this expression is a matrix and return the dimensions as array [row-dimension, column-dimension].int[]isMatrixIgnore()Test if this expression is a matrix and return the dimensions as array [row-dimension, column-dimension].booleanisMember(IExpr pattern, boolean heads, IVisitorBoolean visitor)Returnstrue, if at least one of the elements in the subexpressions, match the given pattern.booleanisModule()Test if this expression is the Module functionModule[<arg1>, <arg2>]booleanisModuleOrWithCondition()booleanisNegative()Test if this object is a negative signed number.booleanisNegativeInfinity()Test if this expression is representing-Infinity(i.e.booleanisNegativeResult()Test if this expression has a negative result (i.e.booleanisNonEmptyList()Test if this expression is a list with at least one element (i.e.booleanisNonNegativeResult()Test if this expression has a non-negative result (i.e.booleanisNot()Test if this expression is the functionNot[<arg>].booleanisNotEmpty()Test if this expression is anIASTand contains at least 1 argumentbooleanisNumericArgument(boolean allowList)Test if this expression is a numeric number (i.e.booleanisNumericAST()Test if this expression is an IAST and contains at least one numeric argument.booleanisNumericFunction(boolean allowList)Test if this expression is a numeric function (i.e.booleanisNumericFunction(Function<IExpr,String> list)Test if this expression is a numeric function (i.e.booleanisNumericFunction(VariablesSet varSet)Test if this expression is a numeric function (i.e.booleanisNumericFunction(IExpr expr)Test if this expression is a numeric function (i.e.booleanisNumericMode()Test if this expression contains a numeric number (i.e.booleanisOneIdentityAST1()Test if this expression is an AST list, which contains a header element (i.e.booleanisOptional()Test if this expression is theOptionalfunctionOptional[<pattern>]orOptional[<pattern>, <value>]booleanisOr()Test if this expression is the functionOr[<arg>,...]and has at least 2 arguments.booleanisOrderlessAST()Test if this expression is an AST list, which contains a header element (i.e.booleanisPatternDefault()Returntrue, if the expression is a pattern object with an associated default value (for example0is the default value for the addition expressionx_+y_.booleanisPatternExpr()Test if this expression or a subexpression is a pattern object.booleanisPatternMatchingFunction()Test if this expression is a special pattern-matching function (i.e.booleanisPatternTest()Test if this expression is thePatternTestfunctionPatternTest[<pattern>, <test>]int[]isPiecewise()Test if this expression is aPiecewise({{...}}},...)function and the first argument is a matrix with dimension[row-dimension, 2]androw-dimension > 0.booleanisPlus()Test if this expression is the addition functionPlus[<arg1>, <arg2>, ...]with at least 2 arguments.booleanisPlus2()Test if this expression is theS.PlusfunctionPlus[<arg1>, <arg2>]with exactly 2 arguments.booleanisPlus3()Test if this expression is theS.PlusfunctionPlus[<arg1>, <arg2>, <arg3>]with exactly 3 arguments.booleanisPlusTimesPower()Test if this expression is aPlus, Power or Timesfunction.booleanisPolynomial(IAST variables)Test if this expression is a polynomial for the given list ofvariables.booleanisPolynomial(IExpr variable)Test if this expression is a polynomial for the givenvariable.booleanisPolynomialOfMaxDegree(IAST variables, long maxDegree)booleanisPolynomialOfMaxDegree(ISymbol variable, long maxDegree)Test if this expression is a polynomial ofmaxDegree(i.e.booleanisPolynomialStruct()Test if this expression has a polynomial structiure, i.e.booleanisPositive()Test if this object is a positive signed number.booleanisPositiveResult()Test if this expression has a positive result (i.e.booleanisPossibleZero(boolean fastTest)Test if this expression equals0in symbolic or numeric mode.booleanisPower()Test if this expression is the functionPower[<arg1>, <arg2>]booleanisPureFunction()Test if this expression is a "pure" or "anonymous"Function( arg1 )expression with exactly 1 argument.booleanisRationalResult()Test if this expression is a symbolic rational function (i.e.booleanisRealMatrix()Test if this expression is a real matrix (i.e.booleanisRealResult()Test if this expression is a real function (i.e.booleanisRealVector()Test if this expression is a real vector (i.e.booleanisRule()Test if this expression is of the formRule[<arg1>, <arg2>].booleanisRuleAST()Test if this expression is of the formRule[<arg1>, <arg2>]orRuleDelayed[<arg1>, <arg2>].booleanisRuleDelayed()Test if this expression is of the formRuleDelayed[<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.booleanisSameHead(ISymbol head)Check if the object at index 0 (i.e.booleanisSameHead(ISymbol head, int length)Check if the object at index 0 (i.e.booleanisSameHead(ISymbol head, int minLength, int maxLength)Check if the object at index 0 (i.e.booleanisSequence()Test if this expression is a sequence (i.e.booleanisSin()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>](i.e.booleanisSlotSequence()Test if this expression is the functionSlotSequence[<integer-value>]int[]isSpan(int size)Test if this expression is the functionSpan[...]with 2 or 3 arguments.booleanisSubscript()Test if this expression is the functionSubscript[var, <integer-value>].booleanisTan()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>, ...]with at least 2 arguments.booleanisTimes2()Test if this expression is theS.TimesfunctionTimes[<arg1>, <arg2>]with exactly 2 arguments.booleanisTimes3()Test if this expression is theS.TimesfunctionTimes[<arg1>, <arg2>, <arg3>]with exactly 3 arguments.booleanisTrigFunction()Test if this expression is a trigonometric function.booleanisUnevaluated()Test if this expression is the functionUnevaluated[<arg>]booleanisUnit()booleanisValue()Returnstrue, if this symbol or ast expression is bound to a value (i.e.booleanisVariable(boolean polynomialQTest)Test if this expression is a variable which doesn't has attributeISymbol.CONSTANT.intisVector()Test if this expression is a vector and return the length of the vector.booleanisWith()Test if this expression is the With functionWith[<arg1>, <arg2>]Iterator<IExpr>iterator()Returns an iterator over the elements in thisIASTstarting with offset 1.IExprlast()Get the last element of theASTlist (i.e.intlastIndexOf(IExpr object)longleafCount()Count the number of indivisible subexpressions (atoms/leaves) of this expression.longleafCountSimplify()Count the number of leaves of this expression; for integer numbers in exact integer, fractional and complex numbers count the digits of the integers.IExpr[]linear(IExpr variable)If this is a linear expressiona + b * xreturn the addendaat index0and the multiplicantbat index1IExpr[]linearPower(IExpr variable)If this is an expression of the forma + b * x^nwithninteger, return the addend at index0and the multiplicant at index1and the exponentnat index2.IExprlower()If this is aInterval[{lower, upper}]expression return thelowervalue.IASTmakeAST(IExpr head)ReturnthisifisAST(head)==true, otherwise create a new list{this}from this (i.e.IASTmakeList()ReturnthisifisList()==true, otherwise create a new list{this}from this (i.e.IASTmap(Function<IExpr,? extends IExpr> function)Maps the elements of this IAST with the unaryfunctor.IASTmap(Function<IExpr,? extends IExpr> function, int startOffset)Maps the elements of this IAST with the unaryfunctor.IASTmap(IASTAppendable resultAST, IAST secondAST, BiFunction<IExpr,IExpr,IExpr> function)Maps the elements of this IAST with the elements of thesecondAST.IASTAppendablemap(IASTAppendable astResult, IUnaryIndexFunction<IExpr,IExpr> function)Append the mapped ranges elements directly to the givenlistIASTmap(IASTMutable clonedResultAST, Function<IExpr,IExpr> function)Maps the elements of this IAST with the unary functor.IASTmap(IExpr head, Function<IExpr,IExpr> function)Maps the elements of this IAST with the unary functor.IASTmapLeaf(IExpr testHead, Function<IExpr,IExpr> function, int startOffset)Maps the leafs (relative totestHead) of this IAST with the unary functor.IASTmapLeft(IASTAppendable list, BiFunction<IExpr,IExpr,IExpr> binaryFunction, IExpr leftArg)Append the mapped ranges elements directly to the givenlistIExprmapMatrixColumns(int[] dim, Function<IExpr,IExpr> f)This method assumes thatthisis a list of list in matrix form.IASTmapReverse(Function<IExpr,IExpr> function)Maps the elements of this IAST in the reversed order with the unaryfunctor.IASTmapRight(IASTAppendable list, BiFunction<IExpr,IExpr,IExpr> binaryFunction, IExpr rightArg)Append the mapped ranges elements directly to the givenlistIASTMutablemapThread(Function<IExpr,IExpr> function)Maps the elements of this IAST on the first level of arguments with the unaryfunction.IASTMutablemapThread(IAST replacement, int position)Ifthisis anIAST:IASTMutablemapThread(IAST that, BiFunction<IExpr,IExpr,IExpr> function)Maps the elements ofthisIAST and ofthatIAST on the first level of arguments with the binaryfunction.IASTAppendablemapThreadEvaled(EvalEngine engine, IASTAppendable appendAST, IAST replacement, int position)Maps the elements of this IAST with the unary functorFunctors.replaceArg(replacement, position), therereplacementis an IAST at which the argument at the given position will be replaced by the currently mapped element and appends the element toappendAST.IASTMutablemapThreadEvaled(EvalEngine engine, IAST replacement, int position)Maps the elements of thisIASTon the first level of arguments with the evaluated unary functorFunctors.replaceArg(replacement, position), therereplacementis an IAST at which the argument at the given position will be replaced by the currently mapped element.IExprnegative()Additionalnegativemethod, which works like opposite to fulfill groovy's method signatureIExprnormal(boolean nilIfUnevaluated)Converts a special expression (like a series, association, dataset, sparse array, ...) into a standard normalized expression.IExproneIdentity(IExpr defaultValue)Return the argument at index 1, if theargSize() == 1.IExpropposite()Returns anIExprwhose value is(-1) * this.IExproptional()TheF.NIL#optional()method always returnsthat.IASTorElse(IAST other)ReturnthisifthisunequalsF.NIL, otherwise returnother.IASTpartition(ISymbol operator, Predicate<? super IExpr> predicate, IExpr init1, IExpr init2, ISymbol combiner, ISymbol action)Select all elements by applying thepredicateto each argument in thisASTand append the arguments which satisfy the predicate to the1st elementof the resulting AST, or otherwise append it to the2nd elementof the resulting AST.IASTpartitionPlus(Predicate<? super IExpr> predicate, IExpr initYes, IExpr initNo, ISymbol action)Select all elements by applying thepredicateto each argument in thisPlus(...)expression and append the arguments which satisfy the predicate to the1st elementof the resulting AST, or otherwise append it to the2nd elementof the resulting AST.IASTpartitionTimes(Predicate<? super IExpr> predicate, IExpr initYes, IExpr initNo, ISymbol action)Select all elements by applying thepredicateto each argument in thisTimes(...)expression and append the arguments which satisfy the predicate to the1st elementof the resulting AST, or otherwise append it to the2nd elementof the resulting AST.intpatternHashCode()Calculate a special hash value to find a matching rule in a hash tableIASTAppendableprependClone(IExpr expr)Prepend an expression to this list.ObjectputProperty(IAST.PROPERTY key, Object value)Associates the specified value with the specified property in the associatedEnumMap<PROPERTY, Object>map.IASTAppendableremove(Predicate<? super IExpr> predicate)Removes all objects which satisfy the given predicate.IASTAppendableremoveAtClone(int position)Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and remove the element at the givenposition.IASTMutableremoveAtCopy(int position)Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and remove the element at the givenposition.IASTremoveIf(Predicate<? super IExpr> predicate)Removes all the elements from this list which satisfies the given predicate and return the result as a new ListIASTAppendableremovePositionsAtCopy(int[] removedPositions, int untilIndex)Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and remove the elements defined in the givenremovedPositionsArrayup tountilIndex(exclusive).IASTremovePositionsAtCopy(Predicate<IExpr> predicate)IASTAppendablereverse(IASTAppendable resultList)Append the elements in reversed order to the givenlistIExprrewrite(int functionID)IASTrotateLeft(IASTAppendable resultList, int n)Rotate the ranges elements to the left by n places and append the resulting elements to thelistIASTrotateRight(IASTAppendable resultList, int n)Rotate the ranges elements to the right by n places and append the resulting elements to thelistIASTselect(Predicate<? super IExpr> predicate)Select all elements by applying thepredicateto each argument in thisASTand append the arguments which satisfy the predicate.IASTselect(Predicate<? super IExpr> predicate, int maxMatches)Select all elements by applying thepredicateto each argument in thisASTand append up tomaxMatchesarguments which satisfy the predicate.IASTAppendablesetAtClone(int position, IExpr expr)Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and set theexprat the givenposition.voidsetEvalFlags(int i)Set the evaluation flags for this list (i.e.IExprsetPart(IExpr value, int... positions)intsignum()Deprecated.voidsortInplace(Comparator<IExpr> comparator)Sortthisin place using functioncomparator#compare(a, b).IASTsplice(int index, int howMany, IExpr... items)Thesplice()method adds/removes items to/from an AST copy, and returns the copy.Stream<IExpr>stream()Returns a sequentialStreamwhich starts at index1of the specified array as its source.Stream<IExpr>stream(int startInclusive, int endExclusive)Returns a sequentialStreamwith the specified range of the specified array as its source.IExprtimesDistributed(IExpr that)Returns anIExprwhose value is(this * that).boolean[][]toBooleanMatrix()boolean[]toBooleanVector()Convert thisIASTto a boolean vector.boolean[]toBooleValueVector()Convert thisIASTto a boolean vector.byte[][]toByteMatrix()Convert this object into abyte[][]matrix.org.hipparchus.complex.Complex[][]toComplexMatrix()org.hipparchus.complex.Complex[]toComplexVector()Convert this object into aComplex[]vector.double[][]toDoubleMatrix()Convert this object into adouble[][]matrix.double[][]toDoubleMatrixIgnore()Convert this object into adouble[]matrix, if a row is not convertible to double vector ignore the row.double[]toDoubleVector()Convert this object into adouble[]vector.double[]toDoubleVectorIgnore()Convert this object into adouble[]vector, if an argument is not convertible to double ignore the value.int[][]toIntMatrix()Convert this object into abyte[][]matrix.int[]toIntVector()Convert this object into aint[]vector.ISymboltopHead()Returns the ISymbol of the IAST.org.hipparchus.linear.RealMatrixtoRealMatrixIgnore()Convert this object into a RealMatrix.StringtoString()IExprupper()If this is aInterval({lower, upper})expression return theuppervalue.IExprvariables2Slots(Map<IExpr,IExpr> map, Collection<IExpr> variableCollector)Convert the variables (i.e.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hipparchus.CalculusFieldElement
getExponent, isFinite, isInfinite, isNaN, norm, round
-
Methods inherited from interface org.matheclipse.core.interfaces.IAST
acceptChecked, arg1, arg2, arg3, arg4, arg5, argSize, containsAll, copy, copyAppendable, copyAppendable, copyAST, copyTo, copyTo, count, exists, exists, existsLeft, extract, findFirstEquals, first, forAll, forAll, forEach, forEach, forEach, forEach, forEach, forEach, functionEvaled, getItems, getRule, getRule, getRule, getValue, hasNumericArgument, hasOptionalArgument, isASTOrAssociation, isNotDefined, isNumberOrInfinity, isRealsIntervalData, isSameHeadSizeGE, joinToString, joinToString, mapAt, mapLeaf, most, oneIdentity0, oneIdentity1, removeFromEnd, removeFromStart, rest, second, setAtCopy, size, slice, splice, stream0, toArray, toArray
-
Methods inherited from interface org.matheclipse.core.interfaces.IASTMutable
set, setApply, setArgs, setArgs, setIf, setIfPresent, setValue, sortInplace
-
Methods inherited from interface org.matheclipse.core.interfaces.IExpr
$div, $minus, $plus, $times, $up, abs, acos, acosh, add, add, and, apply, apply, asBaseExp, asCoeffAdd, asCoeffAdd, asCoeffAdd, asCoeffExponent, asCoeffmul, asCoeffmul, asCoeffmul, asCoeffmul, asCoeffMul, asCoeffMul, asin, asinh, asLeadingTerm, asLeadingTerm, asLeadingTerm, asLeadingTerm, atan, atan2, atanh, base, cancel, cbrt, ceil, compareToNumerical, complexArg, conjugate, constantArray, copySign, copySign, copySign, cos, cosh, dec, divide, divide, egcd, equalsArgs, equalTo, erf, erfc, eval, eval, evalAsLeadingTerm, evalBinary64, evalComplex, evalDouble, evalf, evalf, evalfc, evalfc, evalNIL, evaluateHead, evaluateOrElse, exp, expm1, exponent, factory, floor, fresnelC, fresnelS, gaussianIntegers, getField, getPi, getReal, greater, greaterEqual, greaterEqualThan, greaterEqualThan, greaterThan, greaterThan, has, has, has, hasComplexNumber, hasFree, head, headID, hypergeometric0F1, hypergeometric1F1, hypergeometric2F1, hypot, ifPresent, im, inc, indexOf, inverse, isAssociation, isBlank, isBooleanFormulaSymbol, isBuiltInSymbol, isBuiltInSymbolID, isComparatorFunctionSymbol, isComplex, isComplexNumeric, isConstantAttribute, isCoreFunctionSymbol, isDataset, isE, isEvenResult, isExactNumber, isExp, isFactorSqrtExpr, isFalse, isFraction, isFree, isFree, isHoldOrHoldFormOrDefer, isImaginaryUnit, isIndeterminate, isInexactNumber, isInteger, isInvalid, isLEOrdered, isList1, isList2, isList3, isList4, isListOfRules, isListOrAssociation, isLTOrdered, isMachineNumber, isMathematicalIntegerNegative, isMathematicalIntegerNonNegative, isMatrix, isMember, isMinusOne, isNegativeImaginaryUnit, isNegativeSigned, isNIL, isNonZeroComplexResult, isNonZeroRealResult, isNumber, isNumEqualInteger, isNumEqualRational, isNumeric, isNumericArgument, isNumericArray, isNumericFunction, isNumIntValue, isOne, isONE, isOptionsPattern, isPattern, isPatternOptional, isPatternSequence, isPi, isPowerReciprocal, isPredicateFunctionSymbol, isPresent, isQuantity, isRational, isRationalValue, isReal, isRealConstant, isRealNumber, isReNegativeResult, isRepeated, isRePositiveResult, isRGBColor, isSparseArray, isSqrt, isSqrtExpr, isString, isString, isStringIgnoreCase, isSymbol, isSymbolOrPattern, isTrue, isUndefined, isUnequalResult, isVariable, isZero, isZERO, isZeroResult, leadTerm, leadTerm, less, lessEqual, lessEqualThan, lessEqualThan, lessThan, lessThan, linearCombination, linearCombination, linearCombination, linearCombination, linearCombination, linearCombination, linearCombination, linearCombination, log, log10, log1p, mapExpr, minus, mod, multiply, multiply, multiply, multiplyDistributed, negate, newInstance, one, or, orElse, orElseGet, orElseThrow, plus, pow, pow, pow, power, power, re, reciprocal, remainder, remainder, replaceAll, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceRepeated, rint, rootN, roundExpr, scalb, sign, sin, sinCos, sinh, sinhCosh, sqr, sqrt, subs, subtract, subtract, sum, tan, tanh, times, toDegrees, toDoubleDefault, toDoubleDefault, together, toIntDefault, toIntDefault, toLongDefault, toLongDefault, toMMA, toNumber, toNumber, toRadians, toRealMatrix, toRealVector, toScript, toScriptFactory, toWolframString, trigsimp, ulp, unequalTo, unitStep, zero
-
Methods inherited from interface java.lang.Iterable
spliterator
-
-
-
-
Method Detail
-
accept
public final boolean accept(IVisitorBoolean visitor)
Accept a visitor with return typeboolean. The visitor should returntrueif one of it's members fulfills the specific condition of the visitor.
-
accept
public final int accept(IVisitorInt visitor)
Accept a visitor with return typeint
-
accept
public long accept(IVisitorLong visitor)
Accept a visitor with return typelong
-
addEvalFlags
public final IAST addEvalFlags(int i)
Add an evaluation flag to the existing ones.- Specified by:
addEvalFlagsin interfaceIAST- Specified by:
addEvalFlagsin interfaceIExpr- Returns:
-
appendAtClone
public IASTAppendable appendAtClone(int position, IExpr expr)
Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and add theexprat the givenposition.- Specified by:
appendAtClonein interfaceIAST- Returns:
- a clone with added
exprelement at the givenposition.
-
appendClone
public IASTAppendable appendClone(IExpr expr)
Append an expression to this list.- Specified by:
appendClonein interfaceIAST- Parameters:
expr- the expression which should be appended- Returns:
thisafter appending the given expression.
-
apply
public IASTAppendable apply(IExpr head)
Description copied from interface:IASTApply the given head to this expression (i.e. create a list copy and replace the old head with the given one).F.List(a,b,c).apply(F.Max)givesMax(a,b,c)
-
apply
public final IAST apply(IExpr head, int start)
Description copied from interface:IASTApply the given head to this expression (i.e. create a sublist clone starting from index start and replacing the old head with the given one)
-
apply
public IAST apply(IExpr head, int start, int end)
Description copied from interface:IASTApply the given head to this expression (i.e. create a sublist clone from index start to end, and replacing the old head with the given one)
-
getUnevaluated
public IExpr getUnevaluated(int position)
Description copied from interface:IASTGet the argument of theIASTfunction (i.e.IAST.get(int)) and if the expression is the functionF.Unevaluated(IExpr)return the first argument of theF.Unevaluated(IExpr)function.- Specified by:
getUnevaluatedin interfaceIAST- Returns:
-
asNumerDenom
public Pair asNumerDenom()
Description copied from interface:IExprExpressiona/b -> [a, b]- Specified by:
asNumerDenomin interfaceIExpr- Returns:
-
asPowersDict
public DefaultDict<IExpr> asPowersDict()
- Specified by:
asPowersDictin interfaceIExpr
-
asSet
public Set<IExpr> asSet()
Description copied from interface:IASTCollect all arguments of this AST in a new set.
-
clearHashCache
public void clearHashCache()
Description copied from interface:IASTSet the cached hash value to zero.- Specified by:
clearHashCachein interfaceIAST
-
compareAdjacent
public boolean compareAdjacent(BiPredicate<IExpr,IExpr> predicate)
Compare all adjacent elements from lowest to highest index and return true, if the binary predicate gives true in each step. If the size is < 2 the method returns false;- Specified by:
compareAdjacentin interfaceIAST- Parameters:
predicate- the binary predicate- Returns:
falseif the first comparison fails
-
compareTo
public int compareTo(IExpr rhsExpr)
Compares this expression with the specified expression for canonical 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.- Specified by:
compareToin interfaceComparable<IExpr>- Specified by:
compareToin interfaceedu.jas.structure.Element<IExpr>- Specified by:
compareToin interfaceIExpr- See Also:
S.Order,S.NumericalOrder
-
contains
public boolean contains(Object object)
Tests whether thisListcontains the specified object.
-
copyAlloc
public IAST copyAlloc(int capacity)
-
copyFrom
public IASTAppendable copyFrom(int index)
Create a copy of this
AST, which contains the same head and all elements from the givenposition(inclusive).
-
copyFrom
public IASTAppendable copyFrom(int startPosition, int endPosition)
Create a copy of this
AST, which contains the same head and all elements from the givenposition(inclusive).
-
copyHead
public IASTAppendable copyHead()
Create a copy of this
AST, which only contains the head element of the list (i.e. the element with index 0). ForASTAssociations create a copy of the full formAST, which only contains the headS.Association(i.e. the element with index 0). In further evaluation steps this full form can be converted back into a realASTAssociation.This also allows to set the header object to an arbitrary expression.
-
copyHead
public IASTAppendable copyHead(int intialCapacity)
Create a copy of this
AST, which only contains the head element of the list (i.e. the element with index 0) and allocate theintialCapacitysize of entries for the arguments.This also allows to set the header object to an arbitrary expression.
-
copyUntil
public IASTAppendable copyUntil(int index)
Create a copy of thisAST, which contains the same head and all elements up to the givenposition(exclusive).
-
copyUntil
public IASTAppendable copyUntil(int intialCapacity, int index)
Create a copy of thisAST, which contains the same head and all elements up to the givenposition(exclusive).
-
count
public int count(Predicate<? super IExpr> predicate, int fromIndex)
Description copied from interface:IASTTest each argument with thePredicateand sum up how often it returnstrue.
-
depth
public int depth(boolean heads)
Calculates the depth of an expression. Atomic expressions (no sublists) have depth1Example: the nested list[x,[y]]has depth3
-
determinePrecision
public long determinePrecision()
Determine precision of this expression. Return -1 for symbolic evaluation.- Specified by:
determinePrecisionin interfaceIExpr- Returns:
- the precision of this expression. -1 for symbolic evaluation.
-
equals
public boolean equals(Object obj)
-
equalsArgs
public boolean equalsArgs(IExpr that, int startPosition, int endPosition)
Check if this expression and that expression are bothIASTs with the same number of arguments, where all arguments are equals each other.- Specified by:
equalsArgsin interfaceIExprstartPosition- (inclusive)endPosition- (exclusive)- Returns:
-
equalsAt
public final boolean equalsAt(int position, IExpr expr)Callsget(position).equals(expr).
-
equalsFromPosition
public final boolean equalsFromPosition(int from0, IAST f1, int from1)
-
equalTernary
public IExpr.COMPARE_TERNARY equalTernary(IExpr that, EvalEngine engine)
- Specified by:
equalTernaryin interfaceIExpr
-
evalNumber
public final INumber evalNumber()
Evaluate the expression to aINumbervalue.- Specified by:
evalNumberin interfaceIExpr- Returns:
nullif the conversion is not possible.
-
evalReal
public final IReal evalReal()
Evaluate the expression to aIRealvalue.
-
evalEvaluate
public IExpr evalEvaluate(EvalEngine engine)
Evaluate arguments with the headF.Evaluate, i.e.f(a, ... , Evaluate(x), ...)- Parameters:
engine- the evaluation engine- Returns:
-
evaluate
public IExpr evaluate(EvalEngine engine)
Evaluate an expression
-
exists
public boolean exists(ObjIntPredicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicateto each argument in thisASTand returntrueif one of the arguments starting from indexstartOffsetsatisfy the predicate.
-
exists
public boolean exists(Predicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicateto each argument in thisASTand returntrueif one of the arguments starting from indexstartOffsetsatisfy the predicate.
-
filterNIL
public final IASTAppendable[] filterNIL(Function<IExpr,IExpr> function)
Select all elements by applying thefunctionto each argument in thisASTand append the result elements for which the function returns nonF.NILelements to the0th elementof the result array, or otherwise append it to the1st elementof the result array.
-
filter
public IAST filter(IASTAppendable filterAST, IASTAppendable restAST, Predicate<? super IExpr> predicate)
Select all elements by applying thepredicateto each argument in thisASTand append the elements which satisfy thepredicateto thefilterAST, or otherwise append it to therestAST.
-
filter
public final IAST filter(IASTAppendable filterAST, IExpr unaryHead)
Select all elements by applying thePredicates.isTrue(expr)predicate to each argument in thisASTand append the elements which satisfy thePredicates.isTrue(expr)predicate to thefilterAST.
-
filter
public IAST filter(IASTAppendable filterAST, Predicate<? super IExpr> predicate)
Select all elements by applying thepredicateto each argument in thisASTand append the arguments which satisfy the predicate to thefilterAST.
-
filter
public IAST filter(IASTAppendable filterAST, Predicate<? super IExpr> predicate, int maxMatches)
Select all elements by applying thepredicateto each argument in thisASTand append up tomaxMatchesarguments which satisfy the predicate to thefilterAST.
-
select
public IAST select(Predicate<? super IExpr> predicate)
Description copied from interface:IASTSelect all elements by applying thepredicateto each argument in thisASTand append the arguments which satisfy the predicate.
-
select
public IAST select(Predicate<? super IExpr> predicate, int maxMatches)
Description copied from interface:IASTSelect all elements by applying thepredicateto each argument in thisASTand append up tomaxMatchesarguments which satisfy the predicate.
-
filter
public IASTAppendable[] filter(Predicate<? super IExpr> predicate)
Select all elements by applying thepredicateto each argument in thisASTand append the arguments which satisfy the predicate to the0th elementof the result array, or otherwise append it to the1st elementof the result array.
-
removeIf
public IAST removeIf(Predicate<? super IExpr> predicate)
Removes all the elements from this list which satisfies the given predicate and return the result as a new List
-
filterFunction
protected IAST filterFunction(IASTAppendable filterAST, IASTAppendable restAST, Function<IExpr,IExpr> function)
Select all elements by applying thefunctionto each argument in thisASTand append the result elements for which thefunctionreturns nonF.NILelements to thefilterAST, or otherwise append the argument to therestAST.- Parameters:
filterAST- the nonF.NILelements which were returned by thefunction#apply()methodrestAST- the arguments in thisASTfor which thefunction#apply()method returnedF.NILfunction- the function which filters each argument by returning a value which unequalsF.NIL- Returns:
- the given
filterAST
-
foldLeft
public IExpr foldLeft(BiFunction<IExpr,IExpr,? extends IExpr> function, IExpr startValue, int start)
Apply the functor to the elements of the range from left to right and return the final result. Results do accumulate from one invocation to the next: each time this method is called, the accumulation starts over with value from the previous function call.
-
foldRight
public IExpr foldRight(BiFunction<IExpr,IExpr,? extends IExpr> function, IExpr startValue, int start)
Apply the functor to the elements of the range from right to left and return the final result. Results do accumulate from one invocation to the next: each time this method is called, the accumulation starts over with value from the previous function call.
-
forAll
public boolean forAll(ObjIntPredicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicateto each argument in thisASTand returntrueif all of the arguments starting from indexstartOffsetsatisfy the predicate.Note: If this is an
IAssociationthe rule at the position will be returned.
-
forAll
public boolean forAll(Predicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicateto each argument in thisASTand returntrueif all of the arguments starting from indexstartOffsetsatisfy the predicate.Note: If this is an
IAssociationthe rule at the position will be returned.
-
forAllLeaves
public boolean forAllLeaves(Predicate<? super IExpr> predicate, int startOffset)
Check all atomic (non IAST objects) leaf elements by applying thepredicateto each leaf argument in thisASTand sub-ASTs and returntrueif all of the leaf elements starting from indexstartOffsetsatisfy the predicate.- Specified by:
forAllLeavesin interfaceIAST- Parameters:
predicate- the predicate which filters each argument in thisASTstartOffset- start offset from which the leaf elements have to be tested- Returns:
- the
trueif the predicate is true for all elements orfalseotherwise
-
forAllLeaves
public boolean forAllLeaves(IExpr head, Predicate<? super IExpr> predicate, int startOffset)
Description copied from interface:IASTCheck allIASTrecursively, which don't haveheadas head element and apply thepredicateto each leaf argument in thisIASTand sub-ASTs and returntrueif all of the leaf elements starting from indexstartOffsetsatisfy the predicate.- Specified by:
forAllLeavesin interfaceIASTpredicate- the predicate which filters each argument in thisASTstartOffset- start offset from which the leaf elements have to be tested- Returns:
-
forEach
public void forEach(Consumer<? super IExpr> action)
Iterate over allvalue-elementsfrom index1tosize()-1and call the methodConsumer.accept()for these elements. Note: the 0-th element (i.e. the head of the AST) will not be selected.
-
forEachRule
public void forEachRule(Consumer<? super IExpr> action)
Iterate over all elements from index1tosize()-1and call the methodConsumer.accept()for these elements. Note: the 0-th element (i.e. the head of the AST) will not be selected. If the element is an Association the complete rule will be selected as element.- Specified by:
forEachRulein interfaceIAST
-
forEach
public void forEach(Consumer<? super IExpr> action, int startOffset)
Iterate over allvalue-elementsfrom indexstartOffsettosize()-1and call the methodConsumer.accept()for these elements. Note: the 0-th element (i.e. the head of the AST) will not be selected.
-
forEachRule
public void forEachRule(Consumer<? super IExpr> action, int startOffset)
Iterate over all elements from indexstartOffsettosize()-1and call the methodConsumer.accept()for these elements. Note: the 0-th element (i.e. the head of the AST) will not be selected. If the element is an Association the complete rule will be selected as element.- Specified by:
forEachRulein interfaceIASTstartOffset- the start offset from which the action.accept() method should be executed
-
fullFormString
public String fullFormString()
Return theFullForm()of this expression- Specified by:
fullFormStringin interfaceIExpr- Returns:
-
get
public abstract IExpr get(int location)
Description copied from interface:IASTReturns the element at the specified location in thisIAST. If this is anIAssociationreturn the value of the rule at the specified location.- Specified by:
getin interfaceIAST- Specified by:
getin interfaceITensorAccess- Parameters:
location- the index of the element to return.- Returns:
- the element at the specified location.
-
get
public IExpr get(IInteger location)
Description copied from interface:IASTReturns the element at the specified location in thisIAST.
-
getAST
public final IAST getAST(int index)
Casts anIExprat positionindexto anIAST.- Specified by:
getASTin interfaceIAST- Parameters:
index-- Returns:
- Throws:
IllegalArgumentException- if the cast is not possible
-
getAt
public final IExpr getAt(int index)
Description copied from interface:IExprGet the element at the specifiedindexif this object is of typeIAST.
-
getEvalFlags
public final int getEvalFlags()
Get the evaluation flags for this list.- Specified by:
getEvalFlagsin interfaceIAST- Returns:
-
getHashCache
public int getHashCache()
Description copied from interface:IASTGet the cached hash value.- Specified by:
getHashCachein interfaceIAST- Returns:
-
getInt
public final IInteger getInt(int index)
Casts anIExprat positionindexto anIInteger.- Specified by:
getIntin interfaceIAST- Parameters:
index-- Returns:
- Throws:
IllegalArgumentException- if the cast is not possible
-
getList
public final IAST getList(int index)
Casts anIExprwhich is a list at positionindexto anIAST.- Specified by:
getListin interfaceIAST- Parameters:
index-- Returns:
- Throws:
IllegalArgumentException
-
getNumber
public final INumber getNumber(int index)
Casts anIExprat positionindexto anINumber.- Specified by:
getNumberin interfaceIAST- Parameters:
index-- Returns:
- Throws:
IllegalArgumentException- if the cast is not possible
-
getOptionalValue
public IExpr getOptionalValue()
- Specified by:
getOptionalValuein interfaceIExpr
-
getPart
public IExpr getPart(int... positions)
Description copied from interface:IASTReturns the element at the specified positions in the nested ASTs.
-
getIndex
public IExpr getIndex(int... positions)
Description copied from interface:ITensorAccessLow level access. It is assumed thatpositionsis a full index within the dimensions of thisISparseArrayorIAST(vector/matrix/tensor) object.- Specified by:
getIndexin interfaceITensorAccess- Parameters:
positions- full index within the dimensions of this object- Returns:
- the expression at the given index or
F.NIL
-
getPart
public final IExpr getPart(it.unimi.dsi.fastutil.ints.IntList positions)
Description copied from interface:IASTReturns the element at the specified positions in the nested ASTs.
-
getProperty
public Object getProperty(IAST.PROPERTY key)
Returns the value to which the specified property is mapped, ornullif this map contains no mapping for the property.- Parameters:
key-- Returns:
- See Also:
putProperty(PROPERTY, Object)
-
has
public final boolean has(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.
-
hasTrigonometricFunction
public final boolean hasTrigonometricFunction()
Description copied from interface:IASTReturnstrue, if one of the headers of this AST contains a trigonometric function.- Specified by:
hasTrigonometricFunctionin interfaceIAST- Returns:
true, if one of the headers of this AST contains a trigonometric function.
-
hashCode
public int hashCode()
FNV-1 hash code of thisIAST.
-
hierarchy
public int hierarchy()
A unique integer ID for the implementation of this expression
-
indexOf
public int indexOf(IExpr expr)
If this is of typeIAST, find the first argument position, which equalsexpr. The search starts at index1. Otherwise return-1.Note: If this is an
IAssociationthe position of the rule will be searched.
-
indexOf
public int indexOf(Predicate<? super IExpr> predicate, int fromIndex)
If this is of typeIAST, find the first argument position, which fulfills thepredicate. The search starts at indexfromIndex. Otherwise return-1.
-
findFirst
public IExpr findFirst(Function<IExpr,IExpr> function)
Find the first argument position, where the thefunctiondoesn't returnF.NIL. The search starts at index1.Note: If this is an
IAssociationthe rule at the position will be returned.
-
internalFormString
public final CharSequence internalFormString(boolean symbolsAsFactoryMethod, int depth)
Return 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".- Returns:
- the internal Java form of this expression
-
internalJavaString
public CharSequence internalJavaString(SourceCodeProperties properties, int depth, Function<ISymbol,? extends CharSequence> variables)
Return the internal Java form of this expression.- Specified by:
internalJavaStringin interfaceIExpr- Parameters:
properties- the settings to use for code generation.depth- the recursion depth of this call.0indicates "recurse without a limit".variables- TODO- Returns:
- the internal Java form of this expression
-
internalScalaString
public final CharSequence internalScalaString(boolean symbolsAsFactoryMethod, int depth)
Return the internal Scala form of this expression.- Specified by:
internalScalaStringin interfaceIExpr- Parameters:
symbolsAsFactoryMethod- iftrueuse theF.symbol()method, otherwise print the symbol name.depth- the recursion depth of this call.0indicates "recurse without a limit".- Returns:
- the internal Scala form of this expression
-
isAbs
public boolean isAbs()
Test if this expression is the functionAbs[<arg>]
-
isAllExpanded
public boolean isAllExpanded()
Test if this expression and all subexpressions are already expanded i.e. allPlus, Times, Power(sub-)expressions are expanded.- Specified by:
isAllExpandedin interfaceIExpr- Returns:
-
isAlternatives
public final boolean isAlternatives()
Test if this expression is theAlternativesfunctionAlternatives[<pattern1>, <pattern2>, ...]- Specified by:
isAlternativesin interfaceIExpr- Returns:
-
isAnd
public final boolean isAnd()
Test if this expression is the functionAnd[<arg>,...]and has at least 2 arguments.
-
isArcCos
public final boolean isArcCos()
Test if this expression is the functionArcCos[<arg>]
-
isArcCosh
public final boolean isArcCosh()
Test if this expression is the functionArcCosh[<arg>]
-
isArcSin
public final boolean isArcSin()
Test if this expression is the functionArcSin[<arg>]
-
isArcSinh
public final boolean isArcSinh()
Test if this expression is the functionArcSinh[<arg>]
-
isArcTan
public final boolean isArcTan()
Test if this expression is the functionArcTan[<arg>]
-
isArcTanh
public final boolean isArcTanh()
Test if this expression is the functionArcTanh[<arg>]
-
isAST
public boolean isAST()
Test if this expression is an AST function, 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- Returns:
- See Also:
IExpr.isAtom()
-
isAST
public boolean isAST(IExpr header)
Test if this expression is an AST function, 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- Parameters:
header- the header element at position 0, which should be tested- Returns:
- See Also:
IExpr.isAtom()
-
isAST
public boolean isAST(IExpr header, int length)
Test if this expression is anIASTfunction, which contains the given header element at index position0and optional argument elements at the index positions1..(length-1). If this test givestruethis expression is not an atomic expression.- Specified by:
isASTin interfaceIExpr- Parameters:
header- the header element at position 0, which should be testedlength- the size the AST expression must have (inclusive head element)- Returns:
- See Also:
IExpr.isAtom()
-
isAST
public boolean isAST(IExpr header, int length, IExpr... args)
Test if this expression is anIASTfunction, which contains the given header element at index position0and optional argument elements at the index positions1..(length-1). If this test givestruethis expression is not an atomic expression.- Specified by:
isASTin interfaceIExpr- Parameters:
header- the header element at position 0, which should be testedlength- the size the AST expression must haveargs- the arguments of this AST which should be tested, if they are equal, anullvalue argument skips the equals check.- Returns:
- See Also:
IExpr.isAtom()
-
isAST
public boolean isAST(IExpr head, int minLength, int maxLength)
Test if this expression is anIASTfunction, which contains the given header element at index position0and optional argument elements at the index positions1..(length-1). If this test givestruethis expression is not an atomic expression.- Specified by:
isASTin interfaceIExpr- Parameters:
head- the header element at position 0, which should be testedminLength- the minimum size the AST expression must havemaxLength- the maximum size the AST expression must have- Returns:
- See Also:
IExpr.isAtom()
-
isAST
public boolean isAST(String symbol)
Test if this expression is anIASTfunction, where the string representation of the header element at index position0equals the givensymboland some optional argument elements at the index positions1..(size()-1). If this test givestruethis expression is not an atomic expression.Example:
isAST("Sin")givestrueforSin(Pi/2).Note: this is a performance critical method, only use it in special cases like for example UI handling etc.
- Specified by:
isASTin interfaceIExpr- Parameters:
symbol- string representation of the header element at index position0- Returns:
- See Also:
IExpr.isAtom()
-
isAST
public boolean isAST(String symbol, int length)
Test if this expression is anIASTfunction, 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- Parameters:
symbol- string representation of the header element at index position0length- the size the AST expression must have- Returns:
- See Also:
IExpr.isAtom()
-
isAST0
public boolean isAST0()
Test if this expression is anIASTfunction, which contains a header element (i.e. the function name) at index position0and no argument elements.
Therefore this expression is no atomic expression.- Specified by:
isAST0in interfaceIExpr- Returns:
- See Also:
IExpr.isAtom()
-
isAST1
public boolean isAST1()
Test if this expression is anIASTfunction, which contains a header element (i.e. the function name) at index position0and one argument element at the index position1.
Therefore this expression is no atomic expression.- Specified by:
isAST1in interfaceIExpr- Returns:
- See Also:
IExpr.isAtom()
-
isAST2
public boolean isAST2()
Test if this expression is anIASTfunction, which contains a header element (i.e. the function name) at index position0and two argument elements at the index positions1, 2.
Therefore this expression is no atomic expression.- Specified by:
isAST2in interfaceIExpr- Returns:
- See Also:
IExpr.isAtom()
-
isAST3
public boolean isAST3()
Test if this expression is anIASTfunction, which contains a header element (i.e. the function name) at index position0and three argument elements at the index positions1, 2, 3.
Therefore this expression is no atomic expression.- Specified by:
isAST3in interfaceIExpr- Returns:
- See Also:
IExpr.isAtom()
-
isASTSizeGE
public boolean isASTSizeGE(IExpr header, int length)
Test if this expression is anIASTfunction, 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- Parameters:
header- the header element at position 0, which should be testedlength- the size the AST expression must have- Returns:
- See Also:
IExpr.isAtom()
-
isAtom
public boolean isAtom()
Description copied from interface:IExprTest if this expression is an atomic expression (i.e. no AST expression)
-
isComplexInfinity
public final boolean isComplexInfinity()
Test if this expression is representing ComplexInfinity (i.e. DirectedInfinity[])- Specified by:
isComplexInfinityin interfaceIExpr- Returns:
-
isCondition
public boolean isCondition()
Test if this expression is the Condition functionCondition[<arg1>, <arg2>]- Specified by:
isConditionin interfaceIExpr- Returns:
-
isConditionalExpression
public boolean isConditionalExpression()
Test if this expression is the ConditionalExpression functionConditionalExpression[<arg1>, <arg2>]- Specified by:
isConditionalExpressionin interfaceIExpr- Returns:
-
isConjugate
public final boolean isConjugate()
Test if this expression is the functionConjugate[<arg>]- Specified by:
isConjugatein interfaceIExpr- Returns:
-
isCos
public final boolean isCos()
Test if this expression is the functionCos[<arg>]
-
isCosh
public final boolean isCosh()
Test if this expression is the functionCosh[<arg>]
-
isDefer
public final boolean isDefer()
Test if this expression is the functionDefer[<arg>]
-
isDerivative
public final IAST[] isDerivative()
Test if this expression is aDerivative[number, ...][symbol][arg,...]orDerivative[number][symbol]expression and return the correspondingIASTstructures.- The expression at index
[0]contains theDerivative[number, ...]AST part. - The expression at index
[1]contains theDerivative[...][symbol]AST part. - The expression at index
[2]contains theDerivative[...][...][arg, ...]AST part, if available.
Note: the result at index
[2]maybenull, if no argument is available.- Specified by:
isDerivativein interfaceIExpr- Returns:
nullif the expression is not aDerivative[number, ...][symbol][arg, ...]orDerivative[number, ...][symbol]expression.
- The expression at index
-
isDerivativeAST1
public final IAST[] isDerivativeAST1()
Test if this expression is aDerivative[number][symbol][arg]orDerivative[number][symbol]expression with one argument and return the correspondingIASTstructures.- The expression at index
[0]contains theDerivative[number,...]AST part. - The expression at index
[1]contains theDerivative[...][symbol]AST part. - The expression at index
[2]contains theDerivative[...][...][arg]AST part, if available.
Note: the result at index
[2]maybenull, if no argument is available.- Specified by:
isDerivativeAST1in interfaceIExpr- Returns:
nullif the expression is not aDerivative[number][symbol][arg]orDerivative[number][symbol]expression.
- The expression at index
-
isDirectedInfinity
public final boolean isDirectedInfinity()
Test if this expression is representing a DirectedInfinity (i.e.Infinity->DirectedInfinity[1],-Infinity->DirectedInfinity[-1],ComplexInfinity->DirectedInfinity[])- Specified by:
isDirectedInfinityin interfaceIExpr- Returns:
-
isDirectedInfinity
public final boolean isDirectedInfinity(IExpr x)
Test if this expression is representing a DirectedInfinity (i.e.Infinity->DirectedInfinity[1],-Infinity->DirectedInfinity[-1],ComplexInfinity->DirectedInfinity[])- Specified by:
isDirectedInfinityin interfaceIExpr- Returns:
-
isContinuousDistribution
public boolean isContinuousDistribution()
Description copied from interface:IExprTest if this expression is a continuous distribution AST (i.e. evakuator is instanceofIContinuousDistribution- Specified by:
isContinuousDistributionin interfaceIExpr- Returns:
-
isDiscreteDistribution
public boolean isDiscreteDistribution()
Description copied from interface:IExprTest if this expression is a discrete distribution AST (i.e. BinomialDistribution(), PoissonDistribution(),...)- Specified by:
isDiscreteDistributionin interfaceIExpr- Returns:
-
isDistribution
public boolean isDistribution()
Description copied from interface:IExprTest if this expression is a distribution AST (i.e. NormalDistribution(), PoissonDistribution(),...)- Specified by:
isDistributionin interfaceIExpr- Returns:
-
isEmpty
public final boolean isEmpty()
Description copied from interface:IASTTest if this AST contains no argument
-
isNotEmpty
public final boolean isNotEmpty()
Description copied from interface:IExprTest if this expression is anIASTand contains at least 1 argument- Specified by:
isNotEmptyin interfaceIExpr- Returns:
-
isEqual
public final boolean isEqual()
Test if this expression is the functionEqual[<arg1>, <arg2>]
-
isEvalFlagOff
public final boolean isEvalFlagOff(int i)
Are the given evaluation flags disabled for this list ?- Specified by:
isEvalFlagOffin interfaceIAST- Specified by:
isEvalFlagOffin interfaceIExpr- Returns:
- See Also:
IAST.NO_FLAG
-
isEvalFlagOn
public final boolean isEvalFlagOn(int i)
Are the given evaluation flags enabled for this list ?- Specified by:
isEvalFlagOnin interfaceIAST- Specified by:
isEvalFlagOnin interfaceIExpr- Returns:
- See Also:
IAST.NO_FLAG
-
isExcept
public boolean isExcept()
Test if this expression is theExceptfunctionExcept(<pattern1>)orExcept(<pattern1>, <pattern2>)
-
isExpanded
public boolean isExpanded()
Test if this expression is already expanded i.e.Plus, Times, Powerexpression is expanded.- Specified by:
isExpandedin interfaceIExpr- Returns:
-
isFlatAST
public 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- Returns:
- See Also:
IExpr.isAtom()
-
isFree
public final boolean isFree(IPatternMatcher predicate, boolean heads)
Returnstrue, if all of the elements in the subexpressions or the expression itself, did not satisfy the given unary predicate.
-
isFree
public final 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.
-
isFreeAST
public final boolean isFreeAST(IExpr pattern)
Returnstrue, if all of the elements in the subexpressions or the expression itself, aren't ASTs with a head which match the given pattern.
-
isFreeAST
public final boolean isFreeAST(Predicate<IExpr> predicate)
Returnstrue, if all of the elements in the subexpressions or the expression itself, aren't ASTs with a head which match the given predicate.
-
isFreeAt
public final boolean isFreeAt(int position, IExpr pattern)Returnstrue, if all of the elements in the expressions or the expression itself at the givenposition, did not match thepattern. Callsget(Position).isFree(pattern, true).
-
isFreeOfPatterns
public final boolean isFreeOfPatterns()
Returnstrue, if all of the elements in the subexpressions or the expression itself, are no pattern objects.- Specified by:
isFreeOfPatternsin interfaceIExpr- Returns:
trueif the expression contains noIPatternObject.
-
isFunction
public final boolean isFunction()
Test if this expression is aFunction( arg1 )orFunction( arg1, arg2 )expression with at least 1 argument.- Specified by:
isFunctionin interfaceIExpr- Returns:
- See Also:
IExpr.isPureFunction()
-
isGEOrdered
public final 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- Parameters:
obj- an expression to compare with- Returns:
- true if this expression is canonical greater than or equal to the specified expression.
-
isGTOrdered
public final 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.
-
isHoldPatternOrLiteral
public final boolean isHoldPatternOrLiteral()
Test if this expression is theHoldPatternfunctionHoldPattern[<expression>]or the deprecatedLiteral[<expression>]form.- Specified by:
isHoldPatternOrLiteralin interfaceIExpr- Returns:
-
isFunctionID
public boolean isFunctionID(int... builtinIDs)
Test if this expression is anIASTfunction with one of the built-in head IDs.- Specified by:
isFunctionIDin interfaceIExpr- Returns:
- See Also:
IExpr.isPureFunction()
-
isHoldAllCompleteAST
public final boolean isHoldAllCompleteAST()
Test if this expression is an AST list, which contains a header element with attributeISymbol.HOLDALLCOMPLETEat index position0.- Specified by:
isHoldAllCompleteASTin interfaceIExpr- Returns:
-
isInfinity
public final boolean isInfinity()
Test if this expression is representingInfinity(i.e.Infinity->DirectedInfinity[1])- Specified by:
isInfinityin interfaceIExpr- Returns:
-
isBooleanFormula
public boolean isBooleanFormula()
Test if this expression is a boolean formula (i.e. a symbol or a boolean functionAnd, Equivalent, Nand, Nor, Not, Or, Xorwhere all arguments are also "boolean formulas")- Specified by:
isBooleanFormulain interfaceIExpr- Returns:
true, if the given expression is a boolean formula or a symbol.- See Also:
IExpr.isRealResult()
-
isBooleanResult
public boolean isBooleanResult()
Test if this expression is a boolean function (i.e. a symbol or a boolean function like for exampleAnd, Equivalent, Equal, Greater, GreaterEqual, Less, LessEqual, Nand, Nor, Not, Or, Xor,...where all arguments are also "boolean functions") or a symbol or some builtin predicates like for exampleIntegerQ, EvenQ, PrimeQ,....- Specified by:
isBooleanResultin interfaceIExpr- Returns:
true, if the given expression is a boolean function or a symbol.- See Also:
IExpr.isRealResult()
-
isBooleanFunction
public boolean isBooleanFunction()
Test if this expression is a boolean function with headAnd, Equivalent, Nand, Nor, Not, Or, Xor.- Specified by:
isBooleanFunctionin interfaceIExpr- Returns:
-
isComparatorFunction
public boolean isComparatorFunction()
Test if this expression is a comparator function (i.e. a function with headEqual, Equivalent, Greater, GreaterEqual, Less, LessEqual, Inequlity, SameQ, Unequal, UnsameQand size greater 2)- Specified by:
isComparatorFunctionin interfaceIExpr- Returns:
true, if the given expression is a comparator function.
-
isIntegerResult
public boolean isIntegerResult()
Test if this expression is a integer function (i.e. a number, a symbolic constant or an integer function where all arguments are also "integer functions")- Specified by:
isIntegerResultin interfaceIExpr- Returns:
true, if the given expression is a integer function or value.- See Also:
IExpr.isRealResult()
-
isInterval
public boolean isInterval()
Test if this expression is a closed interval expression with one or moreList[min, max]argumentsInterval[{min1, max1}, {min2, max2}, ...]which represent the union of the interval ranges.- Specified by:
isIntervalin interfaceIExpr- Returns:
-
isIntervalData
public boolean isIntervalData()
Test if this expression is a mixed opened/closed interval expression with one or more{min, Less/LessEqual, Less/LessEqual, max}list arguments which represent the union of the interval ranges. The emptyIntervalData()interval returns alsotrue.- Specified by:
isIntervalDatain interfaceIExpr- Returns:
-
isEmptyIntervalData
public boolean isEmptyIntervalData()
- Specified by:
isEmptyIntervalDatain interfaceIExpr
-
isInterval1
public boolean isInterval1()
Test if this expression is a closed/open ended interval expression with oneList[min, max]argumentInterval[{min, max}]- Specified by:
isInterval1in interfaceIExpr- Returns:
-
isEmptyList
public boolean isEmptyList()
Test if this expression is an empty list (i.e. a list{})- Specified by:
isEmptyListin interfaceIExpr- Returns:
-
isNonEmptyList
public boolean isNonEmptyList()
Test if this expression is a list with at least one element (i.e. a list{element, ...})- Specified by:
isNonEmptyListin interfaceIExpr- Returns:
-
isList
public boolean isList()
Test if this expression is a list (i.e. an AST with head List)
-
isList
public boolean isList(int[] dimensions)
Test if this expression is a nested list with the dimensions.
-
isListOfPoints
public boolean isListOfPoints(int pointDimension)
Test ifthisis a list of points in the given dimension. The head of the points can beS.List,S.LabeledorS.Style- Specified by:
isListOfPointsin interfaceIExpr- Returns:
-
isListableAST
public final boolean isListableAST()
Description copied from interface:IExprTest if this expression is anIASTlist, which contains a header element (i.e. a function symbol at index position0and some optional argument elements at the index positions1..n. Examples forListablefunctions areCos[], Plus[] or Times[]. Therefore this expression is no atomic expression.- Specified by:
isListableASTin interfaceIExpr- Returns:
- See Also:
IExpr.isAtom()
-
isList
public boolean isList(Predicate<IExpr> pred)
Test if this expression is a list (i.e. an AST with head List) with all arguments fulfill the predicate.
-
isListOfLists
public boolean isListOfLists()
Test if this expression is a list of lists{{...},{...},...}and contains at least 1 sublist. The sublists are allowed to be empty lists.- Specified by:
isListOfListsin interfaceIExpr- Returns:
- See Also:
IExpr.isList(),IExpr.isMatrix(boolean),IExpr.isVector()
-
isListOfMatrices
public boolean isListOfMatrices()
Test if this expression is a list of matrices and contains at least 1 matrix.- Specified by:
isListOfMatricesin interfaceIExpr- Returns:
-
isListOfEdges
public org.jgrapht.GraphType isListOfEdges()
Test if this expression is a list of DirectedEdge or UndirectedEdge- Specified by:
isListOfEdgesin interfaceIExpr- Returns:
-
isEdge
public boolean isEdge()
Test if this expression is an DirectedEdge, UndirectedEdge, Rule, TwoWayRule.
-
isListOfRules
public boolean isListOfRules(boolean ignoreEmptySublists)
Test if this expression is a list of rules (head Rule or RuleDelayed)- Specified by:
isListOfRulesin interfaceIExpr- Parameters:
ignoreEmptySublists- iftrue, ignore elements which equals an empty list{ }- Returns:
- See Also:
IExpr.isList(),IExpr.isMatrix(boolean),IExpr.isVector()
-
isListOfRulesOrAssociation
public boolean isListOfRulesOrAssociation(boolean ignoreEmptySublists)
Test if this expression is a list of rules (head Rule or RuleDelayed) or an Association.- Specified by:
isListOfRulesOrAssociationin interfaceIExpr- Parameters:
ignoreEmptySublists- iftrue, ignore elements which equals an empty list{ }but only in lists.- Returns:
-
isListOfStrings
public boolean isListOfStrings()
Test if this expression is a list of strings and contains at least 1 element.- Specified by:
isListOfStringsin interfaceIExpr- Returns:
- See Also:
IExpr.isList(),IExpr.isMatrix(boolean),IExpr.isVector()
-
isLog
public final boolean isLog()
Test if this expression is the functionLog[<arg>]
-
isMatrix
public int[] isMatrix(boolean setMatrixFormat)
Test if this expression is a matrix and return the dimensions as array [row-dimension, column-dimension]. This expression is only a matrix, if it is aASTRealMatrixor aList(...)where all elements are lists with the headerListand have the same size.
-
isMatrixIgnore
public int[] isMatrixIgnore()
Test if this expression is a matrix and return the dimensions as array [row-dimension, column-dimension]. This expression is a matrix, if it is aASTRealMatrixor aList(...)where elements which could not be converted to a row vector are ignored.- Specified by:
isMatrixIgnorein interfaceIExpr- Returns:
nullif the expression is not a matrix
-
isMember
public boolean isMember(IExpr pattern, boolean heads, IVisitorBoolean visitor)
Description copied from interface:IExprReturnstrue, if at least one of the elements in the subexpressions, match the given pattern. Ifvisitor==nulltheisMember()method only operates at level 1.
-
isModule
public final boolean isModule()
Test if this expression is the Module functionModule[<arg1>, <arg2>]
-
isModuleOrWithCondition
public final boolean isModuleOrWithCondition()
- Specified by:
isModuleOrWithConditionin interfaceIExpr
-
isNegative
public boolean isNegative()
Test if this object is a negative signed number. For anIASTobject the method checks, if it is a numeric constant. If theIASTobject evaluates to a negative numeric expression this method returnstrue.- 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- Returns:
-
isNegativeResult
public boolean isNegativeResult()
Test if this expression has a negative result (i.e. less than 0) or is assumed to be negative.- Specified by:
isNegativeResultin interfaceIExpr- Returns:
true, if the given expression is a negative function or value.- See Also:
IExpr.isRealResult()
-
isNonNegativeResult
public boolean isNonNegativeResult()
Test if this expression has a non-negative result (i.e. greater equal 0) or is assumed to be non-negative.- Specified by:
isNonNegativeResultin interfaceIExpr- Returns:
true, if the given expression is a non-negative function or value.- See Also:
IExpr.isRealResult()
-
isNot
public final boolean isNot()
Test if this expression is the functionNot[<arg>].
-
isNumericArgument
public boolean isNumericArgument(boolean allowList)
Test if this expression is a numeric number (i.e. an instance of typeINumor typeIComplexNum), anASTRealVectoror anASTRealMatrix.- Specified by:
isNumericArgumentin interfaceIExpr
-
isNumericFunction
public boolean isNumericFunction(boolean allowList)
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- Parameters:
allowList- iftrueaList(...)AST is seen, as if it has attributeISymbol.NUMERICFUNCTION- Returns:
true, if the given expression is a numeric function or value.- See Also:
IExpr.isRealResult()
-
isNumericFunction
public boolean isNumericFunction(VariablesSet varSet)
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") under the assumption, that all variables contained invarSetare also numeric.- Specified by:
isNumericFunctionin interfaceIExpr- Returns:
true, if the given expression is a numeric function or value, assuming all variables contained invarSetare also numeric.
-
isNumericFunction
public boolean isNumericFunction(IExpr expr)
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") under the assumption, that thevariableis also numeric.- Specified by:
isNumericFunctionin interfaceIExpr- Returns:
-
isNumericFunction
public boolean isNumericFunction(Function<IExpr,String> list)
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") under the assumption, that all variables contained inlistare also numeric.- Specified by:
isNumericFunctionin interfaceIExpr- Parameters:
list- a list of variable symbols- Returns:
-
isNumericMode
public boolean isNumericMode()
Test if this expression contains a numeric number (i.e. of typeINumorIComplexNum.- Specified by:
isNumericModein interfaceIExpr- Returns:
true, if the given expression contains numeric number (i.e. of typeINumorIComplexNum.- See Also:
IExpr.isRealResult()
-
isOneIdentityAST1
public boolean isOneIdentityAST1()
Test if this expression is an AST list, which contains a header element (i.e. a function symbol like for examplePlus or Times) with attributeOneIdentityat index position0and exactly one argument at the index position1. Examples forOneIdentityfunctions arePlus[] or Times[]. Therefore this expression is no atomic expression.- Specified by:
isOneIdentityAST1in interfaceIExpr- Returns:
- See Also:
IExpr.isAtom()
-
isOptional
public final boolean isOptional()
Test if this expression is theOptionalfunctionOptional[<pattern>]orOptional[<pattern>, <value>]- Specified by:
isOptionalin interfaceIExpr- Returns:
-
isOr
public final boolean isOr()
Test if this expression is the functionOr[<arg>,...]and has at least 2 arguments.
-
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- Returns:
- See Also:
IExpr.isAtom()
-
isPatternDefault
public boolean isPatternDefault()
Returntrue, if the expression is a pattern object with an associated default value (for example0is the default value for the addition expressionx_+y_.)- Specified by:
isPatternDefaultin interfaceIExpr- Returns:
-
isPatternExpr
public final 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- Returns:
-
isPatternTest
public final boolean isPatternTest()
Test if this expression is thePatternTestfunctionPatternTest[<pattern>, <test>]- Specified by:
isPatternTestin interfaceIExpr- Returns:
-
isPiecewise
public int[] isPiecewise()
Test if this expression is aPiecewise({{...}}},...)function and the first argument is a matrix with dimension[row-dimension, 2]androw-dimension > 0. Return the dimensions of the matrix as array[row-dimension, column-dimension]. The first argument is only a matrix, if it is aList(...)where all elements are lists with the headerListand have the same size.- Specified by:
isPiecewisein interfaceIExpr- Returns:
nullif the expression is not aPiecewise({{...}}},...)function or if the first argument is not a matrix
-
isPlus
public boolean isPlus()
Test if this expression is the addition functionPlus[<arg1>, <arg2>, ...]with at least 2 arguments.
-
isPlus2
public boolean isPlus2()
Test if this expression is theS.PlusfunctionPlus[<arg1>, <arg2>]with exactly 2 arguments.
-
isPlus3
public boolean isPlus3()
Test if this expression is theS.PlusfunctionPlus[<arg1>, <arg2>, <arg3>]with exactly 3 arguments.
-
isPlusTimesPower
public boolean isPlusTimesPower()
Test if this expression is aPlus, Power or Timesfunction.- Specified by:
isPlusTimesPowerin interfaceIExpr- Returns:
-
isPolynomial
public final boolean isPolynomial(IAST variables)
Test if this expression is a polynomial for the given list ofvariables. Note: if the list contains no argument, this method returnstruefor aSymbolexpression.- Specified by:
isPolynomialin interfaceIExpr- Parameters:
variables- a list of variables or an empty list- Returns:
trueif this expression is a polynomial;falseotherwise
-
isPolynomial
public final boolean isPolynomial(IExpr variable)
Test if this expression is a polynomial for the givenvariable. Note: if the variable is set tonull, this method returnstruefor aSymbolexpression.- Specified by:
isPolynomialin interfaceIExpr- Parameters:
variable- the variable of the polynomial- Returns:
-
isPolynomialStruct
public boolean isPolynomialStruct()
Test if this expression has a polynomial structiure, i.e. no built-in function as head- Specified by:
isPolynomialStructin interfaceIExpr- Returns:
trueif this expression has a polynomial structure;falseotherwise
-
isPolynomialOfMaxDegree
public final boolean isPolynomialOfMaxDegree(IAST variables, long maxDegree)
-
isPolynomialOfMaxDegree
public final boolean isPolynomialOfMaxDegree(ISymbol variable, long maxDegree)
Test if this expression is a polynomial ofmaxDegree(i.e. the maximum exponent <= maxDegree) for the givenvariable.- Specified by:
isPolynomialOfMaxDegreein interfaceIExpr- Parameters:
variable- the variable of the polynomialmaxDegree- the maximum degree of the polynomial; maxDegree must be greater 0- Returns:
-
isPositive
public boolean isPositive()
Test if this object is a positive signed number. For anIASTobject the method checks, if it is a numeric constant. If theIASTobject evaluates to a positive numeric expression this method returnstrue.- Specified by:
isPositivein interfaceIExpr- Returns:
true, ifthis > 0;falsein all other case.
-
isPositiveResult
public boolean isPositiveResult()
Test if this expression has a positive result (i.e. greater than 0) or is assumed to be positive.- Specified by:
isPositiveResultin interfaceIExpr- Returns:
true, if the given expression is a positive function or value.- See Also:
IExpr.isRealResult()
-
isPower
public boolean isPower()
Test if this expression is the functionPower[<arg1>, <arg2>]
-
isPureFunction
public final boolean isPureFunction()
Test if this expression is a "pure" or "anonymous"Function( arg1 )expression with exactly 1 argument.- Specified by:
isPureFunctionin interfaceIExpr- Returns:
- See Also:
IExpr.isFunction()
-
isRationalResult
public final boolean isRationalResult()
Test if this expression is a symbolic rational function (i.e. a number, a symbolic constant or an rational function where all arguments are also "rational functions")- Specified by:
isRationalResultin interfaceIExpr- Returns:
true, if the given expression is a rational function or value.- See Also:
IExpr.isRealResult()
-
isRealMatrix
public boolean isRealMatrix()
Test if this expression is a real matrix (i.e. an instance ofASTRealMatrixor aList[List[...],...,List[...]]matrix with elements of typeorg.matheclipse.core.expression.Num.- Specified by:
isRealMatrixin interfaceIExpr- Returns:
-
isRealResult
public boolean isRealResult()
Test if this expression is a real function (i.e. a number, a symbolic constant or an integer function where all arguments are also "reals functions")- Specified by:
isRealResultin interfaceIExpr- Returns:
true, if the given expression is a real function or value.- See Also:
IExpr.isIntegerResult()
-
isRealVector
public boolean isRealVector()
Test if this expression is a real vector (i.e. an instance ofASTRealVectoror aList[...]with elements of typeorg.matheclipse.core.expression.Num.- Specified by:
isRealVectorin interfaceIExpr- Returns:
-
isRule
public boolean isRule()
Test if this expression is of the formRule[<arg1>, <arg2>].
-
isRuleAST
public boolean isRuleAST()
Test if this expression is of the formRule[<arg1>, <arg2>]orRuleDelayed[<arg1>, <arg2>].
-
isRuleDelayed
public boolean isRuleDelayed()
Test if this expression is of the formRuleDelayed[<arg1>, <arg2>].- Specified by:
isRuleDelayedin interfaceIExpr- Returns:
-
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 toConfig.DOUBLE_TOLERANCE.
-
isSame
public 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
-
isSameHead
public boolean isSameHead(ISymbol head)
Check if the object at index 0 (i.e. the head of the list) is the same object ashead- Parameters:
head- object to compare with element at location0- Returns:
-
isSameHead
public boolean isSameHead(ISymbol head, int length)
Check if the object at index 0 (i.e. the head of the list) is the same object asheadand if the size of the list equalslength.- Parameters:
head- object to compare with element at location0length-- Returns:
-
isSameHead
public boolean isSameHead(ISymbol head, int minLength, int maxLength)
Check if the object at index 0 (i.e. the head of the list) is the same object asheadand if the size of the list is betweenminLengthandmaxLength.- Parameters:
head- object to compare with element at location0minLength- minimum length of list elements.maxLength- maximum length of list elements.- Returns:
-
isSequence
public final boolean isSequence()
Test if this expression is a sequence (i.e. an AST with head Sequence)- Specified by:
isSequencein interfaceIExpr- Returns:
-
isSin
public final boolean isSin()
Test if this expression is the functionSin[<arg>]
-
isSinh
public final boolean isSinh()
Test if this expression is the functionSinh[<arg>]
-
isSlot
public final boolean isSlot()
Test if this expression is the functionSlot[<integer-value>](i.e. #1, #2, #3,....)
-
intSlot
public final IInteger intSlot()
If this is a slot return the slot number, otherwise returnF.CN1(value -1)
-
isSlotSequence
public final boolean isSlotSequence()
Test if this expression is the functionSlotSequence[<integer-value>]- Specified by:
isSlotSequencein interfaceIExpr- Returns:
-
isSpan
public final int[] isSpan(int size)
Test if this expression is the functionSpan[...]with 2 or 3 arguments.
-
isSubscript
public final boolean isSubscript()
Test if this expression is the functionSubscript[var, <integer-value>].varhas to be a variable.- Specified by:
isSubscriptin interfaceIExpr- Returns:
-
isTan
public final boolean isTan()
Test if this expression is the functionTan[<arg>]
-
isTanh
public final boolean isTanh()
Test if this expression is the functionTanh[<arg>]
-
isTimes
public boolean isTimes()
Test if this expression is the multiplication functionTimes[<arg1>, <arg2>, ...]with at least 2 arguments.
-
isTimes2
public boolean isTimes2()
Test if this expression is theS.TimesfunctionTimes[<arg1>, <arg2>]with exactly 2 arguments.
-
isTimes3
public boolean isTimes3()
Test if this expression is theS.TimesfunctionTimes[<arg1>, <arg2>, <arg3>]with exactly 3 arguments.
-
isTrigFunction
public boolean isTrigFunction()
Test if this expression is a trigonometric function.Note: ArcTan(x,y) can have 2 arguments and is considered as a trigonometric function. All other detected function types have 1 argument.
- Specified by:
isTrigFunctionin interfaceIExpr- Returns:
-
isHyperbolicFunction
public boolean isHyperbolicFunction()
Test if this expression is a hyperbolic function.Note: All detected function types have 1 argument.
- Specified by:
isHyperbolicFunctionin interfaceIExpr- Returns:
-
isPatternMatchingFunction
public final boolean isPatternMatchingFunction()
Description copied from interface:IASTTest if this expression is a special pattern-matching function (i.e. Alternatives, Except,...)- Specified by:
isPatternMatchingFunctionin interfaceIAST- Specified by:
isPatternMatchingFunctionin interfaceIExpr- Returns:
-
isUnevaluated
public final boolean isUnevaluated()
Test if this expression is the functionUnevaluated[<arg>]- Specified by:
isUnevaluatedin interfaceIExpr- Returns:
-
isUnit
public boolean isUnit()
-
isValue
public final boolean isValue()
Returnstrue, if this symbol or ast expression is bound to a value (i.e. the evaluation returns an assigned value).
-
isVariable
public final boolean isVariable(boolean polynomialQTest)
Test if this expression is a variable which doesn't has attribute
ISymbol.CONSTANT.If
polynomialQTest==truethis method tests, as if functionS.PolynomialQfor the polynomials variable was called, where especiallyIASTfunction expressions other than sums, products, and integer powers can be used as polynomial variables.- Specified by:
isVariablein interfaceIExpr- Parameters:
polynomialQTest- do a more relaxed variable test forS.PolynomialQ- Returns:
- See Also:
IExpr.isConstantAttribute(),IExpr.isSymbol()
-
isVector
public int isVector()
Test if this expression is a vector and return the length of the vector. This expression is only a vector, if the expression is aASTRealVectoror aList(...)and no element is itself aList(...)or aSparseArray(...)of dimension1;
-
isInexactVector
public int isInexactVector()
- Specified by:
isInexactVectorin interfaceIExpr
-
isNumericAST
public boolean isNumericAST()
Test if this expression is an IAST and contains at least one numeric argument.- Specified by:
isNumericASTin interfaceIExpr- Returns:
-
isWith
public final boolean isWith()
Test if this expression is the With functionWith[<arg1>, <arg2>]
-
isPossibleZero
public boolean isPossibleZero(boolean fastTest)
Test if this expression equals0in symbolic or numeric mode. For the numeric test multiple random numbers with aChop()function test are used.- Specified by:
isPossibleZeroin interfaceIExpr- Parameters:
fastTest- checks only numerical; no symbolic tests are tried.- Returns:
-
iterator
public final Iterator<IExpr> iterator()
Returns an iterator over the elements in thisIASTstarting with offset 1.
-
last
public IExpr last()
Get the last element of theASTlist (i.e. get(size()-1). ReturnF.NILif this object isn't anASTor has0arguments (i.e. only a header element)- Specified by:
lastin interfaceIExpr- Returns:
- the last argument of the function represented by this
ASTorF.NIL - See Also:
IExpr.head()
-
lastIndexOf
public final int lastIndexOf(IExpr object)
- Specified by:
lastIndexOfin interfaceIAST
-
leafCount
public final long leafCount()
Count the number of indivisible subexpressions (atoms/leaves) of this expression.
-
leafCountSimplify
public long leafCountSimplify()
Count the number of leaves of this expression; for integer numbers in exact integer, fractional and complex numbers count the digits of the integers. This function is used inSimplifyas the default "complexity function". Note::S.Indeterminatereturns valueLong.MAX_VALUEuse
IExpr.isZero()instead.- Specified by:
leafCountSimplifyin interfaceIExpr- Returns:
-
linear
public IExpr[] linear(IExpr variable)
Description copied from interface:IExprIf this is a linear expressiona + b * xreturn the addendaat index0and the multiplicantbat index1
-
linearPower
public IExpr[] linearPower(IExpr variable)
Description copied from interface:IExprIf this is an expression of the forma + b * x^nwithninteger, return the addend at index0and the multiplicant at index1and the exponentnat index2.- Specified by:
linearPowerin interfaceIExpr- Parameters:
variable- the variablexin the formula- Returns:
nullif this is not an expression of the forma+b*x^n
-
lower
public IExpr lower()
If this is aInterval[{lower, upper}]expression return thelowervalue. If this is aIRealexpression returnthis.
-
getArg
public IExpr getArg(int position, IExpr defaultValue)
Returnthis.get(position)ifargSize() >= position, otherwise returndefaultValue
-
makeList
public IAST makeList()
ReturnthisifisList()==true, otherwise create a new list{this}from this (i.e. returnF.List(this)).
-
makeAST
public IAST makeAST(IExpr head)
Description copied from interface:IExprReturnthisifisAST(head)==true, otherwise create a new list{this}from this (i.e. returnF.unaryAST1(head, this)).
-
map
public IAST map(Function<IExpr,? extends IExpr> function)
Maps the elements of this IAST with the unaryfunctor. If thefunctorreturnsF.NILthe original element of this AST list is used.
Example for mapping withFunctors#replace1st(), where the first argument will be replaced by the current argument of this AST:plusAST.map(Functors.replace1st(F.D(null, dAST.arg2())));
-
map
public IAST map(Function<IExpr,? extends IExpr> function, int startOffset)
Maps the elements of this IAST with the unaryfunctor. If thefunctorreturnsF.NILthe original element of this AST list is used.
Example for mapping withFunctors#replace1st(), where the first argument will be replaced by the current argument of this AST:plusAST.map(Functors.replace1st(F.D(null, dAST.arg2())));
-
mapLeaf
public IAST mapLeaf(IExpr testHead, Function<IExpr,IExpr> function, int startOffset)
Maps the leafs (relative totestHead) of this IAST with the unary functor. If the function returnsF.NILthe original leaf of the result list is used.
-
mapReverse
public IAST mapReverse(Function<IExpr,IExpr> function)
Description copied from interface:IASTMaps the elements of this IAST in the reversed order with the unaryfunctor. If thefunctorreturnsF.NILthe original element of this AST list is set at the reversed position.- Specified by:
mapReversein interfaceIAST- Parameters:
function- a unary function- Returns:
- the reversed list mapped with the function
-
map
public final IAST map(IASTAppendable resultAST, IAST secondAST, BiFunction<IExpr,IExpr,IExpr> function)
Maps the elements of this IAST with the elements of thesecondAST.
-
map
public IASTAppendable map(IASTAppendable astResult, IUnaryIndexFunction<IExpr,IExpr> function)
Append the mapped ranges elements directly to the givenlist
-
map
public IAST map(IASTMutable clonedResultAST, Function<IExpr,IExpr> function)
Maps the elements of this IAST with the unary functor. If the function returnsF.NILthe original element of the result list is used.
-
map
public final IAST map(IExpr head, Function<IExpr,IExpr> function)
Maps the elements of this IAST with the unary functor. If the function returnsnullthe original element of the result list is used.
-
mapLeft
public IAST mapLeft(IASTAppendable list, BiFunction<IExpr,IExpr,IExpr> binaryFunction, IExpr leftArg)
Append the mapped ranges elements directly to the givenlist
-
mapMatrixColumns
public IExpr mapMatrixColumns(int[] dim, Function<IExpr,IExpr> f)
This method assumes thatthisis a list of list in matrix form. It combines the column values in a list as argument for the givenfunction. Example a matrix{{x1, y1,...}, {x2, y2, ...}, ...}will be converted to{f.apply({x1, x2,...}), f.apply({y1, y2, ...}), ...}- Specified by:
mapMatrixColumnsin interfaceIAST- Specified by:
mapMatrixColumnsin interfaceIExpr- Parameters:
dim- the dimension of the matrixf- a unary function- Returns:
-
mapRight
public IAST mapRight(IASTAppendable list, BiFunction<IExpr,IExpr,IExpr> binaryFunction, IExpr rightArg)
Append the mapped ranges elements directly to the givenlist
-
mapThread
public IASTMutable mapThread(IAST replacement, int position)
If
thisis anIAST:Maps the elements of this
IASTon the first level of arguments with the codereplacement.setAtCopy(position, this), therereplacementis an IAST at which the argument at the given position will be replaced by the currently mapped element. This can be used to create an effect as if "theposition-th argument of an IAST object would beListable".If
thisis anIExpr:Return
replacement.setAtCopy(position, this)Example for mapping, where the argument at the given position will be replaced by the current argument of this AST:
plusAST.mapThread(F.D(F.Slot1, F.x), 1);
- Specified by:
mapThreadin interfaceIAST- Specified by:
mapThreadin interfaceIExpr- Parameters:
replacement- an IAST there the argument at the given position is replaced by the currently mapped argument of thisIAST.position- the position inreplacementwhich should be replaced by the corresponding argument of thisIAST- Returns:
- See Also:
IAST.map(Function, int)
-
mapThreadEvaled
public final IASTMutable mapThreadEvaled(EvalEngine engine, IAST replacement, int position)
Maps the elements of thisIASTon the first level of arguments with the evaluated unary functorFunctors.replaceArg(replacement, position), therereplacementis an IAST at which the argument at the given position will be replaced by the currently mapped element. This can be used to create an effect as if "theposition-th argument of an IAST object would beListable".Example for mapping with
Functors#replaceArg(), where the argument at the given position will be replaced by the current argument of this AST:plusAST.mapThreadEvaled(engine, F.D(F.Slot1, F.x), 1);
- Specified by:
mapThreadEvaledin interfaceIASTreplacement- an IAST there the argument at the given position is replaced by the currently mapped argument of thisIAST.position- the position inreplacementwhich should be replaced by the corresponding argument of thisIAST- Returns:
- See Also:
IAST.map(Function, int)
-
mapThread
public final IASTMutable mapThread(Function<IExpr,IExpr> function)
Maps the elements of this IAST on the first level of arguments with the unaryfunction.
-
mapThread
public final IASTMutable mapThread(IAST that, BiFunction<IExpr,IExpr,IExpr> function)
Maps the elements ofthisIAST and ofthatIAST on the first level of arguments with the binaryfunction. The size of the result is the minimum size ofthisandthat.
-
mapThreadEvaled
public IASTAppendable mapThreadEvaled(EvalEngine engine, IASTAppendable appendAST, IAST replacement, int position)
Maps the elements of this IAST with the unary functorFunctors.replaceArg(replacement, position), therereplacementis an IAST at which the argument at the given position will be replaced by the currently mapped element and appends the element toappendAST.- Specified by:
mapThreadEvaledin interfaceIAST- Parameters:
engine- TODOreplacement- an IAST there the argument at the given position is replaced by the currently mapped argument of this IAST.- Returns:
appendAST- See Also:
IAST.map(Function, int)
-
negative
public final IExpr negative()
Additionalnegativemethod, which works like opposite to fulfill groovy's method signature- Specified by:
negativein interfaceIExpr- Returns:
- See Also:
IExpr.opposite()
-
normal
public IExpr normal(boolean nilIfUnevaluated)
Converts a special expression (like a series, association, dataset, sparse array, ...) into a standard normalized expression.>> Normal(SeriesData(x, 0, {1, 0, -1, -4, -17, -88, -549}, -1, 6, 1)) 1/x-x-4*x^2-17*x^3-88*x^4-549*x^5
-
oneIdentity
public IExpr oneIdentity(IExpr defaultValue)
Return the argument at index 1, if theargSize() == 1. Or return the complete ast if theargSize() > 1If theargSize() == 0returndefaultValue(useful for ASTs with attributeOneIdentityfor example forPlus[]you can callgetOneIdentity(F.C0)or forTimes[]) you can callgetOneIdentity(F.C1).- Specified by:
oneIdentityin interfaceIAST- Parameters:
defaultValue- default value, ifsize() < 2.- Returns:
-
opposite
public IExpr opposite()
Returns anIExprwhose value is(-1) * this. CalculatesF.eval(F.Times(F.CN1, this))in the common case and uses a specialized implementation for derived number classes.- Specified by:
oppositein interfaceIExpr- Returns:
- See Also:
IExpr.negative()
-
optional
public IExpr optional()
Description copied from interface:IExprTheF.NIL#optional()method always returnsthat. All other objects which implement this method returnsthatifthat!=nullorthisifthat==null
-
orElse
public IAST orElse(IAST other)
Description copied from interface:IASTReturnthisifthisunequalsF.NIL, otherwise returnother.- Specified by:
orElsein interfaceIAST- Returns:
thisifthisunequalsF.NIL, otherwise returnother.- See Also:
Optional.orElse(Object)
-
partition
public final IAST partition(ISymbol operator, Predicate<? super IExpr> predicate, IExpr init1, IExpr init2, ISymbol combiner, ISymbol action)
Select all elements by applying thepredicateto each argument in thisASTand append the arguments which satisfy the predicate to the1st elementof the resulting AST, or otherwise append it to the2nd elementof the resulting AST.See: Fateman - Partitioning of Algebraic Subexpressions in Computer Algebra Systems
- Specified by:
partitionin interfaceIExpr- Parameters:
operator- the if the head of this expression equalsoperator, otherwise returnF.NIL.predicate- the predicate which filters each element in this ASTinit1- the result for the 1st result element, if the predicate doesn't givetruefor any of the arguments in this AST.init2- the result for the 2nd result element, if the predicate doesn't givefalsefor any of the arguments in this AST.combiner- the 1st and 2md results element head- Returns:
F.NILif partitioning wasn't possible
-
partitionPlus
public final IAST partitionPlus(Predicate<? super IExpr> predicate, IExpr initYes, IExpr initNo, ISymbol action)
Description copied from interface:IExprSelect all elements by applying thepredicateto each argument in thisPlus(...)expression and append the arguments which satisfy the predicate to the1st elementof the resulting AST, or otherwise append it to the2nd elementof the resulting AST.See: Fateman - Partitioning of Algebraic Subexpressions in Computer Algebra Systems
- Specified by:
partitionPlusin interfaceIExpr- Parameters:
predicate- the predicate which filters each element in this ASTinitYes- the result for the 1st result element, if the predicate doesn't givetruefor any of the arguments in this AST.initNo- the result for the 2nd result element, if the predicate doesn't givefalsefor any of the arguments in this AST.- Returns:
F.NILif partitioning wasn't possible
-
partitionTimes
public final IAST partitionTimes(Predicate<? super IExpr> predicate, IExpr initYes, IExpr initNo, ISymbol action)
Description copied from interface:IExprSelect all elements by applying thepredicateto each argument in thisTimes(...)expression and append the arguments which satisfy the predicate to the1st elementof the resulting AST, or otherwise append it to the2nd elementof the resulting AST.See: Fateman - Partitioning of Algebraic Subexpressions in Computer Algebra Systems
- Specified by:
partitionTimesin interfaceIExpr- Parameters:
predicate- the predicate which filters each element in this ASTinitYes- the result for the 1st result element, if the predicate doesn't givetruefor any of the arguments in this AST.initNo- the result for the 2nd result element, if the predicate doesn't givefalsefor any of the arguments in this AST.- Returns:
F.NILif partitioning wasn't possible
-
patternHashCode
public final int patternHashCode()
Calculate a special hash value to find a matching rule in a hash table- Specified by:
patternHashCodein interfaceIAST- Returns:
-
prependClone
public final IASTAppendable prependClone(IExpr expr)
Prepend an expression to this list.- Specified by:
prependClonein interfaceIAST- Returns:
thisafter prepending the given expression.
-
putProperty
public Object putProperty(IAST.PROPERTY key, Object value)
Associates the specified value with the specified property in the associatedEnumMap<PROPERTY, Object>map. If the map previously contained a mapping for this key, the old value is replaced.- Parameters:
key-value-- Returns:
- See Also:
getProperty(PROPERTY)
-
remove
public IASTAppendable remove(Predicate<? super IExpr> predicate)
Removes all objects which satisfy the given predicate.
-
removeAtClone
public final IASTAppendable removeAtClone(int position)
Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and remove the element at the givenposition.- Specified by:
removeAtClonein interfaceIAST- Returns:
- a clone with removed element at the given position.
-
splice
public IAST splice(int index, int howMany, IExpr... items)
Thesplice()method adds/removes items to/from an AST copy, and returns the copy.- Specified by:
splicein interfaceIAST- Parameters:
index- An integer that specifies at what position to add/remove items.howMany- The number of items to be removed. If set to 0, no items will be removeditems- Optional. The new item(s) to be added to the AST copy- Returns:
- an IAST with removed element at the given position.
-
removeAtCopy
public IASTMutable removeAtCopy(int position)
Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and remove the element at the givenposition.- Specified by:
removeAtCopyin interfaceIAST- Returns:
- an IAST with removed element at the given position.
-
removePositionsAtCopy
public IASTAppendable removePositionsAtCopy(int[] removedPositions, int untilIndex)
Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and remove the elements defined in the givenremovedPositionsArrayup tountilIndex(exclusive).- Specified by:
removePositionsAtCopyin interfaceIASTuntilIndex- up to this position (exclusive) the elements will be removed from the copy- Returns:
- an IAST with removed element at the given position.
-
removePositionsAtCopy
public IAST removePositionsAtCopy(Predicate<IExpr> predicate)
- Specified by:
removePositionsAtCopyin interfaceIAST
-
reverse
public IASTAppendable reverse(IASTAppendable resultList)
Append the elements in reversed order to the givenlist- Specified by:
reversein interfaceIAST- Parameters:
resultList- ifF.NILcreate a newIASTAppendablelist inside the method- Returns:
-
rotateLeft
public IAST rotateLeft(IASTAppendable resultList, int n)
Rotate the ranges elements to the left by n places and append the resulting elements to thelist- Specified by:
rotateLeftin interfaceIAST- Parameters:
resultList-n-- Returns:
- the given list
-
rotateRight
public IAST rotateRight(IASTAppendable resultList, int n)
Rotate the ranges elements to the right by n places and append the resulting elements to thelist- Specified by:
rotateRightin interfaceIAST- Parameters:
resultList-n-- Returns:
- the given list
-
setAtClone
public IASTAppendable setAtClone(int position, IExpr expr)
Create a shallow copy of thisIASTinstance (the elements themselves are not copied) and set theexprat the givenposition.- Specified by:
setAtClonein interfaceIAST- Returns:
- a clone with element set to
exprat the givenposition.
-
setEvalFlags
public final void setEvalFlags(int i)
Set the evaluation flags for this list (i.e. replace all existing flags).- Specified by:
setEvalFlagsin interfaceIAST
-
setPart
public IExpr setPart(IExpr value, int... positions)
- Specified by:
setPartin interfaceIASTMutable
-
signum
@Deprecated public final int signum()
Deprecated.Signum functionality is used in JAS toString() method, don't use it as math signum function.
-
sortInplace
public void sortInplace(Comparator<IExpr> comparator)
Description copied from interface:IASTMutableSortthisin place using functioncomparator#compare(a, b). Example: suppose the Symbol f has the attribute ISymbol.ORDERLESSf(z,d,a,b) ==> f(a,b,d,z)Warning only call this method in certain steps of the evaluation chain (for example for evaluating attribute
ISymbol.ORDERLESS)- Specified by:
sortInplacein interfaceIASTMutable- Parameters:
comparator- the comparator used for sorting inplace.
-
stream
public Stream<IExpr> stream()
Description copied from interface:IASTReturns a sequentialStreamwhich starts at index1of the specified array as its source.
-
stream
public Stream<IExpr> stream(int startInclusive, int endExclusive)
Description copied from interface:IASTReturns a sequentialStreamwith the specified range of the specified array as its source.
-
timesDistributed
public final IExpr timesDistributed(IExpr that)
Description copied from interface:IExprReturns anIExprwhose value is(this * that). CalculatesF.eval(F.Times(this, that))in the common case and uses a specialized implementation for derived number classes.- Specified by:
timesDistributedin interfaceIExpr- Parameters:
that- the multiplier expression- Returns:
(this * that)
-
toDoubleMatrix
public double[][] toDoubleMatrix()
Convert this object into adouble[][]matrix.- Specified by:
toDoubleMatrixin interfaceIExpr- Returns:
nullif this object can not be converted into adouble[]matrix
-
toBooleanVector
public boolean[] toBooleanVector()
Description copied from interface:IExpr- Specified by:
toBooleanVectorin interfaceIExpr- Returns:
-
toBooleValueVector
public boolean[] toBooleValueVector()
Description copied from interface:IExprConvert thisIASTto a boolean vector. The elements of thisIASTcan be 1 (fortrue) and 0 (forfalse).- Specified by:
toBooleValueVectorin interfaceIExpr- Returns:
-
toBooleanMatrix
public boolean[][] toBooleanMatrix()
- Specified by:
toBooleanMatrixin interfaceIExpr
-
toByteMatrix
public byte[][] toByteMatrix()
Description copied from interface:IExprConvert this object into abyte[][]matrix.- Specified by:
toByteMatrixin interfaceIExpr- Returns:
nullif this object can not be converted into abyte[][]matrix
-
toIntMatrix
public int[][] toIntMatrix()
Description copied from interface:IExprConvert this object into abyte[][]matrix.- Specified by:
toIntMatrixin interfaceIExpr- Returns:
nullif this object can not be converted into abyte[][]matrix
-
toDoubleMatrixIgnore
public double[][] toDoubleMatrixIgnore()
Convert this object into adouble[]matrix, if a row is not convertible to double vector ignore the row.- Specified by:
toDoubleMatrixIgnorein interfaceIExpr- Returns:
nullif this object can not be converted into adouble[]matrix
-
toDoubleVector
public double[] toDoubleVector()
Convert this object into adouble[]vector.- Specified by:
toDoubleVectorin interfaceIExpr- Returns:
nullif this object can not be converted into adouble[]vector
-
toDoubleVectorIgnore
public double[] toDoubleVectorIgnore()
Convert this object into adouble[]vector, if an argument is not convertible to double ignore the value.- Specified by:
toDoubleVectorIgnorein interfaceIExpr- Returns:
nullif this object can not be converted into adouble[]vector
-
toComplexVector
public org.hipparchus.complex.Complex[] toComplexVector()
Convert this object into aComplex[]vector.- Specified by:
toComplexVectorin interfaceIExpr- Returns:
nullif this object can not be converted into aComplex[]vector
-
toComplexMatrix
public org.hipparchus.complex.Complex[][] toComplexMatrix()
- Specified by:
toComplexMatrixin interfaceIExpr
-
toIntVector
public int[] toIntVector()
Convert this object into aint[]vector.- Specified by:
toIntVectorin interfaceIExpr- Returns:
nullif the conversion is not possible
-
topHead
public ISymbol topHead()
Returns the ISymbol of the IAST. If the head itself is a IAST it will recursively call head().
-
toRealMatrixIgnore
public org.hipparchus.linear.RealMatrix toRealMatrixIgnore()
Convert this object into a RealMatrix.- Specified by:
toRealMatrixIgnorein interfaceIExpr- Returns:
nullif this object can not be converted into a RealMatrix
-
upper
public IExpr upper()
If this is aInterval({lower, upper})expression return theuppervalue. If this is aIRealexpression returnthis.
-
variables2Slots
public final IExpr variables2Slots(Map<IExpr,IExpr> map, Collection<IExpr> variableCollector)
Convert the variables (i.e. expressions of typeISymbolwhich aren't constants) in this expression into Slot[] s.- Specified by:
variables2Slotsin interfaceIExpr- Parameters:
map- for every given symbol argument return the associated unique slot from this mapvariableCollector- collects the variables which are used in the replacement process- Returns:
F.NILif no variable symbol was found.
-
extractConditionalExpression
public IExpr extractConditionalExpression(boolean isUnaryConditionalExpression)
- Specified by:
extractConditionalExpressionin interfaceIAST- Parameters:
isUnaryConditionalExpression- iftruethisis of the formhead( ConditionalExpression(expr, condition) )- Returns:
-
-