Class GaliosFieldTableOps_U16
Code and code comments based on the tutorial at [1].
[1] Reed-Solomon Codes for Coders Viewed on September 28, 2017
-
Field Summary
Fields inherited from class boofcv.alg.fiducial.qrcode.GaliosFieldTableOps
exp, log, max_value, num_values, numBits, primitive
-
Constructor Summary
ConstructorDescriptionGaliosFieldTableOps_U16
(int numBits, int primitive) Specifies the GF polynomial -
Method Summary
Modifier and TypeMethodDescriptionvoid
polyAdd
(DogArray_I16 polyA, DogArray_I16 polyB, DogArray_I16 output) Adds two polynomials together.void
polyAdd_S
(DogArray_I16 polyA, DogArray_I16 polyB, DogArray_I16 output) Adds two polynomials together.void
polyAddScaleB
(DogArray_I16 polyA, DogArray_I16 polyB, int scaleB, DogArray_I16 output) Adds two polynomials together while scaling the second.void
polyDivide
(DogArray_I16 dividend, DogArray_I16 divisor, DogArray_I16 quotient, DogArray_I16 remainder) Performs polynomial division using a synthetic division algorithm.void
polyDivide_S
(DogArray_I16 dividend, DogArray_I16 divisor, DogArray_I16 quotient, DogArray_I16 remainder) Performs polynomial division using a synthetic division algorithm.int
polyEval
(DogArray_I16 input, int x) Evaluate the polynomial using Horner's method.int
polyEval_S
(DogArray_I16 input, int x) Evaluate the polynomial using Horner's method.int
polyEvalContinue
(int previousOutput, DogArray_I16 part, int x) Continue evaluating a polynomial which has been broken up into multiple arrays.void
polyMult
(DogArray_I16 polyA, DogArray_I16 polyB, DogArray_I16 output) Coefficients for largest powers are first, e.g.void
polyMult_flipA
(DogArray_I16 polyA, DogArray_I16 polyB, DogArray_I16 output) void
polyMult_S
(DogArray_I16 polyA, DogArray_I16 polyB, DogArray_I16 output) Identical topolyMult(DogArray_I16, DogArray_I16, DogArray_I16)
void
polyScale
(DogArray_I16 input, int scale, DogArray_I16 output) Scales the polynomial.
-
Constructor Details
-
GaliosFieldTableOps_U16
public GaliosFieldTableOps_U16(int numBits, int primitive) Specifies the GF polynomial- Parameters:
numBits
- Number of bits needed to describe the polynomial. GF(2**8) = 8 bitsprimitive
- The primitive polynomial
-
-
Method Details
-
polyScale
Scales the polynomial.Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]
- Parameters:
input
- Input polynomial.scale
- scaleoutput
- Output polynomial.
-
polyAdd
Adds two polynomials together. output = polyA + polyBCoefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]
- Parameters:
polyA
- (Input) First polynomialpolyB
- (Input) Second polynomialoutput
- (Output) Results of addition
-
polyAdd_S
Adds two polynomials together.Coefficients for smallest powers are first, e.g. 2*x**3 + 8*x**2+1 = [1,0,2,8]
- Parameters:
polyA
- (Input) First polynomialpolyB
- (Input) Second polynomialoutput
- (Output) Results of addition
-
polyAddScaleB
Adds two polynomials together while scaling the second.Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]
- Parameters:
polyA
- (Input) First polynomialpolyB
- (Input) Second polynomialscaleB
- (Input) Scale factor applied to polyBoutput
- (Output) Results of addition
-
polyMult
Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]
-
polyMult_flipA
-
polyMult_S
Identical topolyMult(DogArray_I16, DogArray_I16, DogArray_I16)
Coefficients for smallest powers are first, e.g. 2*x**3 + 8*x**2+1 = [1,0,2,8]
-
polyEval
Evaluate the polynomial using Horner's method. Avoids explicit calculating the powers of x.01x**4 + 0fx**3 + 36x**2 + 78x + 40 = (((01 x + 0f) x + 36) x + 78) x + 40
Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]
- Parameters:
input
- Polynomial being evaluatedx
- Value of x- Returns:
- Output of function
-
polyEval_S
Evaluate the polynomial using Horner's method. Avoids explicit calculating the powers of x.01x**4 + 0fx**3 + 36x**2 + 78x + 40 = (((01 x + 0f) x + 36) x + 78) x + 40
Coefficients for smallest powers are first, e.g. 2*x**3 + 8*x**2+1 = [1,0,2,8]
- Parameters:
input
- Polynomial being evaluatedx
- Value of x- Returns:
- Output of function
-
polyEvalContinue
Continue evaluating a polynomial which has been broken up into multiple arrays.- Parameters:
previousOutput
- Output from the evaluation of the prior part of the polynomialpart
- Additional segment of the polynomialx
- Point it's being evaluated at- Returns:
- results
-
polyDivide
public void polyDivide(DogArray_I16 dividend, DogArray_I16 divisor, DogArray_I16 quotient, DogArray_I16 remainder) Performs polynomial division using a synthetic division algorithm.Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]
- Parameters:
dividend
- (Input) Polynomial dividenddivisor
- (Input) Polynomial divisorquotient
- (Output) Division's quotientremainder
- (Output) Divisions's remainder
-
polyDivide_S
public void polyDivide_S(DogArray_I16 dividend, DogArray_I16 divisor, DogArray_I16 quotient, DogArray_I16 remainder) Performs polynomial division using a synthetic division algorithm.Coefficients for smallest powers are first, e.g. 2*x**3 + 8*x**2+1 = [1,0,2,8]
- Parameters:
dividend
- (Input) Polynomial dividenddivisor
- (Input) Polynomial divisorquotient
- (Output) Division's quotientremainder
- (Output) Divisions's remainder
-