final class GF256Poly extends Object
Represents a polynomial whose coefficients are elements of GF(256). 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.
Modifier and Type | Field and Description |
---|---|
private int[] |
coefficients |
private GF256 |
field |
Constructor and Description |
---|
GF256Poly(GF256 field,
int[] coefficients) |
Modifier and Type | Method and Description |
---|---|
(package private) GF256Poly |
addOrSubtract(GF256Poly other) |
(package private) GF256Poly[] |
divide(GF256Poly other) |
(package private) int |
evaluateAt(int a) |
(package private) int |
getCoefficient(int degree) |
(package private) int[] |
getCoefficients() |
(package private) int |
getDegree() |
(package private) boolean |
isZero() |
(package private) GF256Poly |
multiply(GF256Poly other) |
(package private) GF256Poly |
multiply(int scalar) |
(package private) GF256Poly |
multiplyByMonomial(int degree,
int coefficient) |
String |
toString() |
private final int[] coefficients
GF256Poly(GF256 field, int[] coefficients)
field
- the GF256
instance representing the field to use
to perform computationscoefficients
- coefficients as ints representing elements of GF(256), 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")int[] getCoefficients()
int getDegree()
boolean isZero()
int getCoefficient(int degree)
int evaluateAt(int a)
GF256Poly addOrSubtract(GF256Poly other)
GF256Poly multiplyByMonomial(int degree, int coefficient)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses