|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.tools.math.poly.UnivariateRealPolynomial
Represents a polynomial object with real coefficients over one real
variable. This class is meant more as an encapsulation of a polynomial
function rather than an algebraic object, as is implemented in the
JSci mathematical/science package.
| Constructor Summary | |
UnivariateRealPolynomial()
Creates an empty polynomial object, the zero polynomial. |
|
UnivariateRealPolynomial(double[] arrCoef)
Creates and initializes a polynomial to the specified coefficients. |
|
| Method Summary | |
double |
evaluateAt(double dblVal)
Evaluate the polynomial for the specifed value of the indeterminate. |
double |
getCoef(int iOrder)
Get the specified coefficient value. |
double[] |
getCoefs()
Return the entire array of polynomial coefficients. |
int |
getDegree()
Return the degree of the polynomial. |
static void |
main(java.lang.String[] args)
Testing driver |
UnivariateRealPolynomial |
plus(UnivariateRealPolynomial polyAddend)
Nondestructively add two polynomials. |
void |
setCoefArray(double[] arrCoef)
Set the entire coefficient array. |
UnivariateRealPolynomial |
times(UnivariateRealPolynomial polyFac)
Nondestructive multiply two polynomials. |
java.lang.String |
toString()
Construct and return a textual representation of the contents of this polynomial as a String object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public UnivariateRealPolynomial()
public UnivariateRealPolynomial(double[] arrCoef)
| Method Detail |
public void setCoefArray(double[] arrCoef)
arrCoef - double array of coefficients.public int getDegree()
public double getCoef(int iOrder)
iOrder specifies order of the indeterminate. For example,
calling getCoef(2) would return the coefficient for the
intdeterminate of second order.
If the value of iOrder is larger than the size of the
coefficient array then the coefficient is assumed to have value zero.
iOrder - order of the indeterminate
public double[] getCoefs()
public double evaluateAt(double dblVal)
dblVal - indeterminate value to evaluate the polynomialpublic UnivariateRealPolynomial plus(UnivariateRealPolynomial polyAddend)
polyAddend - polynomial to be added to this
public UnivariateRealPolynomial times(UnivariateRealPolynomial polyFac)
polyFac - polynomial to be multiplied by this
public java.lang.String toString()
String object.
toString in class java.lang.ObjectObject.toString()public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||