@Private
public class GaloisField
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
int[] |
add(int[] p,
int[] q) |
Compute the sum of two polynomials.
|
int |
add(int x,
int y) |
Compute the sum of two fields
|
int |
divide(int x,
int y) |
Compute the division of two fields
|
void |
gaussianElimination(int[][] matrix) |
Perform Gaussian elimination on the given matrix.
|
int |
getFieldSize() |
Return number of elements in the field
|
static GaloisField |
getInstance() |
Get the object performs Galois field arithmetic with default setting.
|
static GaloisField |
getInstance(int fieldSize,
int primitivePolynomial) |
Get the object performs Galois field arithmetics.
|
int |
getPrimitivePolynomial() |
Return the primitive polynomial in GF(2)
|
int[] |
multiply(int[] p,
int[] q) |
Compute the multiplication of two polynomials.
|
int |
multiply(int x,
int y) |
Compute the multiplication of two fields
|
int |
power(int x,
int n) |
Compute power n of a field
|
void |
remainder(byte[][] dividend,
int[] divisor) |
The "bulk" version of the remainder.
|
void |
remainder(byte[][] dividend,
int[] offsets,
int len,
int[] divisor) |
The "bulk" version of the remainder.
|
void |
remainder(int[] dividend,
int[] divisor) |
Compute the remainder of a dividend and divisor pair.
|
void |
remainder(java.nio.ByteBuffer[] dividend,
int[] divisor) |
The "bulk" version of the remainder, using ByteBuffer.
|
void |
solveVandermondeSystem(int[] x,
byte[][] y,
int[] outputOffsets,
int len,
int dataLen) |
A "bulk" version to the solving of Vandermonde System.
|
void |
solveVandermondeSystem(int[] x,
int[] y) |
Given a Vandermonde matrix V[i][j]=x[j]^i and vector y, solve for z such
that Vz=y.
|
void |
solveVandermondeSystem(int[] x,
int[] y,
int len) |
Given a Vandermonde matrix V[i][j]=x[j]^i and vector y, solve for z such
that Vz=y.
|
void |
solveVandermondeSystem(int[] x,
java.nio.ByteBuffer[] y,
int len) |
A "bulk" version of the solveVandermondeSystem, using ByteBuffer.
|
void |
substitute(byte[][] p,
byte[] q,
int x) |
A "bulk" version of the substitute.
|
void |
substitute(byte[][] p,
int[] offsets,
int len,
byte[] q,
int offset,
int x) |
A "bulk" version of the substitute.
|
int |
substitute(int[] p,
int x) |
Substitute x into polynomial p(x).
|
void |
substitute(java.nio.ByteBuffer[] p,
int len,
java.nio.ByteBuffer q,
int x) |
A "bulk" version of the substitute, using ByteBuffer.
|
public static GaloisField getInstance(int fieldSize, int primitivePolynomial)
fieldSize - size of the fieldprimitivePolynomial - a primitive polynomial corresponds to the sizepublic static GaloisField getInstance()
public int getFieldSize()
public int getPrimitivePolynomial()
public int add(int x,
int y)
x - input fieldy - input fieldpublic int multiply(int x,
int y)
x - input fieldy - input fieldpublic int divide(int x,
int y)
x - input fieldy - input fieldpublic int power(int x,
int n)
x - input fieldn - powerpublic void solveVandermondeSystem(int[] x,
int[] y)
x - the vector which describe the Vandermonde matrixy - right-hand side of the Vandermonde system equation. will be
replaced the output in this vectorpublic void solveVandermondeSystem(int[] x,
int[] y,
int len)
x - the vector which describe the Vandermonde matrixy - right-hand side of the Vandermonde system equation. will be
replaced the output in this vectorlen - consider x and y only from 0...len-1public void solveVandermondeSystem(int[] x,
byte[][] y,
int[] outputOffsets,
int len,
int dataLen)
x - input x.y - input y.outputOffsets - input outputOffsets.len - input len.dataLen - input dataLen.public void solveVandermondeSystem(int[] x,
java.nio.ByteBuffer[] y,
int len)
x - input x.y - input y.len - input len.public int[] multiply(int[] p,
int[] q)
p - input polynomialq - input polynomialpublic void remainder(int[] dividend,
int[] divisor)
dividend - dividend polynomial, the remainder will be placed
here when returndivisor - divisor polynomialpublic int[] add(int[] p,
int[] q)
p - input polynomialq - input polynomialpublic int substitute(int[] p,
int x)
p - input polynomialx - input fieldpublic void substitute(byte[][] p,
byte[] q,
int x)
p - input polynomialq - store the return resultx - input fieldpublic void substitute(byte[][] p,
int[] offsets,
int len,
byte[] q,
int offset,
int x)
p - input polynomialoffsets - input offset.len - input len.q - store the return resultoffset - input offset.x - input fieldpublic void substitute(java.nio.ByteBuffer[] p,
int len,
java.nio.ByteBuffer q,
int x)
p - input polynomialq - store the return resultx - input fieldlen - input len.public void remainder(byte[][] dividend,
int[] divisor)
divisor - divisor.dividend - dividend.public void remainder(byte[][] dividend,
int[] offsets,
int len,
int[] divisor)
dividend - dividend.offsets - offsets.len - len.divisor - divisor.public void remainder(java.nio.ByteBuffer[] dividend,
int[] divisor)
dividend - dividend.divisor - divisor.public void gaussianElimination(int[][] matrix)
matrix - matrix.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.