public class Polynomial
extends java.lang.Number
Constructor and Description |
---|
Polynomial(RingI baseRing,
java.lang.String symbol,
java.lang.Number[] coeffs)
Construct a polynomial over a ring.
|
Modifier and Type | Method and Description |
---|---|
Polynomial |
add(Polynomial poly) |
Complex |
calculateComplexValue(Complex rootVal)
returns the complex value of this polynomial.
|
java.lang.Number |
calculateValue(java.lang.Number rootVal) |
Polynomial |
div(Polynomial poly) |
double |
doubleValue()
value of constant coeff.
|
boolean |
equals(Polynomial n) |
float |
floatValue()
value of constant coeff.
|
RingI |
getBaseRing() |
java.lang.Number |
getCoeff(int i) |
java.lang.Number[] |
getCoeffs()
Returns the coefficients of polynomial.
|
int |
getDegree() |
java.lang.String |
getSymbol() |
int |
intValue()
value of constant coeff.
|
boolean |
isConstantPoly()
Is this a constant polynomial?
|
long |
longValue()
value of constant coeff.
|
Polynomial |
mul(Polynomial poly) |
Polynomial |
pow(int exp) |
protected void |
setCoeffs(java.lang.Number[] coeffs)
Sub classes can change the coefficients.
|
Polynomial |
sub(Polynomial poly) |
java.lang.String |
toString() |
protected Polynomial |
valueOf(java.lang.Number[] lcoeffs)
Factory method to create a polynomial with the given coefficients.
|
public Polynomial(RingI baseRing, java.lang.String symbol, java.lang.Number[] coeffs)
baseRing
- the underlying ring of the polynomial.symbol
- the symbol used to display the polynomialcoeffs
- an array of coeficients in the base ring coeff[0] is constant, coeff[1] is coefficient of t etc.protected void setCoeffs(java.lang.Number[] coeffs)
protected Polynomial valueOf(java.lang.Number[] lcoeffs)
public Polynomial add(Polynomial poly)
public Polynomial sub(Polynomial poly)
public Polynomial mul(Polynomial poly)
public Polynomial div(Polynomial poly)
public Polynomial pow(int exp)
public java.lang.String toString()
toString
in class java.lang.Object
public int getDegree()
public java.lang.String getSymbol()
public java.lang.Number[] getCoeffs()
public java.lang.Number getCoeff(int i)
public RingI getBaseRing()
public int intValue()
intValue
in class java.lang.Number
public long longValue()
longValue
in class java.lang.Number
public float floatValue()
floatValue
in class java.lang.Number
public double doubleValue()
doubleValue
in class java.lang.Number
public boolean isConstantPoly()
public boolean equals(Polynomial n)
public Complex calculateComplexValue(Complex rootVal)
public java.lang.Number calculateValue(java.lang.Number rootVal)
http://www.singularsys.com/jep Copyright © 2007 Singular Systems