public abstract class AbstractAST extends java.util.AbstractList<IExpr> implements IAST
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractAST.ASTIterator |
IAST.PROPERTY
Modifier and Type | Field and Description |
---|---|
protected int |
fEvalFlags
Flags for controlling evaluation and left-hand-side pattern-matching
expressions
|
protected int |
hashValue |
CONTAINS_DEFAULT_PATTERN, CONTAINS_NO_DEFAULT_PATTERN_MASK, CONTAINS_NO_PATTERN, CONTAINS_PATTERN, CONTAINS_PATTERN_EXPR, CONTAINS_PATTERN_SEQUENCE, IS_ALL_EXPANDED, IS_DECOMPOSED_PARTIAL_FRACTION, IS_EXPANDED, IS_FLAT_ORDERLESS_EVALED, IS_FLATTENED, IS_FLATTENED_OR_SORTED_MASK, IS_LISTABLE_THREADED, IS_MATRIX, IS_MATRIX_OR_VECTOR, IS_SORTED, IS_VECTOR, NO_FLAG
ASTID, BLANKID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID
Constructor and Description |
---|
AbstractAST() |
Modifier and Type | Method and Description |
---|---|
IExpr |
$div(IExpr that)
Operator overloading for Scala operator
/ . |
IExpr |
$minus(IExpr that)
Operator overloading for Scala operator
/ . |
IExpr |
$plus(IExpr that)
Operator overloading for Scala operator
+ . |
IExpr |
$times(IExpr that)
Operator overloading for Scala operator
* . |
IExpr |
$up(IExpr that)
Operator overloading for Scala operator
^ . |
IExpr |
abs()
Absolute value of this.
|
<T> T |
accept(IVisitor<T> visitor)
Accept a visitor with return type T
|
boolean |
accept(IVisitorBoolean visitor)
Accept a visitor with return type
boolean |
int |
accept(IVisitorInt visitor)
Accept a visitor with return type
int |
long |
accept(IVisitorLong visitor)
Accept a visitor with return type
long |
IAST |
addAtClone(int position,
IExpr expr)
Create a shallow copy of this
IAST instance (the elements
themselves are not copied) and add the expr at the given
position . |
void |
addEvalFlags(int i)
Add an evaluation flag to the existing ones.
|
IExpr |
and(IExpr that) |
IAST |
appendClone(IExpr expr)
Append an expression to this list.
|
IExpr |
apply(IExpr... leaves) |
IAST |
apply(IExpr head)
Apply the given head to this expression (i.e. create a list clone and
replace the old head with the given one)
|
IAST |
apply(IExpr head,
int start)
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)
|
IAST |
apply(IExpr head,
int start,
int end)
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)
|
IExpr |
apply(java.util.List<? extends IExpr> leaves) |
ASTRange |
args()
Get the range of elements [1..ast.size()[.
|
java.lang.Object |
asType(java.lang.Class<?> clazz) |
void |
clearHashCache()
Set the cached hash value to zero.
|
IAST |
clone()
Returns a shallow copy of this
IAST instance (the elements
themselves are not cloned). |
int |
compareTo(IExpr rhsExpr)
Compares this expression with the specified expression for canonical
order.
|
boolean |
contains(java.lang.Object object) |
IAST |
copy()
Returns a shallow copy of this
IAST instance (the elements
themselves are not copied). |
IAST |
copyFrom(int index)
Create a copy of this
AST , which contains the same head and
all elements from to the given position (inclusive). |
IAST |
copyHead()
Create a copy of this
AST , which only contains the head
element of the list (i.e. the element with index 0). |
IAST |
copyUntil(int index)
Create a copy of this
AST , which contains the same head and
all elements up to the given position (exclusive). |
IAST |
copyUntil(int intialCapacity,
int index)
Create a copy of this
AST , which contains the same head and
all elements up to the given position (exclusive). |
IExpr |
dec()
Returns an
IExpr whose value is (this - 1) . |
IExpr |
divide(IExpr that)
Returns an
IExpr whose value is (this / that) . |
IExpr[] |
egcd(IExpr b)
Extended greatest common divisor.
|
boolean |
equals(java.lang.Object obj)
Test if this is equal to b.
|
boolean |
equalsAt(int position,
IExpr expr)
Calls
get(position).equals(expr) . |
boolean |
equalsFromPosition(int from0,
IAST f1,
int from1) |
org.apache.commons.math4.complex.Complex |
evalComplex()
Evaluate the expression to a
INumber value. |
double |
evalDouble()
Evaluate the expression to a Java
double value. |
INumber |
evalNumber()
Evaluate the expression to a
INumber value. |
ISignedNumber |
evalSignedNumber()
Evaluate the expression to a
ISignedNumber value. |
IExpr |
evaluate(EvalEngine engine)
Evaluate an expression
|
edu.jas.structure.ElemFactory<IExpr> |
factory()
Get the corresponding element factory.
|
IAST[] |
filter(java.util.function.Function<IExpr,IExpr> function)
Select all elements by applying the
function to each
argument in this AST and append the result elements for
which the function returns non-null elements to the
0th element of the result array, or otherwise append it to
the 1st element of the result array. |
IAST |
filter(IAST filterAST,
IAST restAST,
java.util.function.Function<IExpr,IExpr> function)
Select all elements by applying the
function to each
argument in this AST and append the result elements for
which the function returns non-null elements to the
filterAST , or otherwise append the argument to the
restAST . |
IAST |
filter(IAST filterAST,
IAST restAST,
java.util.function.Predicate<? super IExpr> predicate)
Select all elements by applying the
predicate to each
argument in this AST and append the elements which satisfy
the predicate to the filterAST , or otherwise
append it to the restAST . |
IAST |
filter(IAST filterAST,
IExpr expr)
Select all elements by applying the
Predicates.isTrue(expr)
predicate to each argument in this AST and append the
elements which satisfy the Predicates.isTrue(expr) predicate
to the filterAST . |
IAST |
filter(IAST filterAST,
java.util.function.Predicate<? super IExpr> predicate)
Select all elements by applying the
predicate to each
argument in this AST and append the arguments which satisfy
the predicate to the filterAST . |
IAST |
filter(IAST filterAST,
java.util.function.Predicate<? super IExpr> predicate,
int maxMatches)
Select all elements by applying the
predicate to each
argument in this AST and append up to
maxMatches arguments which satisfy the predicate to the
filterAST . |
IAST[] |
filter(java.util.function.Predicate<? super IExpr> predicate)
Select all elements by applying the
predicate to each
argument in this AST and append the arguments which satisfy
the predicate to the 0th element of the result array, or
otherwise append it to the 1st element of the result array. |
int |
findFirstEquals(IExpr expr)
Find the first argument position, which equals
expr . |
void |
forEach(java.util.function.Consumer<? super IExpr> action)
Iterate over all elements from index
1 to
size()-1 and call the method Consumer.accept()
for these elements. |
java.lang.String |
fullFormString()
Return the
FullForm() of this expression |
IExpr |
gcd(IExpr that)
Greatest common divisor.
|
IExpr |
get(int location) |
IAST |
getAST(int index)
Casts an
IExpr at position index to an
IAST . |
IExpr |
getAt(int index)
Get the element at the specified
index if this object is of
type IAST . |
int |
getEvalFlags()
Get the evaluation flags for this list.
|
int |
getHashCache()
Get the cached hash value.
|
IInteger |
getInt(int index)
Casts an
IExpr at position index to an
IInteger . |
IAST |
getList(int index)
Casts an
IExpr which is a list at position
index to an IAST . |
INumber |
getNumber(int index)
Casts an
IExpr at position index to an
INumber . |
IExpr |
getOneIdentity(IExpr defaultValue)
Get the argument at index 1, if the
size() == 2 or the
complete ast if the size() > 2 (useful for ASTs with
attribute OneIdentity for example for Plus[]
you can call getOneIdentity(F.C0) or for
Times[] ) you can call getOneIdentity(F.C1) . |
IExpr |
getPart(int... positions)
Returns the element at the specified positions in the nested ASTs.
|
IExpr |
getPart(java.util.List<java.lang.Integer> positions)
Returns the element at the specified positions in the nested ASTs.
|
int |
hashCode()
Hashcode of this Element.
|
int |
hierarchy()
A unique integer ID for the implementation of this expression
|
IExpr |
inc()
Returns an
IExpr whose value is (this + 1) . |
int |
indexOf(java.lang.Object object) |
java.lang.String |
internalFormString(boolean symbolsAsFactoryMethod,
int depth)
Return the internal Java form of this expression.
|
java.lang.String |
internalJavaString(boolean symbolsAsFactoryMethod,
int depth,
boolean useOperators)
Return the internal Java form of this expression.
|
java.lang.String |
internalScalaString(boolean symbolsAsFactoryMethod,
int depth)
Return the internal Scala form of this expression.
|
IExpr |
inverse()
Returns the multiplicative inverse of this object.
|
boolean |
isAllExpanded()
Test if this expression and all subexpressions are already expanded i.e.
|
boolean |
isAnd()
Test if this expression is the function
And[<arg>,...] |
boolean |
isArcCos()
Test if this expression is the function
ArcCos[<arg>] |
boolean |
isArcCosh()
Test if this expression is the function
ArcCosh[<arg>] |
boolean |
isArcSin()
Test if this expression is the function
ArcSin[<arg>] |
boolean |
isArcSinh()
Test if this expression is the function
ArcSinh[<arg>] |
boolean |
isArcTan()
Test if this expression is the function
ArcTan[<arg>] |
boolean |
isArcTanh()
Test if this expression is the function
ArcTanh[<arg>] |
boolean |
isAST()
Test if this expression is an AST list, which contains a header
element (i.e. the function name) at index position
0 and
some optional argument elements at the index positions
1..n . |
boolean |
isAST(IExpr header)
Test if this expression is an AST list, which contains the given
header element at index position
0 and some optional
argument elements at the index positions
1.. |
boolean |
isAST(IExpr header,
int length)
Test if this expression is an AST list, which contains the given
header element at index position
0 and optional
argument elements at the index positions
1.. |
boolean |
isAST(IExpr header,
int length,
IExpr... args)
Test if this expression is an AST list, which contains the given
header element at index position
0 and optional
argument elements at the index positions
1.. |
boolean |
isAST(IExpr header,
int minLength,
int maxLength)
Test if this expression is an AST list, which contains the given
header element at index position
0 and optional
argument elements at the index positions
1.. |
boolean |
isAST(java.lang.String symbol)
Test if this expression is an AST list, where the string representation
of the header element at index position
0 equals the
given symbol and some optional argument elements at
the index positions 1.. |
boolean |
isAST(java.lang.String symbol,
int length)
Test if this expression is an AST list, where the string representation
of the header element at index position
0 equals the
given symbol and some optional argument elements at
the index positions 1.. |
boolean |
isASTSizeGE(IExpr header,
int length)
Test if this expression is an AST list, which contains the given
header element at index position
0 and optional
argument elements at the index positions 1..n . |
boolean |
isAtom()
Test if this expression is an atomic expression (i.e. no AST expression)
|
boolean |
isComplex()
Test if this expression is a symbolic complex number (i.e.
|
boolean |
isComplexInfinity()
Test if this expression is representing ComplexInfinity (i.e.
|
boolean |
isComplexNumeric()
Test if this expression is a numeric complex number (i.e.
|
boolean |
isCondition()
Test if this expression is the Condition function
Condition[<arg1>, <arg2>] |
boolean |
isCos()
Test if this expression is the function
Cos[<arg>] |
boolean |
isCosh()
Test if this expression is the function
Cosh[<arg>] |
IAST[] |
isDerivative()
Test if this expression is a
Derivative[number,...] |
boolean |
isDirectedInfinity()
Test if this expression is representing a DirectedInfinity (i.e.
|
boolean |
isEmpty() |
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 |
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. a function symbol like for example
Dot, Plus or Times ) with attribute Flat at
index position 0 and some optional argument elements
at the index positions 1.. |
boolean |
isFraction()
Test if this expression is a fractional number, but no integer number.
|
boolean |
isFree(IExpr pattern)
Returns
true , if all of the elements in the
subexpressions or the expression itself, did not match the given pattern. |
boolean |
isFree(IExpr pattern,
boolean heads)
Returns
true , if all of the elements in the
subexpressions or the expression itself, did not match the given pattern. |
boolean |
isFree(java.util.function.Predicate<IExpr> predicate,
boolean heads)
Returns
true , if all of the elements in the
subexpressions or the expression itself, did not satisfy the given unary
predicate. |
boolean |
isFreeAST(IExpr pattern)
Returns
true , if all of the elements in the
subexpressions or the expression itself, aren't ASTs with a head which
match the given pattern. |
boolean |
isFreeAST(java.util.function.Predicate<IExpr> predicate)
Returns
true , if all of the elements in the
subexpressions or the expression itself, aren't ASTs with a head which
match the given predicate. |
boolean |
isFreeAt(int position,
IExpr pattern)
Returns
true , if all of the elements in the
expressions or the expression itself at the given position ,
did not match the pattern . |
boolean |
isFreeOfPatterns()
Returns
true , if all of the elements in the
subexpressions or the expression itself, are no pattern objects. |
boolean |
isFunction()
Test if this expression is a
Function( arg1 ) expression
with at least 1 argument. |
boolean |
isGEOrdered(IExpr obj)
Compares this expression with the specified expression for order.
|
boolean |
isGTOrdered(IExpr obj)
Compares this expression with the specified expression for order.
|
boolean |
isInfinity()
Test if this expression is representing
Infinity (i.e. |
boolean |
isInteger()
Test if this expression is a integer number
|
boolean |
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")
|
boolean |
isList()
Is this a list (i.e. with header == List)
|
boolean |
isListOfLists()
Test if this expression is a list of lists
|
boolean |
isLog()
Test if this expression is the function
Log[<arg>] |
int[] |
isMatrix()
Test if this expression is a matrix and return the dimensions as array
[row-dimension, column-dimension].
|
boolean |
isMember(java.util.function.Predicate<IExpr> predicate,
boolean heads)
Returns
true , if at least one of the elements in the
subexpressions or the expression itself, satisfy the given unary
predicate. |
boolean |
isModule()
Test if this expression is the Module function
Module[<arg1>, <arg2>] |
boolean |
isNegative()
Test if this object is a negative signed number.
|
boolean |
isNegativeInfinity()
Test if this expression is representing
-Infinity (i.e. |
boolean |
isNegativeResult()
Test if this expression has a negative result (i.e. less than 0).
|
boolean |
isNonNegativeResult()
Test if this expression has a non-negative result (i.e. greater equal 0).
|
boolean |
isNot()
Test if this expression is the function
Not[<arg>] |
boolean |
isNumber()
Test if this expression is a number.
|
boolean |
isNumeric()
Test if this expression is a numeric number (i.e. an instance of type
INum or type IComplexNum . |
boolean |
isNumericFunction()
Test if this expression is a numeric function (i.e. a number, a symbolic
constant or a function (with attribute NumericFunction) where all
arguments are also "numeric functions")
|
boolean |
isNumericMode()
Test if this expression contains a numeric number (i.e. of type
INum or IComplexNum . |
boolean |
isOr()
Test if this expression is the function
Or[<arg>,...] |
boolean |
isOrderlessAST()
Test if this expression is an AST list, which contains a header
element (i.e. a function symbol like for example
Plus or Times ) with attribute Orderless at
index position 0 and some optional argument elements
at the index positions 1..n . |
boolean |
isPatternExpr()
Test if this expression or a subexpression is a pattern object.
|
boolean |
isPlus()
Test if this expression is the addition function
Plus[<arg1>, <arg2>, ...] |
boolean |
isPlusTimesPower()
Test if this expression is a
Plus, Power or Times function. |
boolean |
isPolynomial(IAST variables)
Test if this expression is a polynomial for the given list of
variables . |
boolean |
isPolynomial(ISymbol variable)
Test if this expression is a polynomial for the given
variable . |
boolean |
isPolynomialOfMaxDegree(IAST variables,
long maxDegree) |
boolean |
isPolynomialOfMaxDegree(ISymbol variable,
long maxDegree)
Test if this expression is a polynomial of
maxDegree (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. greater than 0).
|
boolean |
isPower()
Test if this expression is the function
Power[<arg1>, <arg2>] |
boolean |
isRationalResult()
Test if this expression is a rational function (i.e. a number, a symbolic
constant or an rational function where all arguments are also
"rational functions")
|
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")
|
boolean |
isRuleAST()
Test if this expression is of the form
Rule[<arg1>, <arg2>] or
RuleDelayed[<arg1>, <arg2>] . |
boolean |
isSame(IExpr expression)
Test if this expression equals the given expression.
|
boolean |
isSame(IExpr expression,
double epsilon)
Test if this expression equals the given expression.
|
boolean |
isSameHead(IExpr head)
Check if the object at index 0 (i.e. the head of the list) is the same
object as
head |
boolean |
isSameHead(IExpr head,
int length)
Check if the object at index 0 (i.e. the head of the list) is the same
object as
head and if the size of the list equals
length . |
boolean |
isSameHead(IExpr head,
int minLength,
int maxLength)
Check if the object at index 0 (i.e. the head of the list) is the same
object as
head and if the size of the list is between
minLength and maxLength . |
boolean |
isSameHeadSizeGE(IExpr head,
int length)
Check if the object at index 0 (i.e. the head of the list) is the same
object as
head and if the size of the list is greater or
equal length . |
boolean |
isSequence()
Test if this expression is a sequence (i.e. an AST with head Sequence)
|
boolean |
isSignedNumber()
Test if this expression is a signed number.
|
boolean |
isSin()
Test if this expression is the function
Sin[<arg>] |
boolean |
isSinh()
Test if this expression is the function
Sinh[<arg>] |
boolean |
isSlot()
Test if this expression is the function
Slot[<integer-value>] |
boolean |
isSlotSequence()
Test if this expression is the function
SlotSequence[<integer-value>] |
boolean |
isSpan() |
boolean |
isTan()
Test if this expression is the function
TAn[<arg>] |
boolean |
isTanh()
Test if this expression is the function
Tanh[<arg>] |
boolean |
isTimes()
Test if this expression is the multiplication function
Times[<arg1>, <arg2>, ...] |
boolean |
isUnit()
Test if this is a unit.
|
boolean |
isValue()
Returns
true , if this symbol or ast expression is bound to a
value (i.e. the evaluation returns an assigned value). |
int |
isVector()
Test if this expression is a vector and return the dimension of the
vector.
|
java.util.Iterator<IExpr> |
iterator()
Returns an iterator over the elements in this
IAST starting
with offset 1. |
java.util.Iterator<IExpr> |
iterator0()
Returns an iterator over the elements in this list starting with offset
0.
|
IExpr |
last()
Get the last element of the
AST list (i.e. get(size()-1). |
int |
lastIndexOf(java.lang.Object object) |
long |
leafCount()
Count the number of leaves of this expression.
|
java.util.List<IExpr> |
leaves()
Get a list of the leaf expressions.
|
IAST |
map(java.util.function.Function<IExpr,IExpr> function)
Maps the elements of this IAST with the unary functor.
|
IAST |
map(IAST clonedResultAST,
java.util.function.Function<IExpr,IExpr> function)
Maps the elements of this IAST with the unary functor.
|
IAST |
map(IAST resultAST,
IAST secondAST,
java.util.function.BiFunction<IExpr,IExpr,IExpr> function)
Maps the elements of this IAST with the elements of the
secondAST . |
IAST |
map(IExpr head,
java.util.function.Function<IExpr,IExpr> function)
Maps the elements of this IAST with the unary functor.
|
IAST |
mapAt(IAST appendAST,
IAST replacement,
int position)
Maps the elements of this IAST with the unary functor
Functors.replaceArg(replacement, position) , there
replacement is an IAST at which the argument at the given
position will be replaced by the currently mapped element and appends the
element to appendAST . |
IAST |
mapAt(IAST replacement,
int position)
Maps the elements of this IAST with the unary functor
Functors.replaceArg(replacement, position) , there
replacement is an IAST at which the argument at the given
position will be replaced by the currently mapped element. |
IExpr |
minus(IExpr that)
Returns an
IExpr whose value is (this - that) . |
IExpr |
mod(IExpr that) |
IExpr |
multiply(IExpr that)
Additional multiply method which works like
times() to
fulfill groovy's method signature |
IExpr |
negate()
Negate this.
|
IExpr |
negative()
Additional
negative method, which works like opposite to
fulfill groovy's method signature |
IExpr |
opposite()
Returns an
IExpr whose value is (-1) * this . |
IExpr |
optional(IExpr that)
The
ExprNull.NIL#optional() method always returns
that . |
IExpr |
or(IExpr that) |
int |
patternHashCode()
Calculate a special hash value to find a matching rule in a hash table
|
IExpr |
plus(IExpr that)
Returns an
IExpr whose value is (this + that) . |
IExpr |
power(IExpr that)
Returns an
IExpr whose value is (this ^ that) . |
IExpr |
power(long n)
Returns an
IExpr whose value is (this ^ n) . |
IAST |
prependClone(IExpr expr)
Prepend an expression to this list.
|
ASTRange |
range()
Get the range of elements [0..sizeOfAST[ of the AST
|
ASTRange |
range(int start)
Get the range of elements [start..sizeOfAST[ of the AST
|
ASTRange |
range(int start,
int end)
Get the range of elements [start..end[ of the AST
|
IExpr |
remainder(IExpr that)
Remainder after division of this by S.
|
IAST |
removeAtClone(int position)
Create a shallow copy of this
IAST instance (the elements
themselves are not copied) and remove the element at the given
position . |
IExpr |
replaceAll(java.util.function.Function<IExpr,IExpr> function)
Replace all (sub-) expressions with the given unary function.
|
IExpr |
replaceAll(IAST astRules)
Replace all (sub-) expressions with the given rule set.
|
IExpr |
replacePart(IAST astRules)
Replace all subexpressions with the given rule set.
|
IExpr |
replaceRepeated(java.util.function.Function<IExpr,IExpr> function)
Repeatedly replace all (sub-) expressions with the given unary function.
|
IExpr |
replaceRepeated(IAST astRules)
Repeatedly replace all (sub-) expressions with the given rule set.
|
IExpr |
replaceSlots(IAST astSlots)
Replace all occurrences of Slot[<index>] expressions with the
expression at the appropriate
index in the given
slotsList . |
IAST |
setAtClone(int position,
IExpr expr)
Create a shallow copy of this
IAST instance (the elements
themselves are not copied) and set the expr at the given
position . |
void |
setEvalFlags(int i)
Set the evaluation flags for this list.
|
int |
signum()
Deprecated.
|
int |
size()
Returns the number of elements in this
ArrayList . |
IExpr |
subtract(IExpr that)
Subtract S from this.
|
IExpr |
sum(IExpr that)
Sum of this and S.
|
IExpr |
times(IExpr that)
Returns an
IExpr whose value is (this * that) . |
IExpr |
timesDistributed(IExpr that)
Returns an
IExpr whose value is (this * that) . |
ISymbol |
topHead()
Returns the ISymbol of the IAST.
|
java.lang.String |
toScript()
Get a scripting compatible string representation.
|
java.lang.String |
toScriptFactory()
Get a scripting compatible string representation of the factory.
|
java.lang.String |
toString() |
IExpr |
variables2Slots(java.util.Map<IExpr,IExpr> map,
java.util.Collection<IExpr> variableCollector)
Convert the variables (i.e. expressions of type
ISymbol
which aren't constants) in this expression into Slot[] s. |
add, add, addAll, clear, listIterator, listIterator, remove, removeRange, set, subList
addAll, containsAll, remove, removeAll, retainAll, toArray, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, addAll, addOneIdentity, arg1, arg2, arg3, arg4, arg5, asSet, setAtCopy
evaluateHead, getField, head, ifPresent, isBlank, isConstant, isE, isFalse, isIndeterminate, isLEOrdered, isLTOrdered, isMember, isMinusOne, isNumEqualInteger, isNumEqualRational, isNumIntValue, isOne, isONE, isPattern, isPatternDefault, isPatternSequence, isPi, isPresent, isRational, isRationalValue, isSymbol, isTrue, isVariable, isZero, isZERO, multiply, ofNullable, orElse, orElseGet, orElseThrow, reciprocal
protected int fEvalFlags
protected transient int hashValue
public final IExpr $div(IExpr that)
IExpr
/
. Calls
divide(that)
.public final IExpr $minus(IExpr that)
IExpr
/
. Calls
divide(that)
.public final IExpr $plus(IExpr that)
IExpr
+
. Calls
plus(that)
.public final IExpr $times(IExpr that)
IExpr
*
. Calls
times(that)
.public final IExpr $up(IExpr that)
IExpr
^
. Calls
power(that)
.public IExpr abs()
edu.jas.structure.AbelianGroupElem
abs
in interface edu.jas.structure.AbelianGroupElem<IExpr>
public final <T> T accept(IVisitor<T> visitor)
public final boolean accept(IVisitorBoolean visitor)
boolean
public final int accept(IVisitorInt visitor)
int
public long accept(IVisitorLong visitor)
long
public IAST addAtClone(int position, IExpr expr)
IAST
instance (the elements
themselves are not copied) and add the expr
at the given
position
.addAtClone
in interface IAST
expr
element at the given
position
.public final void addEvalFlags(int i)
addEvalFlags
in interface IAST
public IAST appendClone(IExpr expr)
appendClone
in interface IAST
this
after appending the given expression.public IAST apply(IExpr head)
IAST
public final IAST apply(IExpr head, int start)
IAST
public IAST apply(IExpr head, int start, int end)
IAST
public final ASTRange args()
public java.lang.Object asType(java.lang.Class<?> clazz)
public void clearHashCache()
IAST
clearHashCache
in interface IAST
public IAST clone()
IAST
IAST
instance (the elements
themselves are not cloned).public int compareTo(IExpr rhsExpr)
public boolean contains(java.lang.Object object)
public IAST copy()
IAST
IAST
instance (the elements
themselves are not copied). In contrast to the clone()
method, this method returns exactly the same type for
AST0, AST1, AST2,AST3
.public IAST copyFrom(int index)
AST
, which contains the same head and
all elements from to the given position
(inclusive).public final IAST copyHead()
AST
, which only contains the head
element of the list (i.e. the element with index 0).public final IAST copyUntil(int index)
AST
, which contains the same head and
all elements up to the given position
(exclusive).public final IAST copyUntil(int intialCapacity, int index)
AST
, which contains the same head and
all elements up to the given position
(exclusive).public final IExpr dec()
IExpr
whose value is (this - 1)
.
Calculates F.eval(F.Subtract(this, C1))
in the common case
and uses a specialized implementation for derived number classes.public final IExpr divide(IExpr that)
IExpr
whose value is (this / that)
.
Calculates F.eval(F.Times(this, F.Power(that, F.CN1)))
in
the common case and uses a specialized implementation for derived number
classes.public final IExpr[] egcd(IExpr b)
edu.jas.structure.RingElem
egcd
in interface edu.jas.structure.RingElem<IExpr>
b
- other element.public boolean equals(java.lang.Object obj)
edu.jas.structure.Element
public final boolean equalsAt(int position, IExpr expr)
get(position).equals(expr)
.public final boolean equalsFromPosition(int from0, IAST f1, int from1)
public final org.apache.commons.math4.complex.Complex evalComplex()
INumber
value.evalComplex
in interface IExpr
null
if the conversion is not possible.public final double evalDouble()
double
value. If the
conversion to a double value is not possible, the method throws a
WrongArgumentType
exception.evalDouble
in interface IExpr
double
value.public final INumber evalNumber()
INumber
value.evalNumber
in interface IExpr
null
if the conversion is not possible.public final ISignedNumber evalSignedNumber()
ISignedNumber
value.evalSignedNumber
in interface IExpr
null
if the conversion is not possible.public IExpr evaluate(EvalEngine engine)
IExpr
public final edu.jas.structure.ElemFactory<IExpr> factory()
edu.jas.structure.Element
factory
in interface edu.jas.structure.Element<IExpr>
public final IAST[] filter(java.util.function.Function<IExpr,IExpr> function)
function
to each
argument in this AST
and append the result elements for
which the function returns non-null elements to the
0th element
of the result array, or otherwise append it to
the 1st element
of the result array.public final IAST filter(IAST filterAST, IAST restAST, java.util.function.Function<IExpr,IExpr> function)
function
to each
argument in this AST
and append the result elements for
which the function
returns non-null elements to the
filterAST
, or otherwise append the argument to the
restAST
.filter
in interface IAST
filterAST
- the non-null elements which were returned by the
function#apply()
methodrestAST
- the arguments in this AST
for which the
function#apply()
method returned
null
function
- the function which filters each argument by returning a
possibly non-null value.filterAST
public final IAST filter(IAST filterAST, IAST restAST, java.util.function.Predicate<? super IExpr> predicate)
predicate
to each
argument in this AST
and append the elements which satisfy
the predicate
to the filterAST
, or otherwise
append it to the restAST
.public final IAST filter(IAST filterAST, IExpr expr)
Predicates.isTrue(expr)
predicate to each argument in this AST
and append the
elements which satisfy the Predicates.isTrue(expr)
predicate
to the filterAST
.public final IAST filter(IAST filterAST, java.util.function.Predicate<? super IExpr> predicate)
predicate
to each
argument in this AST
and append the arguments which satisfy
the predicate to the filterAST
.public final IAST filter(IAST filterAST, java.util.function.Predicate<? super IExpr> predicate, int maxMatches)
predicate
to each
argument in this AST
and append up to
maxMatches
arguments which satisfy the predicate to the
filterAST
.public final IAST[] filter(java.util.function.Predicate<? super IExpr> predicate)
predicate
to each
argument in this AST
and append the arguments which satisfy
the predicate to the 0th element
of the result array, or
otherwise append it to the 1st element
of the result array.public final int findFirstEquals(IExpr expr)
IAST
expr
. The
serarch starts at index 1
.findFirstEquals
in interface IAST
-1
if no position was foundpublic void forEach(java.util.function.Consumer<? super IExpr> action)
IAST
Iterate over all elements from index 1
to
size()-1
and call the method Consumer.accept()
for these elements.
public final java.lang.String fullFormString()
IExpr
FullForm()
of this expressionfullFormString
in interface IExpr
public final IExpr gcd(IExpr that)
edu.jas.structure.RingElem
gcd
in interface edu.jas.structure.RingElem<IExpr>
that
- other element.public IExpr get(int location)
public final IAST getAST(int index)
IExpr
at position index
to an
IAST
.getAST
in interface IAST
index
- WrongArgumentType
- if the cast is not possiblepublic final IExpr getAt(int index)
IExpr
index
if this object is of
type IAST
.public final int getEvalFlags()
getEvalFlags
in interface IAST
public int getHashCache()
IAST
getHashCache
in interface IAST
public final IInteger getInt(int index)
IExpr
at position index
to an
IInteger
.getInt
in interface IAST
index
- WrongArgumentType
- if the cast is not possiblepublic final IAST getList(int index)
IExpr
which is a list at position
index
to an IAST
.getList
in interface IAST
index
- WrongArgumentType
public final INumber getNumber(int index)
IExpr
at position index
to an
INumber
.getNumber
in interface IAST
index
- WrongArgumentType
- if the cast is not possiblepublic final IExpr getOneIdentity(IExpr defaultValue)
size() == 2
or the
complete ast if the size() > 2
(useful for ASTs with
attribute OneIdentity
for example for Plus[]
you can call getOneIdentity(F.C0)
or for
Times[]
) you can call getOneIdentity(F.C1)
.getOneIdentity
in interface IAST
defaultValue
- default value, if size() < 2
.public final IExpr getPart(int... positions)
IAST
public final IExpr getPart(java.util.List<java.lang.Integer> positions)
IAST
public int hashCode()
edu.jas.structure.Element
public final int hierarchy()
public final IExpr inc()
IExpr
whose value is (this + 1)
.
Calculates F.eval(F.Plus(this, C1))
in the common case and
uses a specialized implementation for derived number classes.public final int indexOf(java.lang.Object object)
public final java.lang.String internalFormString(boolean symbolsAsFactoryMethod, int depth)
internalFormString
in interface IExpr
symbolsAsFactoryMethod
- if true
use the F.symbol()
method,
otherwise print the symbol name.depth
- the recursion depth of this call. 0
indicates
"recurse without a limit".public final java.lang.String internalJavaString(boolean symbolsAsFactoryMethod, int depth, boolean useOperators)
internalJavaString
in interface IExpr
symbolsAsFactoryMethod
- if true
use the F.symbol()
method,
otherwise print the symbol name.depth
- the recursion depth of this call. 0
indicates
"recurse without a limit".useOperators
- use operators instead of function names for representation of
Plus, Times, Power,...public final java.lang.String internalScalaString(boolean symbolsAsFactoryMethod, int depth)
internalScalaString
in interface IExpr
symbolsAsFactoryMethod
- if true
use the F.symbol()
method,
otherwise print the symbol name.depth
- the recursion depth of this call. 0
indicates
"recurse without a limit".public IExpr inverse()
IExpr
this.times(this.inverse()) == ONE
, with ONE
being the multiplicative identity. Calculates
F.eval(F.Power(this, F.CN1))
in the common case and uses a
specialized implmentation for derived number classes.public boolean isAllExpanded()
Plus, Times, Power
(sub-)expressions are expanded.isAllExpanded
in interface IExpr
public final boolean isAnd()
And[<arg>,...]
public final boolean isArcCos()
ArcCos[<arg>]
public final boolean isArcCosh()
ArcCosh[<arg>]
public final boolean isArcSin()
ArcSin[<arg>]
public final boolean isArcSinh()
ArcSinh[<arg>]
public final boolean isArcTan()
ArcTan[<arg>]
public final boolean isArcTanh()
ArcTanh[<arg>]
public boolean isAST()
0
and
some optional argument elements at the index positions
1..n
. Therefore this expression is no atomic
expression.isAST
in interface IExpr
IExpr.isAtom()
public boolean isAST(IExpr header)
0
and some optional
argument elements at the index positions
1..(size()-1)
. Therefore this expression is not an atomic
expression.isAST
in interface IExpr
IExpr.isAtom()
public final boolean isAST(IExpr header, int length)
0
and optional
argument elements at the index positions
1..(length-1)
. Therefore this expression is not an atomic
expression.isAST
in interface IExpr
header
- the header element to chck forlength
- the length the AST expression must haveIExpr.isAtom()
public boolean isAST(IExpr header, int length, IExpr... args)
0
and optional
argument elements at the index positions
1..(length-1)
. Therefore this expression is not an atomic
expression.isAST
in interface IExpr
args
- the arguments of this AST which should be tested, if they are
equal, a null
value argument skips the equals
chack.IExpr.isAtom()
public final boolean isAST(IExpr header, int minLength, int maxLength)
0
and optional
argument elements at the index positions
1..(length-1)
. Therefore this expression is not an atomic
expression.isAST
in interface IExpr
header
- the header element to chck forminLength
- the minimum size the AST expression must havemaxLength
- the maximum size the AST expression must haveIExpr.isAtom()
public final boolean isAST(java.lang.String symbol)
0
equals the
given symbol
and some optional argument elements at
the index positions 1..(size()-1)
. Therefore this expression
is no atomic expression. Example: isAST("Sin")
gives
true
for Sin[Pi/2]
.isAST
in interface IExpr
IExpr.isAtom()
public final boolean isAST(java.lang.String symbol, int length)
0
equals the
given symbol
and some optional argument elements at
the index positions 1..(length-1)
. Therefore this expression
is no atomic expression. Example: isAST("Sin", 2)
gives true
for Sin[0]
.isAST
in interface IExpr
IExpr.isAtom()
public final boolean isASTSizeGE(IExpr header, int length)
0
and optional
argument elements at the index positions 1..n
.
n
must be greater equal than the given length
.
Therefore this expression is no atomic expression.isASTSizeGE
in interface IExpr
IExpr.isAtom()
public final boolean isAtom()
IExpr
public final boolean isComplex()
instanceof IComplex
)public final boolean isComplexInfinity()
isComplexInfinity
in interface IExpr
public final boolean isComplexNumeric()
instanceof IComplexNum
)isComplexNumeric
in interface IExpr
public final boolean isCondition()
Condition[<arg1>, <arg2>]
isCondition
in interface IExpr
public final boolean isCos()
Cos[<arg>]
public final boolean isCosh()
Cosh[<arg>]
public final IAST[] isDerivative()
Test if this expression is a
Derivative[number,...][symbol][arg]
or
Derivative[number,...][symbol]
expression and return the
corresponding IAST
structures.
[0]
contains the
Derivative[number,...]
AST part.[1]
contains the
Derivative[...][symbol]
AST part.[2]
contains the
Derivative[...][...][arg]
AST part, if available.
Note: the result at index [2]
maybe null
, if no argument is available.
isDerivative
in interface IExpr
null
if the expression is not a
Derivative[number,...][symbol][arg]
or
Derivative[number,...][symbol]
expression.public final boolean isDirectedInfinity()
Infinity->DirectedInfinity[1]
,
-Infinity->DirectedInfinity[-1]
,
ComplexInfinity->DirectedInfinity[]
)isDirectedInfinity
in interface IExpr
public final boolean isEmpty()
public final boolean isEvalFlagOff(int i)
isEvalFlagOff
in interface IAST
public final boolean isEvalFlagOn(int i)
isEvalFlagOn
in interface IAST
public final boolean isExpanded()
Plus, Times, Power
expression is expanded.isExpanded
in interface IExpr
public final boolean isFlatAST()
Dot, Plus or Times
) with attribute Flat
at
index position 0
and some optional argument elements
at the index positions 1..(size()-1)
. Examples for
Flat
functions are Dot[], Plus[] or Times[]
.
Therefore this expression is no atomic expression.isFlatAST
in interface IExpr
IExpr.isAtom()
public final boolean isFraction()
isFraction
in interface IExpr
public final boolean isFree(IExpr pattern)
true
, if all of the elements in the
subexpressions or the expression itself, did not match the given pattern.
Calls isFree(pattern, true)
.public final boolean isFree(IExpr pattern, boolean heads)
true
, if all of the elements in the
subexpressions or the expression itself, did not match the given pattern.public final boolean isFree(java.util.function.Predicate<IExpr> predicate, boolean heads)
true
, if all of the elements in the
subexpressions or the expression itself, did not satisfy the given unary
predicate.public final boolean isFreeAST(IExpr pattern)
true
, if all of the elements in the
subexpressions or the expression itself, aren't ASTs with a head which
match the given pattern.public final boolean isFreeAST(java.util.function.Predicate<IExpr> predicate)
true
, if all of the elements in the
subexpressions or the expression itself, aren't ASTs with a head which
match the given predicate.public final boolean isFreeAt(int position, IExpr pattern)
true
, if all of the elements in the
expressions or the expression itself at the given position
,
did not match the pattern
. Calls
get(Position).isFree(pattern, true)
.public final boolean isFreeOfPatterns()
true
, if all of the elements in the
subexpressions or the expression itself, are no pattern objects.isFreeOfPatterns
in interface IExpr
true
if the expression contains no
IPatternObject
.public final boolean isFunction()
Function( arg1 )
expression
with at least 1 argument.isFunction
in interface IExpr
public final boolean isGEOrdered(IExpr obj)
isGEOrdered
in interface IExpr
obj
- an expression to compare withpublic final boolean isGTOrdered(IExpr obj)
isGTOrdered
in interface IExpr
obj
- an expression to compare withpublic final boolean isInfinity()
Infinity
(i.e.
Infinity->DirectedInfinity[1]
)isInfinity
in interface IExpr
public final boolean isInteger()
public final boolean isIntegerResult()
isIntegerResult
in interface IExpr
true
, if the given expression is a integer function
or value.#isRealFunction
public final boolean isList()
public final boolean isListOfLists()
isListOfLists
in interface IExpr
IExpr.isList()
,
IExpr.isMatrix()
,
IExpr.isVector()
public final boolean isLog()
Log[<arg>]
public final int[] isMatrix()
List
and have the
same size.public final boolean isMember(java.util.function.Predicate<IExpr> predicate, boolean heads)
true
, if at least one of the elements in the
subexpressions or the expression itself, satisfy the given unary
predicate.public final boolean isModule()
Module[<arg1>, <arg2>]
public final boolean isNegative()
IAST
object the method checks, if it is a numeric constant. If the
IAST
object evaluates to a negative numeric expression this
method returns true
.isNegative
in interface IExpr
true
, if this < 0
; false
in all other case.public final boolean isNegativeInfinity()
-Infinity
(i.e.
-Infinity->DirectedInfinity[-1]
)isNegativeInfinity
in interface IExpr
public final boolean isNegativeResult()
isNegativeResult
in interface IExpr
true
, if the given expression is a negative function
or value.#isRealFunction
public final boolean isNonNegativeResult()
isNonNegativeResult
in interface IExpr
true
, if the given expression is a non-negative
function or value.#isRealFunction
public final boolean isNot()
Not[<arg>]
public final boolean isNumber()
IExpr
INumber
.public final boolean isNumeric()
INum
or type IComplexNum
.public final boolean isNumericFunction()
isNumericFunction
in interface IExpr
true
, if the given expression is a numeric function
or value.#isRealFunction
public final boolean isNumericMode()
INum
or IComplexNum
.isNumericMode
in interface IExpr
true
, if the given expression contains numeric
number (i.e. of type INum
or
IComplexNum
.#isRealFunction
public final boolean isOr()
Or[<arg>,...]
public final boolean isOrderlessAST()
Plus or Times
) with attribute Orderless
at
index position 0
and some optional argument elements
at the index positions 1..n
. Examples for
Orderless
functions are Plus[] or Times[]
.
Therefore this expression is no atomic expression.isOrderlessAST
in interface IExpr
IExpr.isAtom()
public final boolean isPatternExpr()
IAST
with flag
IAST.CONTAINS_PATTERN_EXPR
.isPatternExpr
in interface IExpr
public final boolean isPlus()
Plus[<arg1>, <arg2>, ...]
public boolean isPlusTimesPower()
Plus, Power or Times
function.isPlusTimesPower
in interface IExpr
public final boolean isPolynomial(IAST variables)
Test if this expression is a polynomial for the given list of
variables
.
true
for a Symbol
expression.isPolynomial
in interface IExpr
variables
- a list of variables or an empty listtrue
if this expression is a polynomial;
false
otherwisepublic final boolean isPolynomial(ISymbol variable)
Test if this expression is a polynomial for the given
variable
.
null
, this method
returns true
for a Symbol
expression.isPolynomial
in interface IExpr
public final boolean isPolynomialOfMaxDegree(IAST variables, long maxDegree)
public final boolean isPolynomialOfMaxDegree(ISymbol variable, long maxDegree)
maxDegree
(i.e.
the maximum exponent <= maxDegree) for the given variable
.isPolynomialOfMaxDegree
in interface IExpr
maxDegree
- the maximum degree of the polynomial; maxDegree must be
greater 0public final boolean isPositive()
IAST
object the method checks, if it is a numeric constant. If the
IAST
object evaluates to a positive numeric expression this
method returns true
.isPositive
in interface IExpr
true
, if this > 0
; false
in all other case.public final boolean isPositiveResult()
isPositiveResult
in interface IExpr
true
, if the given expression is a positive function
or value.#isRealFunction
public final boolean isPower()
Power[<arg1>, <arg2>]
public final boolean isRationalResult()
isRationalResult
in interface IExpr
true
, if the given expression is a rational function
or value.#isRealFunction
public final boolean isRealResult()
isRealResult
in interface IExpr
true
, if the given expression is a real function or
value.IExpr.isIntegerResult()
public final boolean isRuleAST()
Rule[<arg1>, <arg2>]
or
RuleDelayed[<arg1>, <arg2>]
.public final boolean isSame(IExpr expression)
public final boolean isSame(IExpr expression, double epsilon)
public boolean isSameHead(IExpr head)
head
head
- object to compare with element at location 0
public boolean isSameHead(IExpr head, int length)
head
and if the size of the list equals
length
.head
- object to compare with element at location 0
length
- public boolean isSameHead(IExpr head, int minLength, int maxLength)
head
and if the size of the list is between
minLength
and maxLength
.head
- object to compare with element at location 0
minLength
- minimum length of list elements.maxLength
- maximum length of list elements.public boolean isSameHeadSizeGE(IExpr head, int length)
head
and if the size of the list is greater or
equal length
.head
- object to compare with element at location 0
length
- public final boolean isSequence()
isSequence
in interface IExpr
public final boolean isSignedNumber()
ISignedNumber
.isSignedNumber
in interface IExpr
public final boolean isSin()
Sin[<arg>]
public final boolean isSinh()
Sinh[<arg>]
public final boolean isSlot()
Slot[<integer-value>]
public final boolean isSlotSequence()
SlotSequence[<integer-value>]
isSlotSequence
in interface IExpr
public final boolean isTan()
TAn[<arg>]
public final boolean isTanh()
Tanh[<arg>]
public final boolean isTimes()
Times[<arg1>, <arg2>, ...]
public final boolean isUnit()
public final boolean isValue()
true
, if this symbol or ast expression is bound to a
value (i.e. the evaluation returns an assigned value).public final int isVector()
List(...)
and no element is itself a List(...)
.public final java.util.Iterator<IExpr> iterator()
IAST
starting
with offset 1.iterator
in interface java.lang.Iterable<IExpr>
iterator
in interface java.util.Collection<IExpr>
iterator
in interface java.util.List<IExpr>
iterator
in interface IAST
iterator
in class java.util.AbstractList<IExpr>
IAST
s argument values from
1..(size-1)
.public final java.util.Iterator<IExpr> iterator0()
IAST
public final IExpr last()
AST
list (i.e. get(size()-1).last
in interface IAST
AST
.IExpr.head()
public final int lastIndexOf(java.lang.Object object)
public final long leafCount()
public final java.util.List<IExpr> leaves()
public final IAST map(java.util.function.Function<IExpr,IExpr> function)
null
the original element is used (i.e. the functor
didn't modified this AST).
Functors#replace1st()
, where the
first argument will be replaced by the current argument of this AST:
plusAST.map(Functors.replace1st(F.D(null, dAST.arg2())));
public final IAST map(IAST clonedResultAST, java.util.function.Function<IExpr,IExpr> function)
null
the original element of the result list is
used.public final IAST map(IAST resultAST, IAST secondAST, java.util.function.BiFunction<IExpr,IExpr,IExpr> function)
secondAST
.public final IAST map(IExpr head, java.util.function.Function<IExpr,IExpr> function)
null
the original element of the result list is
used.public final IAST mapAt(IAST appendAST, IAST replacement, int position)
Functors.replaceArg(replacement, position)
, there
replacement
is an IAST at which the argument at the given
position will be replaced by the currently mapped element and appends the
element to appendAST
.mapAt
in interface IAST
replacement
- an IAST there the argument at the given position is replaced
by the currently mapped argument of this IAST.appendAST
IAST.map(Function)
public final IAST mapAt(IAST replacement, int position)
Functors.replaceArg(replacement, position)
, there
replacement
is an IAST at which the argument at the given
position will be replaced by the currently mapped element.
Functors#replaceArg()
, where the
argument at the given position will be replaced by the current argument
of this AST:
plusAST.mapAt(F.D(null, F.x), 1);
mapAt
in interface IAST
replacement
- an IAST there the argument at the given position is replaced
by the currently mapped argument of this IAST.IAST.map(Function)
public final IExpr minus(IExpr that)
IExpr
IExpr
whose value is (this - that)
.
Calculates F.eval(F.Plus(this, F.Times(F.CN1, that)))
in the
common case and uses a specialized implementation for derived number
classes.public final IExpr multiply(IExpr that)
times()
to
fulfill groovy's method signaturemultiply
in interface edu.jas.structure.MonoidElem<IExpr>
multiply
in interface org.apache.commons.math4.FieldElement<IExpr>
multiply
in interface IExpr
that
- element to multiplyIExpr.times(IExpr)
public final IExpr negate()
public final IExpr negative()
negative
method, which works like opposite to
fulfill groovy's method signaturenegative
in interface IExpr
IExpr.opposite()
public final IExpr opposite()
IExpr
IExpr
whose value is (-1) * this
.
Calculates F.eval(F.Times(F.CN1, this))
in the common case
and uses a specialized implementation for derived number classes.opposite
in interface IExpr
IExpr.negative()
public final IExpr optional(IExpr that)
ExprNull.NIL#optional()
method always returns
that
. All other objects which implement this method returns
that
if that!=null
or this
if
that==null
optional
in interface IExpr
that
if that!=null
or this
in all other cases.optional(IExpr)
public final int patternHashCode()
patternHashCode
in interface IAST
public final IExpr plus(IExpr that)
IExpr
IExpr
whose value is (this + that)
.
Calculates F.eval(F.Plus(this, that))
in the common case and
uses a specialized implementation for derived number classes.public final IExpr power(IExpr that)
IExpr
whose value is (this ^ that)
.
Calculates F.eval(F.Power(this, that))
in the common case
and uses a specialized implementation for derived number classes.public final IExpr power(long n)
IExpr
IExpr
whose value is (this ^ n)
.
Calculates F.eval(F.Power(this, that))
in the common case
and uses a specialized implementation for derived number classes.public final IAST prependClone(IExpr expr)
prependClone
in interface IAST
this
after prepending the given expression.public final ASTRange range()
public final ASTRange range(int start)
public final ASTRange range(int start, int end)
public final IExpr remainder(IExpr that)
edu.jas.structure.MonoidElem
remainder
in interface edu.jas.structure.MonoidElem<IExpr>
public final IAST removeAtClone(int position)
IAST
instance (the elements
themselves are not copied) and remove the element at the given
position
.removeAtClone
in interface IAST
public final IExpr replaceAll(java.util.function.Function<IExpr,IExpr> function)
null
.replaceAll
in interface IExpr
function
- if the unary functions apply()
method returns
F.NIL
the expression isn't substituted.F.NIL
if no substitution of a (sub-)expression was
possible.public final IExpr replaceAll(IAST astRules)
null
.replaceAll
in interface IExpr
astRules
- rules of the form x->y
or
{a->b, c->d}
; the left-hand-side of the
rule can contain pattern objects.F.NIL
if no substitution of a (sub-)expression was
possible.public final IExpr replacePart(IAST astRules)
F.NIL
.replacePart
in interface IExpr
astRules
- rules of the form position->y
or
{position1->b, position2->d}
F.NIL
if no substitution of a subexpression was
possible.public final IExpr replaceRepeated(java.util.function.Function<IExpr,IExpr> function)
this
.replaceRepeated
in interface IExpr
function
- if the unary functions apply()
method returns
null
the expression isn't substituted.this
if no substitution of a (sub-)expression was
possible.public final IExpr replaceRepeated(IAST astRules)
this
.replaceRepeated
in interface IExpr
astRules
- rules of the form x->y
or
{a->b, c->d}
; the left-hand-side of the
rule can contain pattern objects.this
if no substitution of a (sub-)expression was
possible.public final IExpr replaceSlots(IAST astSlots)
IExpr
Replace all occurrences of Slot[<index>] expressions with the
expression at the appropriate index
in the given
slotsList
.
Note: If a slot value is null
the Slot will not be
substituted.
replaceSlots
in interface IExpr
astSlots
- the values for the slots.null
if no substitution occurred.public final IAST setAtClone(int position, IExpr expr)
IAST
instance (the elements
themselves are not copied) and set the expr
at the given
position
.setAtClone
in interface IAST
expr
at the given
position
.public final void setEvalFlags(int i)
setEvalFlags
in interface IAST
@Deprecated public final int signum()
public int size()
ArrayList
.public final IExpr subtract(IExpr that)
edu.jas.structure.AbelianGroupElem
public final IExpr sum(IExpr that)
edu.jas.structure.AbelianGroupElem
public final IExpr times(IExpr that)
IExpr
IExpr
whose value is (this * that)
.
Calculates F.eval(F.Times(this, that))
in the common case
and uses a specialized implementation for derived number classes.public final IExpr timesDistributed(IExpr that)
IExpr
IExpr
whose value is (this * that)
.
Calculates F.eval(F.Times(this, that))
in the common case
and uses a specialized implementation for derived number classes.timesDistributed
in interface IExpr
that
- the multiplier expression(this * that)
public final ISymbol topHead()
public final java.lang.String toScript()
edu.jas.structure.Element
toScript
in interface edu.jas.structure.Element<IExpr>
public final java.lang.String toScriptFactory()
edu.jas.structure.Element
toScriptFactory
in interface edu.jas.structure.Element<IExpr>
public java.lang.String toString()
toString
in class java.util.AbstractCollection<IExpr>
public final IExpr variables2Slots(java.util.Map<IExpr,IExpr> map, java.util.Collection<IExpr> variableCollector)
ISymbol
which aren't constants) in this expression into Slot[] s.variables2Slots
in interface IExpr
map
- for every given symbol argument return the associated unique
slot from this mapvariableCollector
- collects the variables which are used in the replacement
processF.NIL
if no variable symbol was found.