final class GenericGFPoly extends Object
Represents a polynomial whose coefficients are elements of a GF. Instances of this class are immutable.
Much credit is due to William Rucklidge since portions of this code are an indirect port of his C++ Reed-Solomon implementation.
| Constructor and Description |
|---|
GenericGFPoly(GenericGF field,
int[] coefficients) |
| Modifier and Type | Method and Description |
|---|---|
(package private) GenericGFPoly | addOrSubtract(GenericGFPoly other)add or subtract. |
(package private) GenericGFPoly[] | divide(GenericGFPoly other)divide. |
(package private) int | evaluateAt(int a)evaluate at. |
(package private) int | getCoefficient(int degree)Get the coefficient. |
(package private) int[] | getCoefficients()Get the coefficients. |
(package private) int | getDegree()Get the degree. |
(package private) boolean | isZero()Whether zero. |
(package private) GenericGFPoly | multiply(GenericGFPoly other)multiply. |
(package private) GenericGFPoly | multiply(int scalar)multiply. |
(package private) GenericGFPoly | multiplyByMonomial(int degree,
int coefficient)multiply by monomial. |
String | toString() |
GenericGFPoly(GenericGF field, int[] coefficients)
field - the GenericGF instance representing the field to use
to perform computationscoefficients - coefficients as ints representing elements of GF(size), arranged
from most significant (highest-power term) coefficient to least significantIllegalArgumentException - if argument is null or empty,
or if leading coefficient is 0 and this is not a
constant polynomial (that is, it is not the monomial "0")GenericGFPoly addOrSubtract(GenericGFPoly other)
GenericGFPoly[] divide(GenericGFPoly other)
int evaluateAt(int a)
int getCoefficient(int degree)
int[] getCoefficients()
int getDegree()
boolean isZero()
GenericGFPoly multiply(GenericGFPoly other)
GenericGFPoly multiply(int scalar)
GenericGFPoly multiplyByMonomial(int degree, int coefficient)