|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Number org.lsmp.djep.groupJep.values.Polynomial
public class Polynomial
The ring of polynomials over a ring R.
Constructor Summary | |
---|---|
Polynomial(RingI baseRing,
java.lang.String symbol,
java.lang.Number[] coeffs)
Construct a polynomial over a ring. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Number |
---|
byteValue, shortValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |