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 class
AbstractAST.ASTIterator
static class
AbstractAST.NILPointer
The classNILPointer
implements 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 int
fEvalFlags
Flags for controlling evaluation and left-hand-side pattern-matching expressionsprotected int
hashValue
-
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 IExpr
accept(IVisitor visitor)
Accept a visitor with return type Tboolean
accept(IVisitorBoolean visitor)
Accept a visitor with return typeboolean
.int
accept(IVisitorInt visitor)
Accept a visitor with return typeint
long
accept(IVisitorLong visitor)
Accept a visitor with return typelong
IAST
addEvalFlags(int i)
Add an evaluation flag to the existing ones.IASTAppendable
appendAtClone(int position, IExpr expr)
Create a shallow copy of thisIAST
instance (the elements themselves are not copied) and add theexpr
at the givenposition
.IASTAppendable
appendClone(IExpr expr)
Append an expression to this list.IASTAppendable
apply(IExpr head)
Apply the given head to this expression (i.e.IAST
apply(IExpr head, int start)
Apply the given head to this expression (i.e.IAST
apply(IExpr head, int start, int end)
Apply the given head to this expression (i.e.Pair
asNumerDenom()
Expressiona/b -> [a, b]
DefaultDict<IExpr>
asPowersDict()
Set<IExpr>
asSet()
Collect all arguments of this AST in a new set.Object
asType(Class<?> clazz)
void
clearHashCache()
Set the cached hash value to zero.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.int
compareTo(IExpr rhsExpr)
Compares this expression with the specified expression for canonical order.boolean
contains(Object object)
Tests whether thisList
contains the specified object.IAST
copyAlloc(int capacity)
IASTAppendable
copyFrom(int index)
Create a copy of thisAST
, which contains the same head and all elements from the givenposition
(inclusive).IASTAppendable
copyFrom(int startPosition, int endPosition)
Create a copy of thisAST
, which contains the same head and all elements from the givenposition
(inclusive).IASTAppendable
copyHead()
Create a copy of thisAST
, which only contains the head element of the list (i.e.IASTAppendable
copyHead(int intialCapacity)
Create a copy of thisAST
, which only contains the head element of the list (i.e.IASTAppendable
copyUntil(int index)
Create a copy of thisAST
, which contains the same head and all elements up to the givenposition
(exclusive).IASTAppendable
copyUntil(int intialCapacity, int index)
Create a copy of thisAST
, which contains the same head and all elements up to the givenposition
(exclusive).int
count(Predicate<? super IExpr> predicate, int fromIndex)
Test each argument with thePredicate
and sum up how often it returnstrue
.int
depth(boolean heads)
Calculates the depth of an expression.long
determinePrecision()
Determine precision of this expression.boolean
equals(Object obj)
boolean
equalsArgs(IExpr that, int startPosition, int endPosition)
Check if this expression and that expression are bothIAST
s with the same number of arguments, where all arguments are equals each other.boolean
equalsAt(int position, IExpr expr)
Callsget(position).equals(expr)
.boolean
equalsFromPosition(int from0, IAST f1, int from1)
IExpr.COMPARE_TERNARY
equalTernary(IExpr that, EvalEngine engine)
IExpr
evalEvaluate(EvalEngine engine)
Evaluate arguments with the headF.Evaluate
, i.e.INumber
evalNumber()
Evaluate the expression to aINumber
value.IReal
evalReal()
Evaluate the expression to aIReal
value.IExpr
evaluate(EvalEngine engine)
Evaluate an expressionboolean
exists(Predicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicate
to each argument in thisAST
and returntrue
if one of the arguments starting from indexstartOffset
satisfy the predicate.boolean
exists(ObjIntPredicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicate
to each argument in thisAST
and returntrue
if one of the arguments starting from indexstartOffset
satisfy the predicate.IExpr
extractConditionalExpression(boolean isUnaryConditionalExpression)
ExtractConditionalExpression
from the arguments ofthis
expression.IASTAppendable[]
filter(Predicate<? super IExpr> predicate)
Select all elements by applying thepredicate
to each argument in thisAST
and append the arguments which satisfy the predicate to the0th element
of the result array, or otherwise append it to the1st element
of the result array.IAST
filter(IASTAppendable filterAST, Predicate<? super IExpr> predicate)
Select all elements by applying thepredicate
to each argument in thisAST
and append the arguments which satisfy the predicate to thefilterAST
.IAST
filter(IASTAppendable filterAST, Predicate<? super IExpr> predicate, int maxMatches)
Select all elements by applying thepredicate
to each argument in thisAST
and append up tomaxMatches
arguments which satisfy the predicate to thefilterAST
.IAST
filter(IASTAppendable filterAST, IASTAppendable restAST, Predicate<? super IExpr> predicate)
Select all elements by applying thepredicate
to each argument in thisAST
and append the elements which satisfy thepredicate
to thefilterAST
, or otherwise append it to therestAST
.IAST
filter(IASTAppendable filterAST, IExpr unaryHead)
Select all elements by applying thePredicates.isTrue(expr)
predicate to each argument in thisAST
and append the elements which satisfy thePredicates.isTrue(expr)
predicate to thefilterAST
.protected IAST
filterFunction(IASTAppendable filterAST, IASTAppendable restAST, Function<IExpr,IExpr> function)
Select all elements by applying thefunction
to each argument in thisAST
and append the result elements for which thefunction
returns nonF.NIL
elements to thefilterAST
, or otherwise append the argument to therestAST
.IASTAppendable[]
filterNIL(Function<IExpr,IExpr> function)
Select all elements by applying thefunction
to each argument in thisAST
and append the result elements for which the function returns nonF.NIL
elements to the0th element
of the result array, or otherwise append it to the1st element
of the result array.IExpr
findFirst(Function<IExpr,IExpr> function)
Find the first argument position, where the thefunction
doesn't returnF.NIL
.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.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.boolean
forAll(Predicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicate
to each argument in thisAST
and returntrue
if all of the arguments starting from indexstartOffset
satisfy the predicate.boolean
forAll(ObjIntPredicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicate
to each argument in thisAST
and returntrue
if all of the arguments starting from indexstartOffset
satisfy the predicate.boolean
forAllLeaves(Predicate<? super IExpr> predicate, int startOffset)
Check all atomic (non IAST objects) leaf elements by applying thepredicate
to each leaf argument in thisAST
and sub-AST
s and returntrue
if all of the leaf elements starting from indexstartOffset
satisfy the predicate.boolean
forAllLeaves(IExpr head, Predicate<? super IExpr> predicate, int startOffset)
void
forEach(Consumer<? super IExpr> action)
Iterate over allvalue-elements
from index1
tosize()-1
and call the methodConsumer.accept()
for these elements.void
forEach(Consumer<? super IExpr> action, int startOffset)
Iterate over allvalue-elements
from indexstartOffset
tosize()-1
and call the methodConsumer.accept()
for these elements.void
forEachRule(Consumer<? super IExpr> action)
Iterate over all elements from index1
tosize()-1
and call the methodConsumer.accept()
for these elements.void
forEachRule(Consumer<? super IExpr> action, int startOffset)
Iterate over all elements from indexstartOffset
tosize()-1
and call the methodConsumer.accept()
for these elements.String
fullFormString()
Return theFullForm()
of this expressionprotected String
fullFormString(IExpr head)
IExpr
gcd(IExpr that)
abstract IExpr
get(int location)
Returns the element at the specified location in thisIAST
.IExpr
get(IInteger location)
Returns the element at the specified location in thisIAST
.IExpr
getArg(int position, IExpr defaultValue)
Returnthis.get(position)
ifargSize() >= position
, otherwise returndefaultValue
IAST
getAST(int index)
Casts anIExpr
at positionindex
to anIAST
.IExpr
getAt(int index)
Get the element at the specifiedindex
if this object is of typeIAST
.int
getEvalFlags()
Get the evaluation flags for this list.int
getHashCache()
Get the cached hash value.IExpr
getIndex(int... positions)
Low level access.IInteger
getInt(int index)
Casts anIExpr
at positionindex
to anIInteger
.IAST
getList(int index)
Casts anIExpr
which is a list at positionindex
to anIAST
.INumber
getNumber(int index)
Casts anIExpr
at positionindex
to anINumber
.IExpr
getOptionalValue()
IExpr
getPart(int... positions)
Returns the element at the specified positions in the nested ASTs.IExpr
getPart(it.unimi.dsi.fastutil.ints.IntList positions)
Returns the element at the specified positions in the nested ASTs.Object
getProperty(IAST.PROPERTY key)
Returns the value to which the specified property is mapped, ornull
if this map contains no mapping for the property.IExpr
getUnevaluated(int position)
Get the argument of theIAST
function (i.e.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.int
hashCode()
FNV-1 hash code of thisIAST
.boolean
hasTrigonometricFunction()
Returnstrue
, if one of the headers of this AST contains a trigonometric function.int
hierarchy()
A unique integer ID for the implementation of this expressionint
indexOf(Predicate<? super IExpr> predicate, int fromIndex)
If this is of typeIAST
, find the first argument position, which fulfills thepredicate
.int
indexOf(IExpr expr)
If this is of typeIAST
, find the first argument position, which equalsexpr
.CharSequence
internalFormString(boolean symbolsAsFactoryMethod, int depth)
Return the internal Java form of this expression.CharSequence
internalJavaString(SourceCodeProperties properties, int depth, Function<ISymbol,? extends CharSequence> variables)
Return the internal Java form of this expression.CharSequence
internalScalaString(boolean symbolsAsFactoryMethod, int depth)
Return the internal Scala form of this expression.IInteger
intSlot()
If this is a slot return the slot number, otherwise returnF.CN1
(value -1)boolean
isAbs()
Test if this expression is the functionAbs[<arg>]
boolean
isAllExpanded()
Test if this expression and all subexpressions are already expanded i.e.boolean
isAlternatives()
Test if this expression is theAlternatives
functionAlternatives[<pattern1>, <pattern2>, ...]
boolean
isAnd()
Test if this expression is the functionAnd[<arg>,...]
and has at least 2 arguments.boolean
isArcCos()
Test if this expression is the functionArcCos[<arg>]
boolean
isArcCosh()
Test if this expression is the functionArcCosh[<arg>]
boolean
isArcSin()
Test if this expression is the functionArcSin[<arg>]
boolean
isArcSinh()
Test if this expression is the functionArcSinh[<arg>]
boolean
isArcTan()
Test if this expression is the functionArcTan[<arg>]
boolean
isArcTanh()
Test if this expression is the functionArcTanh[<arg>]
boolean
isAST()
Test if this expression is an AST function, which contains a header element (i.e.boolean
isAST(String symbol)
Test if this expression is anIAST
function, where the string representation of the header element at index position0
equals the givensymbol
and some optional argument elements at the index positions1..(size()-1)
.boolean
isAST(String symbol, int length)
Test if this expression is anIAST
function, where the string representation of the header element at index position0
equals the givensymbol
and some optional argument elements at the index positions1..(length-1)
.
Therefore this expression is no atomic expression.boolean
isAST(IExpr header)
Test if this expression is an AST function, which contains the given header element at index position0
and some optional argument elements at the index positions1..(size()-1)
.boolean
isAST(IExpr header, int length)
Test if this expression is anIAST
function, which contains the given header element at index position0
and optional argument elements at the index positions1..(length-1)
.boolean
isAST(IExpr head, int minLength, int maxLength)
Test if this expression is anIAST
function, which contains the given header element at index position0
and optional argument elements at the index positions1..(length-1)
.boolean
isAST(IExpr header, int length, IExpr... args)
Test if this expression is anIAST
function, which contains the given header element at index position0
and optional argument elements at the index positions1..(length-1)
.boolean
isAST0()
Test if this expression is anIAST
function, which contains a header element (i.e.boolean
isAST1()
Test if this expression is anIAST
function, which contains a header element (i.e.boolean
isAST2()
Test if this expression is anIAST
function, which contains a header element (i.e.boolean
isAST3()
Test if this expression is anIAST
function, which contains a header element (i.e.boolean
isASTSizeGE(IExpr header, int length)
Test if this expression is anIAST
function, which contains the given header element at index position0
and optional argument elements at the index positions1..n
.boolean
isAtom()
Test if this expression is an atomic expression (i.e.boolean
isBooleanFormula()
Test if this expression is a boolean formula (i.e.boolean
isBooleanFunction()
Test if this expression is a boolean function with headAnd, Equivalent, Nand, Nor, Not, Or, Xor
.boolean
isBooleanResult()
Test if this expression is a boolean function (i.e.boolean
isComparatorFunction()
Test if this expression is a comparator function (i.e.boolean
isComplexInfinity()
Test if this expression is representing ComplexInfinity (i.e.boolean
isCondition()
Test if this expression is the Condition functionCondition[<arg1>, <arg2>]
boolean
isConditionalExpression()
Test if this expression is the ConditionalExpression functionConditionalExpression[<arg1>, <arg2>]
boolean
isConjugate()
Test if this expression is the functionConjugate[<arg>]
boolean
isContinuousDistribution()
Test if this expression is a continuous distribution AST (i.e.boolean
isCos()
Test if this expression is the functionCos[<arg>]
boolean
isCosh()
Test if this expression is the functionCosh[<arg>]
boolean
isDefer()
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 correspondingIAST
structures.IAST[]
isDerivativeAST1()
Test if this expression is aDerivative[number][symbol][arg]
orDerivative[number][symbol]
expression with one argument and return the correspondingIAST
structures.boolean
isDirectedInfinity()
Test if this expression is representing a DirectedInfinity (i.e.boolean
isDirectedInfinity(IExpr x)
Test if this expression is representing a DirectedInfinity (i.e.boolean
isDiscreteDistribution()
Test if this expression is a discrete distribution AST (i.e.boolean
isDistribution()
Test if this expression is a distribution AST (i.e.boolean
isEdge()
Test if this expression is an DirectedEdge, UndirectedEdge, Rule, TwoWayRule.boolean
isEmpty()
Test if this AST contains no argumentboolean
isEmptyIntervalData()
boolean
isEmptyList()
Test if this expression is an empty list (i.e.boolean
isEqual()
Test if this expression is the functionEqual[<arg1>, <arg2>]
boolean
isEvalFlagOff(int i)
Are the given evaluation flags disabled for this list ?boolean
isEvalFlagOn(int i)
Are the given evaluation flags enabled for this list ?boolean
isExcept()
Test if this expression is theExcept
functionExcept(<pattern1>)
orExcept(<pattern1>, <pattern2>)
boolean
isExpanded()
Test if this expression is already expanded i.e.boolean
isFlatAST()
Test if this expression is an AST list, which contains a header element (i.e.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.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.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.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.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
.boolean
isFreeOfPatterns()
Returnstrue
, if all of the elements in the subexpressions or the expression itself, are no pattern objects.boolean
isFunction()
Test if this expression is aFunction( arg1 )
orFunction( arg1, arg2 )
expression with at least 1 argument.boolean
isFunctionID(int... builtinIDs)
Test if this expression is anIAST
function with one of the built-in head IDs.boolean
isGEOrdered(IExpr obj)
Compares this expression with the specified expression for order.boolean
isGTOrdered(IExpr obj)
Compares this expression with the specified expression for order.boolean
isHoldAllCompleteAST()
Test if this expression is an AST list, which contains a header element with attributeISymbol.HOLDALLCOMPLETE
at index position0
.boolean
isHoldPatternOrLiteral()
Test if this expression is theHoldPattern
functionHoldPattern[<expression>]
or the deprecatedLiteral[<expression>]
form.boolean
isHyperbolicFunction()
Test if this expression is a hyperbolic function.int
isInexactVector()
boolean
isInfinity()
Test if this expression is representingInfinity
(i.e.boolean
isIntegerResult()
Test if this expression is a integer function (i.e.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.boolean
isInterval1()
Test if this expression is a closed/open ended interval expression with oneList[min, max]
argumentInterval[{min, max}]
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.boolean
isList()
Test if this expression is a list (i.e.boolean
isList(int[] dimensions)
Test if this expression is a nested list with the dimensions.boolean
isList(Predicate<IExpr> pred)
Test if this expression is a list (i.e.boolean
isListableAST()
Test if this expression is anIAST
list, which contains a header element (i.e.org.jgrapht.GraphType
isListOfEdges()
Test if this expression is a list of DirectedEdge or UndirectedEdgeboolean
isListOfLists()
Test if this expression is a list of lists{{...},{...},...}
and contains at least 1 sublist.boolean
isListOfMatrices()
Test if this expression is a list of matrices and contains at least 1 matrix.boolean
isListOfPoints(int pointDimension)
Test ifthis
is a list of points in the given dimension.boolean
isListOfRules(boolean ignoreEmptySublists)
Test if this expression is a list of rules (head Rule or RuleDelayed)boolean
isListOfRulesOrAssociation(boolean ignoreEmptySublists)
Test if this expression is a list of rules (head Rule or RuleDelayed) or an Association.boolean
isListOfStrings()
Test if this expression is a list of strings and contains at least 1 element.boolean
isLog()
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].boolean
isMember(IExpr pattern, boolean heads, IVisitorBoolean visitor)
Returnstrue
, if at least one of the elements in the subexpressions, match the given pattern.boolean
isModule()
Test if this expression is the Module functionModule[<arg1>, <arg2>]
boolean
isModuleOrWithCondition()
boolean
isNegative()
Test if this object is a negative signed number.boolean
isNegativeInfinity()
Test if this expression is representing-Infinity
(i.e.boolean
isNegativeResult()
Test if this expression has a negative result (i.e.boolean
isNonEmptyList()
Test if this expression is a list with at least one element (i.e.boolean
isNonNegativeResult()
Test if this expression has a non-negative result (i.e.boolean
isNot()
Test if this expression is the functionNot[<arg>]
.boolean
isNotEmpty()
Test if this expression is anIAST
and contains at least 1 argumentboolean
isNumericArgument(boolean allowList)
Test if this expression is a numeric number (i.e.boolean
isNumericAST()
Test if this expression is an IAST and contains at least one numeric argument.boolean
isNumericFunction(boolean allowList)
Test if this expression is a numeric function (i.e.boolean
isNumericFunction(Function<IExpr,String> list)
Test if this expression is a numeric function (i.e.boolean
isNumericFunction(VariablesSet varSet)
Test if this expression is a numeric function (i.e.boolean
isNumericFunction(IExpr expr)
Test if this expression is a numeric function (i.e.boolean
isNumericMode()
Test if this expression contains a numeric number (i.e.boolean
isOneIdentityAST1()
Test if this expression is an AST list, which contains a header element (i.e.boolean
isOptional()
Test if this expression is theOptional
functionOptional[<pattern>]
orOptional[<pattern>, <value>]
boolean
isOr()
Test if this expression is the functionOr[<arg>,...]
and has at least 2 arguments.boolean
isOrderlessAST()
Test if this expression is an AST list, which contains a header element (i.e.boolean
isPatternDefault()
Returntrue
, if the expression is a pattern object with an associated default value (for example0
is the default value for the addition expressionx_+y_.
boolean
isPatternExpr()
Test if this expression or a subexpression is a pattern object.boolean
isPatternMatchingFunction()
Test if this expression is a special pattern-matching function (i.e.boolean
isPatternTest()
Test if this expression is thePatternTest
functionPatternTest[<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
.boolean
isPlus()
Test if this expression is the addition functionPlus[<arg1>, <arg2>, ...]
with at least 2 arguments.boolean
isPlus2()
Test if this expression is theS.Plus
functionPlus[<arg1>, <arg2>]
with exactly 2 arguments.boolean
isPlus3()
Test if this expression is theS.Plus
functionPlus[<arg1>, <arg2>, <arg3>]
with exactly 3 arguments.boolean
isPlusTimesPower()
Test if this expression is aPlus, Power or Times
function.boolean
isPolynomial(IAST variables)
Test if this expression is a polynomial for the given list ofvariables
.boolean
isPolynomial(IExpr variable)
Test if this expression is a polynomial for the givenvariable
.boolean
isPolynomialOfMaxDegree(IAST variables, long maxDegree)
boolean
isPolynomialOfMaxDegree(ISymbol variable, long maxDegree)
Test if this expression is a polynomial ofmaxDegree
(i.e.boolean
isPolynomialStruct()
Test if this expression has a polynomial structiure, i.e.boolean
isPositive()
Test if this object is a positive signed number.boolean
isPositiveResult()
Test if this expression has a positive result (i.e.boolean
isPossibleZero(boolean fastTest)
Test if this expression equals0
in symbolic or numeric mode.boolean
isPower()
Test if this expression is the functionPower[<arg1>, <arg2>]
boolean
isPureFunction()
Test if this expression is a "pure" or "anonymous"Function( arg1 )
expression with exactly 1 argument.boolean
isRationalResult()
Test if this expression is a symbolic rational function (i.e.boolean
isRealMatrix()
Test if this expression is a real matrix (i.e.boolean
isRealResult()
Test if this expression is a real function (i.e.boolean
isRealVector()
Test if this expression is a real vector (i.e.boolean
isRule()
Test if this expression is of the formRule[<arg1>, <arg2>]
.boolean
isRuleAST()
Test if this expression is of the formRule[<arg1>, <arg2>]
orRuleDelayed[<arg1>, <arg2>]
.boolean
isRuleDelayed()
Test if this expression is of the formRuleDelayed[<arg1>, <arg2>]
.boolean
isSame(IExpr expression)
Test if this expression equals the given expression.boolean
isSame(IExpr expression, double epsilon)
Test if this expression equals the given expression.boolean
isSameHead(ISymbol head)
Check if the object at index 0 (i.e.boolean
isSameHead(ISymbol head, int length)
Check if the object at index 0 (i.e.boolean
isSameHead(ISymbol head, int minLength, int maxLength)
Check if the object at index 0 (i.e.boolean
isSequence()
Test if this expression is a sequence (i.e.boolean
isSin()
Test if this expression is the functionSin[<arg>]
boolean
isSinh()
Test if this expression is the functionSinh[<arg>]
boolean
isSlot()
Test if this expression is the functionSlot[<integer-value>]
(i.e.boolean
isSlotSequence()
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.boolean
isSubscript()
Test if this expression is the functionSubscript[var, <integer-value>]
.boolean
isTan()
Test if this expression is the functionTan[<arg>]
boolean
isTanh()
Test if this expression is the functionTanh[<arg>]
boolean
isTimes()
Test if this expression is the multiplication functionTimes[<arg1>, <arg2>, ...]
with at least 2 arguments.boolean
isTimes2()
Test if this expression is theS.Times
functionTimes[<arg1>, <arg2>]
with exactly 2 arguments.boolean
isTimes3()
Test if this expression is theS.Times
functionTimes[<arg1>, <arg2>, <arg3>]
with exactly 3 arguments.boolean
isTrigFunction()
Test if this expression is a trigonometric function.boolean
isUnevaluated()
Test if this expression is the functionUnevaluated[<arg>]
boolean
isUnit()
boolean
isValue()
Returnstrue
, if this symbol or ast expression is bound to a value (i.e.boolean
isVariable(boolean polynomialQTest)
Test if this expression is a variable which doesn't has attributeISymbol.CONSTANT
.int
isVector()
Test if this expression is a vector and return the length of the vector.boolean
isWith()
Test if this expression is the With functionWith[<arg1>, <arg2>]
Iterator<IExpr>
iterator()
Returns an iterator over the elements in thisIAST
starting with offset 1.IExpr
last()
Get the last element of theAST
list (i.e.int
lastIndexOf(IExpr object)
long
leafCount()
Count the number of indivisible subexpressions (atoms/leaves) of this expression.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.IExpr[]
linear(IExpr variable)
If this is a linear expressiona + b * x
return the addenda
at index0
and the multiplicantb
at index1
IExpr[]
linearPower(IExpr variable)
If this is an expression of the forma + b * x^n
withn
integer, return the addend at index0
and the multiplicant at index1
and the exponentn
at index2
.IExpr
lower()
If this is aInterval[{lower, upper}]
expression return thelower
value.IAST
makeAST(IExpr head)
Returnthis
ifisAST(head)==true
, otherwise create a new list{this}
from this (i.e.IAST
makeList()
Returnthis
ifisList()==true
, otherwise create a new list{this}
from this (i.e.IAST
map(Function<IExpr,? extends IExpr> function)
Maps the elements of this IAST with the unaryfunctor
.IAST
map(Function<IExpr,? extends IExpr> function, int startOffset)
Maps the elements of this IAST with the unaryfunctor
.IAST
map(IASTAppendable resultAST, IAST secondAST, BiFunction<IExpr,IExpr,IExpr> function)
Maps the elements of this IAST with the elements of thesecondAST
.IASTAppendable
map(IASTAppendable astResult, IUnaryIndexFunction<IExpr,IExpr> function)
Append the mapped ranges elements directly to the givenlist
IAST
map(IASTMutable clonedResultAST, Function<IExpr,IExpr> function)
Maps the elements of this IAST with the unary functor.IAST
map(IExpr head, Function<IExpr,IExpr> function)
Maps the elements of this IAST with the unary functor.IAST
mapLeaf(IExpr testHead, Function<IExpr,IExpr> function, int startOffset)
Maps the leafs (relative totestHead
) of this IAST with the unary functor.IAST
mapLeft(IASTAppendable list, BiFunction<IExpr,IExpr,IExpr> binaryFunction, IExpr leftArg)
Append the mapped ranges elements directly to the givenlist
IExpr
mapMatrixColumns(int[] dim, Function<IExpr,IExpr> f)
This method assumes thatthis
is a list of list in matrix form.IAST
mapReverse(Function<IExpr,IExpr> function)
Maps the elements of this IAST in the reversed order with the unaryfunctor
.IAST
mapRight(IASTAppendable list, BiFunction<IExpr,IExpr,IExpr> binaryFunction, IExpr rightArg)
Append the mapped ranges elements directly to the givenlist
IASTMutable
mapThread(Function<IExpr,IExpr> function)
Maps the elements of this IAST on the first level of arguments with the unaryfunction
.IASTMutable
mapThread(IAST replacement, int position)
Ifthis
is anIAST
:IASTMutable
mapThread(IAST that, BiFunction<IExpr,IExpr,IExpr> function)
Maps the elements ofthis
IAST and ofthat
IAST on the first level of arguments with the binaryfunction
.IASTAppendable
mapThreadEvaled(EvalEngine engine, IASTAppendable appendAST, IAST replacement, int position)
Maps the elements of this IAST with the unary functorFunctors.replaceArg(replacement, position)
, therereplacement
is an IAST at which the argument at the given position will be replaced by the currently mapped element and appends the element toappendAST
.IASTMutable
mapThreadEvaled(EvalEngine engine, IAST replacement, int position)
Maps the elements of thisIAST
on the first level of arguments with the evaluated unary functorFunctors.replaceArg(replacement, position)
, therereplacement
is an IAST at which the argument at the given position will be replaced by the currently mapped element.IExpr
negative()
Additionalnegative
method, which works like opposite to fulfill groovy's method signatureIExpr
normal(boolean nilIfUnevaluated)
Converts a special expression (like a series, association, dataset, sparse array, ...) into a standard normalized expression.IExpr
oneIdentity(IExpr defaultValue)
Return the argument at index 1, if theargSize() == 1
.IExpr
opposite()
Returns anIExpr
whose value is(-1) * this
.IExpr
optional()
TheF.NIL#optional()
method always returnsthat
.IAST
orElse(IAST other)
Returnthis
ifthis
unequalsF.NIL
, otherwise returnother
.IAST
partition(ISymbol operator, Predicate<? super IExpr> predicate, IExpr init1, IExpr init2, ISymbol combiner, ISymbol action)
Select all elements by applying thepredicate
to each argument in thisAST
and append the arguments which satisfy the predicate to the1st element
of the resulting AST, or otherwise append it to the2nd element
of the resulting AST.IAST
partitionPlus(Predicate<? super IExpr> predicate, IExpr initYes, IExpr initNo, ISymbol action)
Select all elements by applying thepredicate
to each argument in thisPlus(...)
expression and append the arguments which satisfy the predicate to the1st element
of the resulting AST, or otherwise append it to the2nd element
of the resulting AST.IAST
partitionTimes(Predicate<? super IExpr> predicate, IExpr initYes, IExpr initNo, ISymbol action)
Select all elements by applying thepredicate
to each argument in thisTimes(...)
expression and append the arguments which satisfy the predicate to the1st element
of the resulting AST, or otherwise append it to the2nd element
of the resulting AST.int
patternHashCode()
Calculate a special hash value to find a matching rule in a hash tableIASTAppendable
prependClone(IExpr expr)
Prepend an expression to this list.Object
putProperty(IAST.PROPERTY key, Object value)
Associates the specified value with the specified property in the associatedEnumMap<PROPERTY, Object>
map.IASTAppendable
remove(Predicate<? super IExpr> predicate)
Removes all objects which satisfy the given predicate.IASTAppendable
removeAtClone(int position)
Create a shallow copy of thisIAST
instance (the elements themselves are not copied) and remove the element at the givenposition
.IASTMutable
removeAtCopy(int position)
Create a shallow copy of thisIAST
instance (the elements themselves are not copied) and remove the element at the givenposition
.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 ListIASTAppendable
removePositionsAtCopy(int[] removedPositions, int untilIndex)
Create a shallow copy of thisIAST
instance (the elements themselves are not copied) and remove the elements defined in the givenremovedPositionsArray
up tountilIndex
(exclusive).IAST
removePositionsAtCopy(Predicate<IExpr> predicate)
IASTAppendable
reverse(IASTAppendable resultList)
Append the elements in reversed order to the givenlist
IExpr
rewrite(int functionID)
IAST
rotateLeft(IASTAppendable resultList, int n)
Rotate the ranges elements to the left by n places and append the resulting elements to thelist
IAST
rotateRight(IASTAppendable resultList, int n)
Rotate the ranges elements to the right by n places and append the resulting elements to thelist
IAST
select(Predicate<? super IExpr> predicate)
Select all elements by applying thepredicate
to each argument in thisAST
and append the arguments which satisfy the predicate.IAST
select(Predicate<? super IExpr> predicate, int maxMatches)
Select all elements by applying thepredicate
to each argument in thisAST
and append up tomaxMatches
arguments which satisfy the predicate.IASTAppendable
setAtClone(int position, IExpr expr)
Create a shallow copy of thisIAST
instance (the elements themselves are not copied) and set theexpr
at the givenposition
.void
setEvalFlags(int i)
Set the evaluation flags for this list (i.e.IExpr
setPart(IExpr value, int... positions)
int
signum()
Deprecated.void
sortInplace(Comparator<IExpr> comparator)
Sortthis
in place using functioncomparator#compare(a, b)
.IAST
splice(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 sequentialStream
which starts at index1
of the specified array as its source.Stream<IExpr>
stream(int startInclusive, int endExclusive)
Returns a sequentialStream
with the specified range of the specified array as its source.IExpr
timesDistributed(IExpr that)
Returns anIExpr
whose value is(this * that)
.boolean[][]
toBooleanMatrix()
boolean[]
toBooleanVector()
Convert thisIAST
to a boolean vector.boolean[]
toBooleValueVector()
Convert thisIAST
to 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.ISymbol
topHead()
Returns the ISymbol of the IAST.org.hipparchus.linear.RealMatrix
toRealMatrixIgnore()
Convert this object into a RealMatrix.String
toString()
IExpr
upper()
If this is aInterval({lower, upper})
expression return theupper
value.IExpr
variables2Slots(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 returntrue
if 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:
addEvalFlags
in interfaceIAST
- Specified by:
addEvalFlags
in interfaceIExpr
- Returns:
-
appendAtClone
public IASTAppendable appendAtClone(int position, IExpr expr)
Create a shallow copy of thisIAST
instance (the elements themselves are not copied) and add theexpr
at the givenposition
.- Specified by:
appendAtClone
in interfaceIAST
- Returns:
- a clone with added
expr
element at the givenposition
.
-
appendClone
public IASTAppendable appendClone(IExpr expr)
Append an expression to this list.- Specified by:
appendClone
in interfaceIAST
- Parameters:
expr
- the expression which should be appended- Returns:
this
after appending the given expression.
-
apply
public IASTAppendable apply(IExpr head)
Description copied from interface:IAST
Apply 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:IAST
Apply 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:IAST
Apply 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:IAST
Get the argument of theIAST
function (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:
getUnevaluated
in interfaceIAST
- Returns:
-
asNumerDenom
public Pair asNumerDenom()
Description copied from interface:IExpr
Expressiona/b -> [a, b]
- Specified by:
asNumerDenom
in interfaceIExpr
- Returns:
-
asPowersDict
public DefaultDict<IExpr> asPowersDict()
- Specified by:
asPowersDict
in interfaceIExpr
-
asSet
public Set<IExpr> asSet()
Description copied from interface:IAST
Collect all arguments of this AST in a new set.
-
clearHashCache
public void clearHashCache()
Description copied from interface:IAST
Set the cached hash value to zero.- Specified by:
clearHashCache
in 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:
compareAdjacent
in interfaceIAST
- Parameters:
predicate
- the binary predicate- Returns:
false
if 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:
compareTo
in interfaceComparable<IExpr>
- Specified by:
compareTo
in interfaceedu.jas.structure.Element<IExpr>
- Specified by:
compareTo
in interfaceIExpr
- See Also:
S.Order
,S.NumericalOrder
-
contains
public boolean contains(Object object)
Tests whether thisList
contains 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). ForASTAssociation
s 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 theintialCapacity
size 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:IAST
Test each argument with thePredicate
and sum up how often it returnstrue
.
-
depth
public int depth(boolean heads)
Calculates the depth of an expression. Atomic expressions (no sublists) have depth1
Example: the nested list[x,[y]]
has depth3
-
determinePrecision
public long determinePrecision()
Determine precision of this expression. Return -1 for symbolic evaluation.- Specified by:
determinePrecision
in 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 bothIAST
s with the same number of arguments, where all arguments are equals each other.- Specified by:
equalsArgs
in interfaceIExpr
startPosition
- (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:
equalTernary
in interfaceIExpr
-
evalNumber
public final INumber evalNumber()
Evaluate the expression to aINumber
value.- Specified by:
evalNumber
in interfaceIExpr
- Returns:
null
if the conversion is not possible.
-
evalReal
public final IReal evalReal()
Evaluate the expression to aIReal
value.
-
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 thepredicate
to each argument in thisAST
and returntrue
if one of the arguments starting from indexstartOffset
satisfy the predicate.
-
exists
public boolean exists(Predicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicate
to each argument in thisAST
and returntrue
if one of the arguments starting from indexstartOffset
satisfy the predicate.
-
filterNIL
public final IASTAppendable[] filterNIL(Function<IExpr,IExpr> function)
Select all elements by applying thefunction
to each argument in thisAST
and append the result elements for which the function returns nonF.NIL
elements to the0th element
of the result array, or otherwise append it to the1st element
of the result array.
-
filter
public IAST filter(IASTAppendable filterAST, IASTAppendable restAST, Predicate<? super IExpr> predicate)
Select all elements by applying thepredicate
to each argument in thisAST
and append the elements which satisfy thepredicate
to 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 thisAST
and 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 thepredicate
to each argument in thisAST
and 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 thepredicate
to each argument in thisAST
and append up tomaxMatches
arguments which satisfy the predicate to thefilterAST
.
-
select
public IAST select(Predicate<? super IExpr> predicate)
Description copied from interface:IAST
Select all elements by applying thepredicate
to each argument in thisAST
and append the arguments which satisfy the predicate.
-
select
public IAST select(Predicate<? super IExpr> predicate, int maxMatches)
Description copied from interface:IAST
Select all elements by applying thepredicate
to each argument in thisAST
and append up tomaxMatches
arguments which satisfy the predicate.
-
filter
public IASTAppendable[] filter(Predicate<? super IExpr> predicate)
Select all elements by applying thepredicate
to each argument in thisAST
and append the arguments which satisfy the predicate to the0th element
of the result array, or otherwise append it to the1st element
of 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 thefunction
to each argument in thisAST
and append the result elements for which thefunction
returns nonF.NIL
elements to thefilterAST
, or otherwise append the argument to therestAST
.- Parameters:
filterAST
- the nonF.NIL
elements which were returned by thefunction#apply()
methodrestAST
- the arguments in thisAST
for which thefunction#apply()
method returnedF.NIL
function
- 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 thepredicate
to each argument in thisAST
and returntrue
if all of the arguments starting from indexstartOffset
satisfy the predicate.Note: If this is an
IAssociation
the rule at the position will be returned.
-
forAll
public boolean forAll(Predicate<? super IExpr> predicate, int startOffset)
Check all elements by applying thepredicate
to each argument in thisAST
and returntrue
if all of the arguments starting from indexstartOffset
satisfy the predicate.Note: If this is an
IAssociation
the 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 thepredicate
to each leaf argument in thisAST
and sub-AST
s and returntrue
if all of the leaf elements starting from indexstartOffset
satisfy the predicate.- Specified by:
forAllLeaves
in interfaceIAST
- Parameters:
predicate
- the predicate which filters each argument in thisAST
startOffset
- start offset from which the leaf elements have to be tested- Returns:
- the
true
if the predicate is true for all elements orfalse
otherwise
-
forAllLeaves
public boolean forAllLeaves(IExpr head, Predicate<? super IExpr> predicate, int startOffset)
Description copied from interface:IAST
Check allIAST
recursively, which don't havehead
as head element and apply thepredicate
to each leaf argument in thisIAST
and sub-AST
s and returntrue
if all of the leaf elements starting from indexstartOffset
satisfy the predicate.- Specified by:
forAllLeaves
in interfaceIAST
predicate
- the predicate which filters each argument in thisAST
startOffset
- start offset from which the leaf elements have to be tested- Returns:
-
forEach
public void forEach(Consumer<? super IExpr> action)
Iterate over allvalue-elements
from index1
tosize()-1
and 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 index1
tosize()-1
and 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:
forEachRule
in interfaceIAST
-
forEach
public void forEach(Consumer<? super IExpr> action, int startOffset)
Iterate over allvalue-elements
from indexstartOffset
tosize()-1
and 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 indexstartOffset
tosize()-1
and 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:
forEachRule
in interfaceIAST
startOffset
- the start offset from which the action.accept() method should be executed
-
fullFormString
public String fullFormString()
Return theFullForm()
of this expression- Specified by:
fullFormString
in interfaceIExpr
- Returns:
-
get
public abstract IExpr get(int location)
Description copied from interface:IAST
Returns the element at the specified location in thisIAST
. If this is anIAssociation
return the value of the rule at the specified location.- Specified by:
get
in interfaceIAST
- Specified by:
get
in 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:IAST
Returns the element at the specified location in thisIAST
.
-
getAST
public final IAST getAST(int index)
Casts anIExpr
at positionindex
to anIAST
.- Specified by:
getAST
in interfaceIAST
- Parameters:
index
-- Returns:
- Throws:
IllegalArgumentException
- if the cast is not possible
-
getAt
public final IExpr getAt(int index)
Description copied from interface:IExpr
Get the element at the specifiedindex
if this object is of typeIAST
.
-
getEvalFlags
public final int getEvalFlags()
Get the evaluation flags for this list.- Specified by:
getEvalFlags
in interfaceIAST
- Returns:
-
getHashCache
public int getHashCache()
Description copied from interface:IAST
Get the cached hash value.- Specified by:
getHashCache
in interfaceIAST
- Returns:
-
getInt
public final IInteger getInt(int index)
Casts anIExpr
at positionindex
to anIInteger
.- Specified by:
getInt
in interfaceIAST
- Parameters:
index
-- Returns:
- Throws:
IllegalArgumentException
- if the cast is not possible
-
getList
public final IAST getList(int index)
Casts anIExpr
which is a list at positionindex
to anIAST
.- Specified by:
getList
in interfaceIAST
- Parameters:
index
-- Returns:
- Throws:
IllegalArgumentException
-
getNumber
public final INumber getNumber(int index)
Casts anIExpr
at positionindex
to anINumber
.- Specified by:
getNumber
in interfaceIAST
- Parameters:
index
-- Returns:
- Throws:
IllegalArgumentException
- if the cast is not possible
-
getOptionalValue
public IExpr getOptionalValue()
- Specified by:
getOptionalValue
in interfaceIExpr
-
getPart
public IExpr getPart(int... positions)
Description copied from interface:IAST
Returns the element at the specified positions in the nested ASTs.
-
getIndex
public IExpr getIndex(int... positions)
Description copied from interface:ITensorAccess
Low level access. It is assumed thatpositions
is a full index within the dimensions of thisISparseArray
orIAST
(vector/matrix/tensor) object.- Specified by:
getIndex
in 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:IAST
Returns 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, ornull
if 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:IAST
Returnstrue
, if one of the headers of this AST contains a trigonometric function.- Specified by:
hasTrigonometricFunction
in 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
IAssociation
the 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 thefunction
doesn't returnF.NIL
. The search starts at index1
.Note: If this is an
IAssociation
the 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:
internalFormString
in interfaceIExpr
- Parameters:
symbolsAsFactoryMethod
- iftrue
use theF.symbol()
method, otherwise print the symbol name.depth
- the recursion depth of this call.0
indicates "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:
internalJavaString
in interfaceIExpr
- Parameters:
properties
- the settings to use for code generation.depth
- the recursion depth of this call.0
indicates "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:
internalScalaString
in interfaceIExpr
- Parameters:
symbolsAsFactoryMethod
- iftrue
use theF.symbol()
method, otherwise print the symbol name.depth
- the recursion depth of this call.0
indicates "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:
isAllExpanded
in interfaceIExpr
- Returns:
-
isAlternatives
public final boolean isAlternatives()
Test if this expression is theAlternatives
functionAlternatives[<pattern1>, <pattern2>, ...]
- Specified by:
isAlternatives
in 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 position0
and some optional argument elements at the index positions1..n
. Therefore this expression is no atomic expression.- Specified by:
isAST
in 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 position0
and some optional argument elements at the index positions1..(size()-1)
. Therefore this expression is not an atomic expression.- Specified by:
isAST
in 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 anIAST
function, which contains the given header element at index position0
and optional argument elements at the index positions1..(length-1)
. If this test givestrue
this expression is not an atomic expression.- Specified by:
isAST
in 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 anIAST
function, which contains the given header element at index position0
and optional argument elements at the index positions1..(length-1)
. If this test givestrue
this expression is not an atomic expression.- Specified by:
isAST
in 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, anull
value 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 anIAST
function, which contains the given header element at index position0
and optional argument elements at the index positions1..(length-1)
. If this test givestrue
this expression is not an atomic expression.- Specified by:
isAST
in 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 anIAST
function, where the string representation of the header element at index position0
equals the givensymbol
and some optional argument elements at the index positions1..(size()-1)
. If this test givestrue
this expression is not an atomic expression.Example:
isAST("Sin")
givestrue
forSin(Pi/2)
.Note: this is a performance critical method, only use it in special cases like for example UI handling etc.
- Specified by:
isAST
in 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 anIAST
function, where the string representation of the header element at index position0
equals the givensymbol
and some optional argument elements at the index positions1..(length-1)
.
Therefore this expression is no atomic expression.
Example:isAST("Sin", 2)
givestrue
forSin(0)
.- Specified by:
isAST
in interfaceIExpr
- Parameters:
symbol
- string representation of the header element at index position0
length
- the size the AST expression must have- Returns:
- See Also:
IExpr.isAtom()
-
isAST0
public boolean isAST0()
Test if this expression is anIAST
function, which contains a header element (i.e. the function name) at index position0
and no argument elements.
Therefore this expression is no atomic expression.- Specified by:
isAST0
in interfaceIExpr
- Returns:
- See Also:
IExpr.isAtom()
-
isAST1
public boolean isAST1()
Test if this expression is anIAST
function, which contains a header element (i.e. the function name) at index position0
and one argument element at the index position1
.
Therefore this expression is no atomic expression.- Specified by:
isAST1
in interfaceIExpr
- Returns:
- See Also:
IExpr.isAtom()
-
isAST2
public boolean isAST2()
Test if this expression is anIAST
function, which contains a header element (i.e. the function name) at index position0
and two argument elements at the index positions1, 2
.
Therefore this expression is no atomic expression.- Specified by:
isAST2
in interfaceIExpr
- Returns:
- See Also:
IExpr.isAtom()
-
isAST3
public boolean isAST3()
Test if this expression is anIAST
function, which contains a header element (i.e. the function name) at index position0
and three argument elements at the index positions1, 2, 3
.
Therefore this expression is no atomic expression.- Specified by:
isAST3
in interfaceIExpr
- Returns:
- See Also:
IExpr.isAtom()
-
isASTSizeGE
public boolean isASTSizeGE(IExpr header, int length)
Test if this expression is anIAST
function, which contains the given header element at index position0
and optional argument elements at the index positions1..n
.n
must be greater equal than the givenlength
.
Therefore this expression is no atomic expression.- Specified by:
isASTSizeGE
in 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:IExpr
Test 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:
isComplexInfinity
in interfaceIExpr
- Returns:
-
isCondition
public boolean isCondition()
Test if this expression is the Condition functionCondition[<arg1>, <arg2>]
- Specified by:
isCondition
in interfaceIExpr
- Returns:
-
isConditionalExpression
public boolean isConditionalExpression()
Test if this expression is the ConditionalExpression functionConditionalExpression[<arg1>, <arg2>]
- Specified by:
isConditionalExpression
in interfaceIExpr
- Returns:
-
isConjugate
public final boolean isConjugate()
Test if this expression is the functionConjugate[<arg>]
- Specified by:
isConjugate
in 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 correspondingIAST
structures.- 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:
isDerivative
in interfaceIExpr
- Returns:
null
if 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 correspondingIAST
structures.- 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:
isDerivativeAST1
in interfaceIExpr
- Returns:
null
if 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:
isDirectedInfinity
in 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:
isDirectedInfinity
in interfaceIExpr
- Returns:
-
isContinuousDistribution
public boolean isContinuousDistribution()
Description copied from interface:IExpr
Test if this expression is a continuous distribution AST (i.e. evakuator is instanceofIContinuousDistribution
- Specified by:
isContinuousDistribution
in interfaceIExpr
- Returns:
-
isDiscreteDistribution
public boolean isDiscreteDistribution()
Description copied from interface:IExpr
Test if this expression is a discrete distribution AST (i.e. BinomialDistribution(), PoissonDistribution(),...)- Specified by:
isDiscreteDistribution
in interfaceIExpr
- Returns:
-
isDistribution
public boolean isDistribution()
Description copied from interface:IExpr
Test if this expression is a distribution AST (i.e. NormalDistribution(), PoissonDistribution(),...)- Specified by:
isDistribution
in interfaceIExpr
- Returns:
-
isEmpty
public final boolean isEmpty()
Description copied from interface:IAST
Test if this AST contains no argument
-
isNotEmpty
public final boolean isNotEmpty()
Description copied from interface:IExpr
Test if this expression is anIAST
and contains at least 1 argument- Specified by:
isNotEmpty
in 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:
isEvalFlagOff
in interfaceIAST
- Specified by:
isEvalFlagOff
in 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:
isEvalFlagOn
in interfaceIAST
- Specified by:
isEvalFlagOn
in interfaceIExpr
- Returns:
- See Also:
IAST.NO_FLAG
-
isExcept
public boolean isExcept()
Test if this expression is theExcept
functionExcept(<pattern1>)
orExcept(<pattern1>, <pattern2>)
-
isExpanded
public boolean isExpanded()
Test if this expression is already expanded i.e.Plus, Times, Power
expression is expanded.- Specified by:
isExpanded
in 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 attributeFlat
at index position0
and some optional argument elements at the index positions1..(size()-1)
. Examples forFlat
functions areDot[], Plus[] or Times[]
. Therefore this expression is no atomic expression.- Specified by:
isFlatAST
in 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:
isFreeOfPatterns
in interfaceIExpr
- Returns:
true
if 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:
isFunction
in 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:
isGEOrdered
in 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:
isGTOrdered
in 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 theHoldPattern
functionHoldPattern[<expression>]
or the deprecatedLiteral[<expression>]
form.- Specified by:
isHoldPatternOrLiteral
in interfaceIExpr
- Returns:
-
isFunctionID
public boolean isFunctionID(int... builtinIDs)
Test if this expression is anIAST
function with one of the built-in head IDs.- Specified by:
isFunctionID
in 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.HOLDALLCOMPLETE
at index position0
.- Specified by:
isHoldAllCompleteAST
in interfaceIExpr
- Returns:
-
isInfinity
public final boolean isInfinity()
Test if this expression is representingInfinity
(i.e.Infinity->DirectedInfinity[1]
)- Specified by:
isInfinity
in 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, Xor
where all arguments are also "boolean formulas")- Specified by:
isBooleanFormula
in 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:
isBooleanResult
in 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:
isBooleanFunction
in 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, UnsameQ
and size greater 2)- Specified by:
isComparatorFunction
in 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:
isIntegerResult
in 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:
isInterval
in 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:
isIntervalData
in interfaceIExpr
- Returns:
-
isEmptyIntervalData
public boolean isEmptyIntervalData()
- Specified by:
isEmptyIntervalData
in 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:
isInterval1
in interfaceIExpr
- Returns:
-
isEmptyList
public boolean isEmptyList()
Test if this expression is an empty list (i.e. a list{}
)- Specified by:
isEmptyList
in 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:
isNonEmptyList
in 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 ifthis
is a list of points in the given dimension. The head of the points can beS.List
,S.Labeled
orS.Style
- Specified by:
isListOfPoints
in interfaceIExpr
- Returns:
-
isListableAST
public final boolean isListableAST()
Description copied from interface:IExpr
Test if this expression is anIAST
list, which contains a header element (i.e. a function symbol at index position0
and some optional argument elements at the index positions1..n
. Examples forListable
functions areCos[], Plus[] or Times[]
. Therefore this expression is no atomic expression.- Specified by:
isListableAST
in 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:
isListOfLists
in 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:
isListOfMatrices
in interfaceIExpr
- Returns:
-
isListOfEdges
public org.jgrapht.GraphType isListOfEdges()
Test if this expression is a list of DirectedEdge or UndirectedEdge- Specified by:
isListOfEdges
in 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:
isListOfRules
in 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:
isListOfRulesOrAssociation
in 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:
isListOfStrings
in 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 aASTRealMatrix
or aList(...)
where all elements are lists with the headerList
and 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 aASTRealMatrix
or aList(...)
where elements which could not be converted to a row vector are ignored.- Specified by:
isMatrixIgnore
in interfaceIExpr
- Returns:
null
if the expression is not a matrix
-
isMember
public boolean isMember(IExpr pattern, boolean heads, IVisitorBoolean visitor)
Description copied from interface:IExpr
Returnstrue
, if at least one of the elements in the subexpressions, match the given pattern. Ifvisitor==null
theisMember()
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:
isModuleOrWithCondition
in interfaceIExpr
-
isNegative
public boolean isNegative()
Test if this object is a negative signed number. For anIAST
object the method checks, if it is a numeric constant. If theIAST
object evaluates to a negative numeric expression this method returnstrue
.- Specified by:
isNegative
in interfaceIExpr
- Returns:
true
, ifthis < 0
;false
in all other case.
-
isNegativeInfinity
public boolean isNegativeInfinity()
Test if this expression is representing-Infinity
(i.e.-Infinity->DirectedInfinity[-1]
)- Specified by:
isNegativeInfinity
in 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:
isNegativeResult
in 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:
isNonNegativeResult
in 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 typeINum
or typeIComplexNum
), anASTRealVector
or anASTRealMatrix
.- Specified by:
isNumericArgument
in 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:
isNumericFunction
in interfaceIExpr
- Parameters:
allowList
- iftrue
aList(...)
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 invarSet
are also numeric.- Specified by:
isNumericFunction
in interfaceIExpr
- Returns:
true
, if the given expression is a numeric function or value, assuming all variables contained invarSet
are 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 thevariable
is also numeric.- Specified by:
isNumericFunction
in 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 inlist
are also numeric.- Specified by:
isNumericFunction
in interfaceIExpr
- Parameters:
list
- a list of variable symbols- Returns:
-
isNumericMode
public boolean isNumericMode()
Test if this expression contains a numeric number (i.e. of typeINum
orIComplexNum
.- Specified by:
isNumericMode
in interfaceIExpr
- Returns:
true
, if the given expression contains numeric number (i.e. of typeINum
orIComplexNum
.- 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 attributeOneIdentity
at index position0
and exactly one argument at the index position1
. Examples forOneIdentity
functions arePlus[] or Times[]
. Therefore this expression is no atomic expression.- Specified by:
isOneIdentityAST1
in interfaceIExpr
- Returns:
- See Also:
IExpr.isAtom()
-
isOptional
public final boolean isOptional()
Test if this expression is theOptional
functionOptional[<pattern>]
orOptional[<pattern>, <value>]
- Specified by:
isOptional
in 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 attributeOrderless
at index position0
and some optional argument elements at the index positions1..n
. Examples forOrderless
functions arePlus[] or Times[]
. Therefore this expression is no atomic expression.- Specified by:
isOrderlessAST
in interfaceIExpr
- Returns:
- See Also:
IExpr.isAtom()
-
isPatternDefault
public boolean isPatternDefault()
Returntrue
, if the expression is a pattern object with an associated default value (for example0
is the default value for the addition expressionx_+y_.
)- Specified by:
isPatternDefault
in interfaceIExpr
- Returns:
-
isPatternExpr
public final boolean isPatternExpr()
Test if this expression or a subexpression is a pattern object. Used in pattern-matching; checks flags inIAST
with flagIAST.CONTAINS_PATTERN_EXPR
.- Specified by:
isPatternExpr
in interfaceIExpr
- Returns:
-
isPatternTest
public final boolean isPatternTest()
Test if this expression is thePatternTest
functionPatternTest[<pattern>, <test>]
- Specified by:
isPatternTest
in 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 headerList
and have the same size.- Specified by:
isPiecewise
in interfaceIExpr
- Returns:
null
if 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.Plus
functionPlus[<arg1>, <arg2>]
with exactly 2 arguments.
-
isPlus3
public boolean isPlus3()
Test if this expression is theS.Plus
functionPlus[<arg1>, <arg2>, <arg3>]
with exactly 3 arguments.
-
isPlusTimesPower
public boolean isPlusTimesPower()
Test if this expression is aPlus, Power or Times
function.- Specified by:
isPlusTimesPower
in 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 returnstrue
for aSymbol
expression.- Specified by:
isPolynomial
in interfaceIExpr
- Parameters:
variables
- a list of variables or an empty list- Returns:
true
if this expression is a polynomial;false
otherwise
-
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 returnstrue
for aSymbol
expression.- Specified by:
isPolynomial
in 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:
isPolynomialStruct
in interfaceIExpr
- Returns:
true
if this expression has a polynomial structure;false
otherwise
-
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:
isPolynomialOfMaxDegree
in 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 anIAST
object the method checks, if it is a numeric constant. If theIAST
object evaluates to a positive numeric expression this method returnstrue
.- Specified by:
isPositive
in interfaceIExpr
- Returns:
true
, ifthis > 0
;false
in 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:
isPositiveResult
in 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:
isPureFunction
in 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:
isRationalResult
in 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 ofASTRealMatrix
or aList[List[...],...,List[...]]
matrix with elements of typeorg.matheclipse.core.expression.Num
.- Specified by:
isRealMatrix
in 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:
isRealResult
in 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 ofASTRealVector
or aList[...]
with elements of typeorg.matheclipse.core.expression.Num
.- Specified by:
isRealVector
in 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:
isRuleDelayed
in 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 ashead
and if the size of the list equalslength
.- Parameters:
head
- object to compare with element at location0
length
-- 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 ashead
and if the size of the list is betweenminLength
andmaxLength
.- Parameters:
head
- object to compare with element at location0
minLength
- 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:
isSequence
in 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:
isSlotSequence
in 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>]
.var
has to be a variable.- Specified by:
isSubscript
in 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.Times
functionTimes[<arg1>, <arg2>]
with exactly 2 arguments.
-
isTimes3
public boolean isTimes3()
Test if this expression is theS.Times
functionTimes[<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:
isTrigFunction
in interfaceIExpr
- Returns:
-
isHyperbolicFunction
public boolean isHyperbolicFunction()
Test if this expression is a hyperbolic function.Note: All detected function types have 1 argument.
- Specified by:
isHyperbolicFunction
in interfaceIExpr
- Returns:
-
isPatternMatchingFunction
public final boolean isPatternMatchingFunction()
Description copied from interface:IAST
Test if this expression is a special pattern-matching function (i.e. Alternatives, Except,...)- Specified by:
isPatternMatchingFunction
in interfaceIAST
- Specified by:
isPatternMatchingFunction
in interfaceIExpr
- Returns:
-
isUnevaluated
public final boolean isUnevaluated()
Test if this expression is the functionUnevaluated[<arg>]
- Specified by:
isUnevaluated
in 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==true
this method tests, as if functionS.PolynomialQ
for the polynomials variable was called, where especiallyIAST
function expressions other than sums, products, and integer powers can be used as polynomial variables.- Specified by:
isVariable
in 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 aASTRealVector
or aList(...)
and no element is itself aList(...)
or aSparseArray(...)
of dimension1
;
-
isInexactVector
public int isInexactVector()
- Specified by:
isInexactVector
in interfaceIExpr
-
isNumericAST
public boolean isNumericAST()
Test if this expression is an IAST and contains at least one numeric argument.- Specified by:
isNumericAST
in 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 equals0
in symbolic or numeric mode. For the numeric test multiple random numbers with aChop()
function test are used.- Specified by:
isPossibleZero
in 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 thisIAST
starting with offset 1.
-
last
public IExpr last()
Get the last element of theAST
list (i.e. get(size()-1). ReturnF.NIL
if this object isn't anAST
or has0
arguments (i.e. only a header element)- Specified by:
last
in interfaceIExpr
- Returns:
- the last argument of the function represented by this
AST
orF.NIL
- See Also:
IExpr.head()
-
lastIndexOf
public final int lastIndexOf(IExpr object)
- Specified by:
lastIndexOf
in 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 inSimplify
as the default "complexity function". Note::S.Indeterminate
returns valueLong.MAX_VALUE
use
IExpr.isZero()
instead.- Specified by:
leafCountSimplify
in interfaceIExpr
- Returns:
-
linear
public IExpr[] linear(IExpr variable)
Description copied from interface:IExpr
If this is a linear expressiona + b * x
return the addenda
at index0
and the multiplicantb
at index1
-
linearPower
public IExpr[] linearPower(IExpr variable)
Description copied from interface:IExpr
If this is an expression of the forma + b * x^n
withn
integer, return the addend at index0
and the multiplicant at index1
and the exponentn
at index2
.- Specified by:
linearPower
in interfaceIExpr
- Parameters:
variable
- the variablex
in the formula- Returns:
null
if this is not an expression of the forma+b*x^n
-
lower
public IExpr lower()
If this is aInterval[{lower, upper}]
expression return thelower
value. If this is aIReal
expression returnthis
.
-
getArg
public IExpr getArg(int position, IExpr defaultValue)
Returnthis.get(position)
ifargSize() >= position
, otherwise returndefaultValue
-
makeList
public IAST makeList()
Returnthis
ifisList()==true
, otherwise create a new list{this}
from this (i.e. returnF.List(this)
).
-
makeAST
public IAST makeAST(IExpr head)
Description copied from interface:IExpr
Returnthis
ifisAST(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 thefunctor
returnsF.NIL
the 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 thefunctor
returnsF.NIL
the 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.NIL
the original leaf of the result list is used.
-
mapReverse
public IAST mapReverse(Function<IExpr,IExpr> function)
Description copied from interface:IAST
Maps the elements of this IAST in the reversed order with the unaryfunctor
. If thefunctor
returnsF.NIL
the original element of this AST list is set at the reversed position.- Specified by:
mapReverse
in 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.NIL
the 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 returnsnull
the 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 thatthis
is 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:
mapMatrixColumns
in interfaceIAST
- Specified by:
mapMatrixColumns
in 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
this
is anIAST
:Maps the elements of this
IAST
on the first level of arguments with the codereplacement.setAtCopy(position, this)
, therereplacement
is 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
this
is 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:
mapThread
in interfaceIAST
- Specified by:
mapThread
in interfaceIExpr
- Parameters:
replacement
- an IAST there the argument at the given position is replaced by the currently mapped argument of thisIAST
.position
- the position inreplacement
which 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 thisIAST
on the first level of arguments with the evaluated unary functorFunctors.replaceArg(replacement, position)
, therereplacement
is 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:
mapThreadEvaled
in interfaceIAST
replacement
- an IAST there the argument at the given position is replaced by the currently mapped argument of thisIAST
.position
- the position inreplacement
which 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 ofthis
IAST and ofthat
IAST on the first level of arguments with the binaryfunction
. The size of the result is the minimum size ofthis
andthat
.
-
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)
, therereplacement
is 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:
mapThreadEvaled
in 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()
Additionalnegative
method, which works like opposite to fulfill groovy's method signature- Specified by:
negative
in 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() > 1
If theargSize() == 0
returndefaultValue
(useful for ASTs with attributeOneIdentity
for example forPlus[]
you can callgetOneIdentity(F.C0)
or forTimes[]
) you can callgetOneIdentity(F.C1)
.- Specified by:
oneIdentity
in interfaceIAST
- Parameters:
defaultValue
- default value, ifsize() < 2
.- Returns:
-
opposite
public IExpr opposite()
Returns anIExpr
whose 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:
opposite
in interfaceIExpr
- Returns:
- See Also:
IExpr.negative()
-
optional
public IExpr optional()
Description copied from interface:IExpr
TheF.NIL#optional()
method always returnsthat
. All other objects which implement this method returnsthat
ifthat!=null
orthis
ifthat==null
-
orElse
public IAST orElse(IAST other)
Description copied from interface:IAST
Returnthis
ifthis
unequalsF.NIL
, otherwise returnother
.- Specified by:
orElse
in interfaceIAST
- Returns:
this
ifthis
unequalsF.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 thepredicate
to each argument in thisAST
and append the arguments which satisfy the predicate to the1st element
of the resulting AST, or otherwise append it to the2nd element
of the resulting AST.See: Fateman - Partitioning of Algebraic Subexpressions in Computer Algebra Systems
- Specified by:
partition
in 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 givetrue
for any of the arguments in this AST.init2
- the result for the 2nd result element, if the predicate doesn't givefalse
for any of the arguments in this AST.combiner
- the 1st and 2md results element head- Returns:
F.NIL
if partitioning wasn't possible
-
partitionPlus
public final IAST partitionPlus(Predicate<? super IExpr> predicate, IExpr initYes, IExpr initNo, ISymbol action)
Description copied from interface:IExpr
Select all elements by applying thepredicate
to each argument in thisPlus(...)
expression and append the arguments which satisfy the predicate to the1st element
of the resulting AST, or otherwise append it to the2nd element
of the resulting AST.See: Fateman - Partitioning of Algebraic Subexpressions in Computer Algebra Systems
- Specified by:
partitionPlus
in interfaceIExpr
- Parameters:
predicate
- the predicate which filters each element in this ASTinitYes
- the result for the 1st result element, if the predicate doesn't givetrue
for any of the arguments in this AST.initNo
- the result for the 2nd result element, if the predicate doesn't givefalse
for any of the arguments in this AST.- Returns:
F.NIL
if partitioning wasn't possible
-
partitionTimes
public final IAST partitionTimes(Predicate<? super IExpr> predicate, IExpr initYes, IExpr initNo, ISymbol action)
Description copied from interface:IExpr
Select all elements by applying thepredicate
to each argument in thisTimes(...)
expression and append the arguments which satisfy the predicate to the1st element
of the resulting AST, or otherwise append it to the2nd element
of the resulting AST.See: Fateman - Partitioning of Algebraic Subexpressions in Computer Algebra Systems
- Specified by:
partitionTimes
in interfaceIExpr
- Parameters:
predicate
- the predicate which filters each element in this ASTinitYes
- the result for the 1st result element, if the predicate doesn't givetrue
for any of the arguments in this AST.initNo
- the result for the 2nd result element, if the predicate doesn't givefalse
for any of the arguments in this AST.- Returns:
F.NIL
if 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:
patternHashCode
in interfaceIAST
- Returns:
-
prependClone
public final IASTAppendable prependClone(IExpr expr)
Prepend an expression to this list.- Specified by:
prependClone
in interfaceIAST
- Returns:
this
after 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 thisIAST
instance (the elements themselves are not copied) and remove the element at the givenposition
.- Specified by:
removeAtClone
in 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:
splice
in 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 thisIAST
instance (the elements themselves are not copied) and remove the element at the givenposition
.- Specified by:
removeAtCopy
in interfaceIAST
- Returns:
- an IAST with removed element at the given position.
-
removePositionsAtCopy
public IASTAppendable removePositionsAtCopy(int[] removedPositions, int untilIndex)
Create a shallow copy of thisIAST
instance (the elements themselves are not copied) and remove the elements defined in the givenremovedPositionsArray
up tountilIndex
(exclusive).- Specified by:
removePositionsAtCopy
in interfaceIAST
untilIndex
- 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:
removePositionsAtCopy
in interfaceIAST
-
reverse
public IASTAppendable reverse(IASTAppendable resultList)
Append the elements in reversed order to the givenlist
- Specified by:
reverse
in interfaceIAST
- Parameters:
resultList
- ifF.NIL
create a newIASTAppendable
list 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:
rotateLeft
in 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:
rotateRight
in interfaceIAST
- Parameters:
resultList
-n
-- Returns:
- the given list
-
setAtClone
public IASTAppendable setAtClone(int position, IExpr expr)
Create a shallow copy of thisIAST
instance (the elements themselves are not copied) and set theexpr
at the givenposition
.- Specified by:
setAtClone
in interfaceIAST
- Returns:
- a clone with element set to
expr
at the givenposition
.
-
setEvalFlags
public final void setEvalFlags(int i)
Set the evaluation flags for this list (i.e. replace all existing flags).- Specified by:
setEvalFlags
in interfaceIAST
-
setPart
public IExpr setPart(IExpr value, int... positions)
- Specified by:
setPart
in 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:IASTMutable
Sortthis
in 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:
sortInplace
in interfaceIASTMutable
- Parameters:
comparator
- the comparator used for sorting inplace.
-
stream
public Stream<IExpr> stream()
Description copied from interface:IAST
Returns a sequentialStream
which starts at index1
of the specified array as its source.
-
stream
public Stream<IExpr> stream(int startInclusive, int endExclusive)
Description copied from interface:IAST
Returns a sequentialStream
with the specified range of the specified array as its source.
-
timesDistributed
public final IExpr timesDistributed(IExpr that)
Description copied from interface:IExpr
Returns anIExpr
whose 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:
timesDistributed
in interfaceIExpr
- Parameters:
that
- the multiplier expression- Returns:
(this * that)
-
toDoubleMatrix
public double[][] toDoubleMatrix()
Convert this object into adouble[][]
matrix.- Specified by:
toDoubleMatrix
in interfaceIExpr
- Returns:
null
if this object can not be converted into adouble[]
matrix
-
toBooleanVector
public boolean[] toBooleanVector()
Description copied from interface:IExpr
- Specified by:
toBooleanVector
in interfaceIExpr
- Returns:
-
toBooleValueVector
public boolean[] toBooleValueVector()
Description copied from interface:IExpr
Convert thisIAST
to a boolean vector. The elements of thisIAST
can be 1 (fortrue
) and 0 (forfalse
).- Specified by:
toBooleValueVector
in interfaceIExpr
- Returns:
-
toBooleanMatrix
public boolean[][] toBooleanMatrix()
- Specified by:
toBooleanMatrix
in interfaceIExpr
-
toByteMatrix
public byte[][] toByteMatrix()
Description copied from interface:IExpr
Convert this object into abyte[][]
matrix.- Specified by:
toByteMatrix
in interfaceIExpr
- Returns:
null
if this object can not be converted into abyte[][]
matrix
-
toIntMatrix
public int[][] toIntMatrix()
Description copied from interface:IExpr
Convert this object into abyte[][]
matrix.- Specified by:
toIntMatrix
in interfaceIExpr
- Returns:
null
if 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:
toDoubleMatrixIgnore
in interfaceIExpr
- Returns:
null
if this object can not be converted into adouble[]
matrix
-
toDoubleVector
public double[] toDoubleVector()
Convert this object into adouble[]
vector.- Specified by:
toDoubleVector
in interfaceIExpr
- Returns:
null
if 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:
toDoubleVectorIgnore
in interfaceIExpr
- Returns:
null
if this object can not be converted into adouble[]
vector
-
toComplexVector
public org.hipparchus.complex.Complex[] toComplexVector()
Convert this object into aComplex[]
vector.- Specified by:
toComplexVector
in interfaceIExpr
- Returns:
null
if this object can not be converted into aComplex[]
vector
-
toComplexMatrix
public org.hipparchus.complex.Complex[][] toComplexMatrix()
- Specified by:
toComplexMatrix
in interfaceIExpr
-
toIntVector
public int[] toIntVector()
Convert this object into aint[]
vector.- Specified by:
toIntVector
in interfaceIExpr
- Returns:
null
if 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:
toRealMatrixIgnore
in interfaceIExpr
- Returns:
null
if this object can not be converted into a RealMatrix
-
upper
public IExpr upper()
If this is aInterval({lower, upper})
expression return theupper
value. If this is aIReal
expression returnthis
.
-
variables2Slots
public final IExpr variables2Slots(Map<IExpr,IExpr> map, Collection<IExpr> variableCollector)
Convert the variables (i.e. expressions of typeISymbol
which aren't constants) in this expression into Slot[] s.- Specified by:
variables2Slots
in 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.NIL
if no variable symbol was found.
-
extractConditionalExpression
public IExpr extractConditionalExpression(boolean isUnaryConditionalExpression)
- Specified by:
extractConditionalExpression
in interfaceIAST
- Parameters:
isUnaryConditionalExpression
- iftrue
this
is of the formhead( ConditionalExpression(expr, condition) )
- Returns:
-
-