Camel-cased log_table, exp_table vars

git-svn-id: https://zxing.googlecode.com/svn/trunk@609 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-10-09 12:17:37 +00:00
parent 76b4fa1910
commit 83c01f0cee

View file

@ -31,8 +31,8 @@ public final class GF256 {
public static final GF256 QR_CODE_FIELD = new GF256(0x011D); // x^8 + x^4 + x^3 + x^2 + 1 public static final GF256 QR_CODE_FIELD = new GF256(0x011D); // x^8 + x^4 + x^3 + x^2 + 1
public static final GF256 DATA_MATRIX_FIELD = new GF256(0x012D); // x^8 + x^5 + x^3 + x^2 + 1 public static final GF256 DATA_MATRIX_FIELD = new GF256(0x012D); // x^8 + x^5 + x^3 + x^2 + 1
private final int[] exp_table; private final int[] expTable;
private final int[] log_table; private final int[] logTable;
private final GF256Poly zero; private final GF256Poly zero;
private final GF256Poly one; private final GF256Poly one;
@ -44,20 +44,20 @@ public final class GF256 {
* coefficient * coefficient
*/ */
private GF256(int primitive) { private GF256(int primitive) {
exp_table = new int[256]; expTable = new int[256];
log_table = new int[256]; logTable = new int[256];
int x = 1; int x = 1;
for (int i = 0; i < 256; i++) { for (int i = 0; i < 256; i++) {
exp_table[i] = x; expTable[i] = x;
x <<= 1; // x = x * 2; we're assuming the generator alpha is 2 x <<= 1; // x = x * 2; we're assuming the generator alpha is 2
if (x >= 0x100) { if (x >= 0x100) {
x ^= primitive; x ^= primitive;
} }
} }
for (int i = 0; i < 255; i++) { for (int i = 0; i < 255; i++) {
log_table[exp_table[i]] = i; logTable[expTable[i]] = i;
} }
// log_table[0] == 0 but this should never be used // logTable[0] == 0 but this should never be used
zero = new GF256Poly(this, new int[]{0}); zero = new GF256Poly(this, new int[]{0});
one = new GF256Poly(this, new int[]{1}); one = new GF256Poly(this, new int[]{1});
} }
@ -98,7 +98,7 @@ public final class GF256 {
* @return 2 to the power of a in GF(256) * @return 2 to the power of a in GF(256)
*/ */
int exp(int a) { int exp(int a) {
return exp_table[a]; return expTable[a];
} }
/** /**
@ -108,7 +108,7 @@ public final class GF256 {
if (a == 0) { if (a == 0) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
return log_table[a]; return logTable[a];
} }
/** /**
@ -118,7 +118,7 @@ public final class GF256 {
if (a == 0) { if (a == 0) {
throw new ArithmeticException(); throw new ArithmeticException();
} }
return exp_table[255 - log_table[a]]; return expTable[255 - logTable[a]];
} }
/** /**
@ -136,7 +136,7 @@ public final class GF256 {
if (b == 1) { if (b == 1) {
return a; return a;
} }
return exp_table[(log_table[a] + log_table[b]) % 255]; return expTable[(logTable[a] + logTable[b]) % 255];
} }
} }