public class Polynomial extends Number
| Constructor and Description |
|---|
Polynomial(RingI baseRing,
String symbol,
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.
|
Number |
calculateValue(Number rootVal) |
Polynomial |
div(Polynomial poly) |
double |
doubleValue()
value of constant coeff.
|
boolean |
equals(Polynomial n) |
float |
floatValue()
value of constant coeff.
|
RingI |
getBaseRing() |
Number |
getCoeff(int i) |
Number[] |
getCoeffs()
Returns the coefficients of polynomial.
|
int |
getDegree() |
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(Number[] coeffs)
Sub classes can change the coefficients.
|
Polynomial |
sub(Polynomial poly) |
String |
toString() |
protected Polynomial |
valueOf(Number[] lcoeffs)
Factory method to create a polynomial with the given coefficients.
|
byteValue, shortValuepublic Polynomial(RingI baseRing, String symbol, 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(Number[] coeffs)
protected Polynomial valueOf(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 int getDegree()
public String getSymbol()
public Number[] getCoeffs()
public Number getCoeff(int i)
public RingI getBaseRing()
public float floatValue()
floatValue in class Numberpublic double doubleValue()
doubleValue in class Numberpublic boolean isConstantPoly()
public boolean equals(Polynomial n)
public Complex calculateComplexValue(Complex rootVal)
Copyright © 2018. All rights reserved.