Class GenericGFPoly
java.lang.Object
com.google.zxing.common.reedsolomon.GenericGFPoly
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.
- Author:
- Sean Owen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) GenericGFPolyaddOrSubtract(GenericGFPoly other) (package private) GenericGFPoly[]divide(GenericGFPoly other) (package private) intevaluateAt(int a) (package private) intgetCoefficient(int degree) (package private) int[](package private) int(package private) booleanisZero()(package private) GenericGFPolymultiply(int scalar) (package private) GenericGFPolymultiply(GenericGFPoly other) (package private) GenericGFPolymultiplyByMonomial(int degree, int coefficient) toString()
-
Constructor Details
-
GenericGFPoly
GenericGFPoly(GenericGF field, int[] coefficients) - Parameters:
field- theGenericGFinstance 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 significant- Throws:
IllegalArgumentException- 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")
-
-
Method Details
-
getCoefficients
int[] getCoefficients() -
getDegree
int getDegree()- Returns:
- degree of this polynomial
-
isZero
boolean isZero()- Returns:
- true iff this polynomial is the monomial "0"
-
getCoefficient
int getCoefficient(int degree) - Returns:
- coefficient of x^degree term in this polynomial
-
evaluateAt
int evaluateAt(int a) - Returns:
- evaluation of this polynomial at a given point
-
addOrSubtract
-
multiply
-
multiply
-
multiplyByMonomial
-
divide
-
toString
-