public class GaliosFieldOps
extends java.lang.Object
Code and code comments based on the tutorial at [1].
[1] Reed-Solomon Codes for Coders Viewed on September 28, 2017
| Constructor and Description |
|---|
GaliosFieldOps() |
| Modifier and Type | Method and Description |
|---|---|
static int |
add(int a,
int b) |
static int |
divide(int dividend,
int divisor)
Divides dividend by the divisor and returns the integer results, e.g.
|
static int |
length(int value)
The bit in which the most significant non-zero bit is stored
|
static int |
modulus(int dividend,
int divisor)
Performs the polynomial GF modulus operation.
|
static int |
multiply(int a,
int b)
Multiply the two polynomials together.
|
static int |
multiply(int x,
int y,
int primitive,
int domain)
Implementation of multiplication with a primitive polynomial.
|
static int |
subtract(int a,
int b) |
public static int add(int a,
int b)
public static int subtract(int a,
int b)
public static int multiply(int a,
int b)
Multiply the two polynomials together. The technique used here isn't the fastest but is easy to understand.
NOTE: No modulus operation is performed so the result might not be a member of the same field.
a - polynomialb - polynomialpublic static int multiply(int x,
int y,
int primitive,
int domain)
x - polynomialy - polynomialprimitive - Primitive polynomial which is irreducible.domain - Value of a the largest possible value plus 1. E.g. GF(2**8) would be 256public static int modulus(int dividend,
int divisor)
Performs the polynomial GF modulus operation.
result = dividend mod divisor.public static int divide(int dividend,
int divisor)
Divides dividend by the divisor and returns the integer results, e.g. no remainder.
result = dividend / divisordividend - number on topdivisor - number on bottompublic static int length(int value)