public class Monomial extends AbstractPNode
pc
Modifier and Type | Method and Description |
---|---|
PNodeI |
add(PNodeI node)
Adds a node to this one.
|
int |
compareTo(PNodeI node)
Compare this to argument. x < y 2 x < 3 x x < x^2 x^2 < x^3 x
< x y TODO x y < x^2
|
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
|
PConstant |
getCoeff() |
int |
getNVars() |
PNodeI |
getPower(int i)
Returns the i-th power
|
PNodeI |
getVar(int i)
Returns the i-th variable
|
PNodeI |
invert()
inverts node i.e. 1/x
|
PNodeI |
mul(PNodeI node)
Multiplies this by the argument.
|
PNodeI |
negate()
negates node i.e.
|
PNodeI |
pow(PNodeI pow)
Raise this to the argument.
|
PNodeI |
sub(PNodeI node)
Subtracts the argument from this.
|
Node |
toCompactNode()
Converts to a more efficient Jep 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,
PConstant c,
PNodeI v) |
static PNodeI |
valueOf(PolynomialCreator pc,
PConstant coefficient,
PNodeI[] terms,
PNodeI[] pows) |
static PNodeI |
valueOf(PolynomialCreator pc,
PConstant c,
PNodeI node,
PNodeI power) |
isOne, isZero
public static PNodeI valueOf(PolynomialCreator pc, PConstant c, PNodeI v)
public static PNodeI valueOf(PolynomialCreator pc, PConstant c, PNodeI node, PNodeI power)
public static PNodeI valueOf(PolynomialCreator pc, PConstant coefficient, PNodeI[] terms, PNodeI[] pows)
public PNodeI mul(PNodeI node) throws ParseException
PNodeI
mul
in interface PNodeI
mul
in class AbstractPNode
ParseException
public PNodeI div(PNodeI node) throws ParseException
PNodeI
div
in interface PNodeI
div
in class AbstractPNode
ParseException
public PNodeI pow(PNodeI pow) throws ParseException
PNodeI
pow
in interface PNodeI
pow
in class AbstractPNode
ParseException
public PNodeI negate() throws ParseException
PNodeI
ParseException
public PNodeI invert() throws ParseException
PNodeI
invert
in interface PNodeI
invert
in class AbstractPNode
ParseException
public PNodeI add(PNodeI node) throws ParseException
PNodeI
add
in interface PNodeI
add
in class AbstractPNode
ParseException
public PNodeI sub(PNodeI node) throws ParseException
PNodeI
sub
in interface PNodeI
sub
in class AbstractPNode
ParseException
public boolean equalsPNode(PNodeI node)
PNodeI
equalsPNode
in interface PNodeI
equalsPNode
in class AbstractPNode
public int compareTo(PNodeI node)
compareTo
in interface PNodeI
compareTo
in interface java.lang.Comparable<PNodeI>
compareTo
in class AbstractPNode
public java.lang.String toString()
PNodeI
public Node toNode() throws ParseException
PNodeI
ParseException
public Node toCompactNode() throws ParseException
PNodeI
ParseException
public PNodeI expand() throws ParseException
PNodeI
ParseException
public PConstant getCoeff()
public int getNVars()
public PNodeI getVar(int i)
i
- public PNodeI getPower(int i)
i
- public void convertToPolyArray(java.lang.String var, java.util.Map<java.lang.Integer,PNodeI> polyArray) throws ParseException
PNodeI
var
- variable namepolyArray
- results added to this mapParseException
Copyright © 2018 Singular Systems http://www.singularsys.com/jep