|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--HFE.Poly2Max
This class provides polynomials of positive degree over
the finite field F_2 which is provided in the class Field2
.
It also provides addition, multiplication and modulo-operations
The maximal degree of the polynomials is fixed by the constant
maxLen
Field Summary | |
static int |
maxLen
Maximal length of the polynomials |
private static Poly2Max |
modulus
Modulus for the mod version of the operations |
private int[] |
value
Current value of the polynomial. |
Constructor Summary | |
(package private) |
Poly2Max()
sets all the coefficients to zero |
(package private) |
Poly2Max(int initValue)
Creates a new polynomial. |
(package private) |
Poly2Max(int[] inArray)
array2poly(int[]) |
(package private) |
Poly2Max(Poly2Max father)
Creates a copy from the given polynomial |
(package private) |
Poly2Max(Poly2Max father,
int shift)
Takes one polynomial and shifts it by the given shift. |
Method Summary | |
(package private) void |
add(Poly2Max whom)
calculate this += whom as polynomial addition |
(package private) void |
add(Poly2Max a,
Poly2Max b)
calculates this = wen1 + wen2 as polynomial addition |
(package private) void |
addMod(Poly2Max b)
Computes this = (this+b)%modul. |
(package private) void |
addMod(Poly2Max a,
Poly2Max b)
Computes this = (a+b)%modul. |
(package private) void |
array2poly(int[] inArray)
Sets the coefficients using the given power array. |
(package private) int |
coeff(int which)
Returns te coefficient for a given degree which (i.e. |
(package private) int |
degree()
Returns the degree of the object. |
(package private) void |
int2poly(int intValue)
Sets the coefficients according to intValue. |
(package private) boolean |
isEqual(Poly2Max whom)
Compares the current polynomial with the given one. |
(package private) boolean |
isZero()
Checks if a polynomial is the zero polynomial. |
static void |
main(java.lang.String[] args)
Mainly invoces the testIt() method. |
(package private) void |
mod()
Calculates this %= moduls. |
(package private) void |
mod(Poly2Max b)
Calculates this %= b |
(package private) void |
mod(Poly2Max a,
Poly2Max b)
Calculates this = a % b |
(package private) void |
mul(Poly2Max a,
Poly2Max b)
calculates this = a * b as polynomial addition. |
(package private) void |
mulFactor(int factor)
multiplies all coefficients by the given factor in F_2. |
(package private) void |
mulMod(Poly2Max a,
Poly2Max b)
Computes this = (a*b)%modul. |
(package private) int |
polyInt()
Returns the polynomial as an integer. |
(package private) void |
pow(Poly2Max base,
int by)
calculates this = base^by. |
(package private) static void |
setModulus(Poly2Max newModulus)
Sets the private field modulus. |
(package private) void |
setZero()
Sets all the coefficients to zero by allocating new memory |
(package private) static void |
testIt()
Tests the functionality for the whole class. |
(package private) void |
writeString()
Writes the polynomial as a string to stdout |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int maxLen
private static Poly2Max modulus
private int[] value
Constructor Detail |
Poly2Max()
Poly2Max(int initValue)
int2poly(int)
Poly2Max(Poly2Max father)
Poly2Max(Poly2Max father, int shift)
Poly2Max(int[] inArray)
array2poly(int[])
Method Detail |
static void setModulus(Poly2Max newModulus)
int degree()
int coeff(int which)
boolean isEqual(Poly2Max whom)
boolean isZero()
void setZero()
void int2poly(int intValue)
void array2poly(int[] inArray)
void mulFactor(int factor)
void add(Poly2Max a, Poly2Max b)
void add(Poly2Max whom)
void mul(Poly2Max a, Poly2Max b)
void pow(Poly2Max base, int by)
void mod()
void mod(Poly2Max a, Poly2Max b)
void mod(Poly2Max b)
void addMod(Poly2Max a, Poly2Max b)
void addMod(Poly2Max b)
void mulMod(Poly2Max a, Poly2Max b)
void writeString()
int polyInt()
static void testIt()
public static void main(java.lang.String[] args)
testIt()
method.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |