|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.mixminion.fec.FECMath
public class FECMath
This class provides the majority of the logic for the pure Java implementation of the vandermonde FEC codes. This code is heavily derived from Luigi Rizzo's original C implementation. Copyright information can be found in the 'LICENSE' file that comes with this distribution. (c) Copyright 2001 Onion Networks (c) Copyright 2000 OpenCola
Field Summary | |
---|---|
char[] |
gf_exp
To speed up computations, we have tables for logarithm, exponent and inverse of a number. |
int[] |
gf_log
|
char[][] |
gf_mul_table
gf_mul(x,y) multiplies two numbers. |
int |
gfBits
The following parameter defines how many bits are used for field elements. |
int |
gfSize
|
char[] |
inverse
|
static java.lang.String[] |
prim_polys
Primitive polynomials - see Lin & Costello, Appendix A, and Lee & Messerschmitt, p. |
Constructor Summary | |
---|---|
FECMath()
|
|
FECMath(int gfBits)
|
Method Summary | |
---|---|
void |
addMul(byte[] dst,
int dstPos,
byte[] src,
int srcPos,
byte c,
int len)
|
void |
addMul(char[] dst,
int dstPos,
char[] src,
int srcPos,
char c,
int len)
|
protected char[] |
createDecodeMatrix(char[] encMatrix,
int[] index,
int k,
int n)
createDecodeMatrix constructs the encoding matrix given the indexes. |
char[] |
createEncodeMatrix(int k,
int n)
|
static char[] |
createGFMatrix(int rows,
int cols)
Generate GF(2**m) from the irreducible polynomial p(X) in p[0]..p[m] Lookup tables: index->polynomial form gf_exp[] contains j= \alpha^i; polynomial form -> index form gf_log[ j = \alpha^i ] = i \alpha=x is the primitive element of GF(2^m) For efficiency, gf_exp[] has size 2*gfSize, so that a simple multiplication of two numbers can be resolved without calling modnn |
void |
generateGF()
|
void |
initMulTable()
|
void |
invertMatrix(char[] src,
int k)
|
void |
invertVandermonde(char[] src,
int k)
|
static boolean |
isIdentity(char[] m,
int k)
|
void |
matMul(char[] a,
char[] b,
char[] c,
int n,
int k,
int m)
|
void |
matMul(char[] a,
int aStart,
char[] b,
int bStart,
char[] c,
int cStart,
int n,
int k,
int m)
|
char |
modnn(int x)
modnn(x) computes x % gfSize, where gfSize is 2**gfBits - 1, without a slow divide. |
char |
mul(char x,
char y)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int gfBits
public int gfSize
public static final java.lang.String[] prim_polys
public char[] gf_exp
public int[] gf_log
public char[] inverse
public char[][] gf_mul_table
Constructor Detail |
---|
public FECMath()
public FECMath(int gfBits)
Method Detail |
---|
public final void generateGF()
public final void initMulTable()
public final char modnn(int x)
public final char mul(char x, char y)
public static final char[] createGFMatrix(int rows, int cols)
public final void addMul(char[] dst, int dstPos, char[] src, int srcPos, char c, int len)
public final void addMul(byte[] dst, int dstPos, byte[] src, int srcPos, byte c, int len)
public final void matMul(char[] a, char[] b, char[] c, int n, int k, int m)
public final void matMul(char[] a, int aStart, char[] b, int bStart, char[] c, int cStart, int n, int k, int m)
public static final boolean isIdentity(char[] m, int k)
public final void invertMatrix(char[] src, int k) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public final void invertVandermonde(char[] src, int k)
public final char[] createEncodeMatrix(int k, int n)
protected final char[] createDecodeMatrix(char[] encMatrix, int[] index, int k, int n)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |