public class Polynomial extends AbstractPNode
Monomials, but can be any AbstractPNode. The order of the terms is specified by the total ordering.pc| Modifier and Type | Method and Description |
|---|---|
PNodeI |
add(PNodeI node)
Adds a node to this one.
|
PNodeI |
add(Polynomial p) |
int |
compareTo(PNodeI node)
Compares this expression to argument.
|
int |
compareTo(Polynomial p) |
void |
convertToPolyArray(java.lang.String var,
java.util.Map<java.lang.Integer,PNodeI> polyArray)
Internal method for extracting coefficients
|
PNodeI |
div(PNodeI node)
Divides this by the argument.
|
boolean |
equalsPNode(PNodeI node)
True is nodes represent the same parse trees
|
PNodeI |
expand()
complete expansion. (1+x)^2 --> 1+2*x+x^2
|
int |
getNTerms()
The number of terms which make up the polynomial.
|
PNodeI |
getTerm(int i)
Get the n-th term
|
PNodeI |
mul(PNodeI node)
Multiplies this by the argument.
|
PNodeI |
negate()
negates node i.e.
|
PNodeI |
sub(PNodeI node)
Subtracts the argument from this.
|
PNodeI |
sub(Polynomial p) |
Node |
toCompactNode()
A more efficient representation.
|
Node |
toNode()
Converts the node to standard Jep format.
|
java.lang.String |
toString()
Produces a string representation of the argument.
|
static PNodeI |
valueOf(PolynomialCreator pc,
PNodeI[] terms) |
invert, isOne, isZero, powpublic static PNodeI valueOf(PolynomialCreator pc, PNodeI[] terms) throws ParseException
ParseExceptionpublic PNodeI add(PNodeI node) throws ParseException
PNodeIadd in interface PNodeIadd in class AbstractPNodeParseExceptionpublic PNodeI sub(PNodeI node) throws ParseException
PNodeIsub in interface PNodeIsub in class AbstractPNodeParseExceptionpublic PNodeI add(Polynomial p) throws ParseException
ParseExceptionpublic PNodeI sub(Polynomial p) throws ParseException
ParseExceptionpublic PNodeI negate() throws ParseException
PNodeIParseExceptionpublic PNodeI mul(PNodeI node) throws ParseException
PNodeImul in interface PNodeImul in class AbstractPNodeParseExceptionpublic PNodeI div(PNodeI node) throws ParseException
PNodeIdiv in interface PNodeIdiv in class AbstractPNodeParseExceptionpublic boolean equalsPNode(PNodeI node)
PNodeIequalsPNode in interface PNodeIequalsPNode in class AbstractPNodepublic int compareTo(PNodeI node)
PNodeIcompareTo in interface PNodeIcompareTo in interface java.lang.Comparable<PNodeI>compareTo in class AbstractPNodepublic int compareTo(Polynomial p)
public java.lang.String toString()
PNodeIpublic Node toNode() throws ParseException
PNodeIParseExceptionpublic Node toCompactNode() throws ParseException
ParseExceptionpublic PNodeI expand() throws ParseException
PNodeIParseExceptionpublic int getNTerms()
public PNodeI getTerm(int i)
i - index of termspublic void convertToPolyArray(java.lang.String var,
java.util.Map<java.lang.Integer,PNodeI> polyArray)
throws ParseException
PNodeIvar - variable namepolyArray - results added to this mapParseExceptionCopyright © 2018 Singular Systems http://www.singularsys.com/jep