Package ca.cgjennings.math
Interface UnivariatePolynomial
-
- All Known Implementing Classes:
Interpolation.LinearRegression
,Interpolation.QuadraticRegression
public interface UnivariatePolynomial
An interface implemented by univariate polynomials, i.e., polynomials in one variable.- Author:
- Chris Jennings
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
getCoefficient(int n)
Returns the nth coefficient for this polynomial.int
getNumCoefficients()
Returns the number of coefficients for this polynomial.
-
-
-
Method Detail
-
getNumCoefficients
int getNumCoefficients()
Returns the number of coefficients for this polynomial. This is not the same as the degree, since the high coefficients may be zero; it simply indicates the highest currently possible coefficient in this implementation.
-
getCoefficient
double getCoefficient(int n)
Returns the nth coefficient for this polynomial.- Throws:
java.lang.IndexOutOfBoundsException
- if n < 0 or n >getNumCoefficients()
-1
-
-