Class GaliosFieldTableOps_U8
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
ConstructorsConstructorDescriptionGaliosFieldTableOps_U8(int numBits, int primitive) Specifies the GF polynomial -
Method Summary
Modifier and TypeMethodDescriptionvoidpolyAdd(DogArray_I8 polyA, DogArray_I8 polyB, DogArray_I8 output) Adds two polynomials together.voidpolyAdd_S(DogArray_I8 polyA, DogArray_I8 polyB, DogArray_I8 output) Adds two polynomials together.voidpolyAddScaleB(DogArray_I8 polyA, DogArray_I8 polyB, int scaleB, DogArray_I8 output) Adds two polynomials together while scaling the second.voidpolyDivide(DogArray_I8 dividend, DogArray_I8 divisor, DogArray_I8 quotient, DogArray_I8 remainder) Performs polynomial division using a synthetic division algorithm.voidpolyDivide_S(DogArray_I8 dividend, DogArray_I8 divisor, DogArray_I8 quotient, DogArray_I8 remainder) Performs polynomial division using a synthetic division algorithm.intpolyEval(DogArray_I8 input, int x) Evaluate the polynomial using Horner's method.intpolyEval_S(DogArray_I8 input, int x) Evaluate the polynomial using Horner's method.intpolyEvalContinue(int previousOutput, DogArray_I8 part, int x) Continue evaluating a polynomial which has been broken up into multiple arrays.voidpolyMult(DogArray_I8 polyA, DogArray_I8 polyB, DogArray_I8 output) Coefficients for largest powers are first, e.g.voidpolyMult_flipA(DogArray_I8 polyA, DogArray_I8 polyB, DogArray_I8 output) voidpolyMult_S(DogArray_I8 polyA, DogArray_I8 polyB, DogArray_I8 output) Identical topolyMult(DogArray_I8, DogArray_I8, DogArray_I8)voidpolyScale(DogArray_I8 input, int scale, DogArray_I8 output) Scales the polynomial.
-
Constructor Details
-
GaliosFieldTableOps_U8
public GaliosFieldTableOps_U8(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_I8, DogArray_I8, DogArray_I8)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_I8 dividend, DogArray_I8 divisor, DogArray_I8 quotient, DogArray_I8 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_I8 dividend, DogArray_I8 divisor, DogArray_I8 quotient, DogArray_I8 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
-